Skip to content

TypeError: 'file' is an invalid keyword argument for warn() #274

@pgzmnk

Description

@pgzmnk

Running odeint with fixed_adams solver. If the model doesn't converge, an error with the warnings.warn method arises.

sol = odeint(
    model, 
    ic[0], 
    ts,
    method="fixed_adams",
     ).detach().numpy()

Error:

File /opt/conda/envs/arcade/lib/python3.12/site-packages/torchdiffeq/_impl/fixed_adams.py:220, in AdamsBashforthMoulton._step_func(self, func, t0, dt, t1, y0)
    218         break
    219 if not converged:
--> 220     warnings.warn('Functional iteration did not converge. Solution may be incorrect.', file=sys.stderr)
    221     self.prev_f.pop()
    222 self._update_history(t0, f)

TypeError: 'file' is an invalid keyword argument for warn()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions