Skip to content

Conversation

@johannahaffner
Copy link
Contributor

Solves #705.

# Check if the solver is an instance of AbstractSolver and provide an informative
# error if it is not. Addresses https://github.com/patrick-kidger/diffrax/issues/705
if not isinstance(solver, AbstractSolver):
if issubclass(solver, AbstractSolver):
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will error out if solver is not a class. We need isinstance(solver, type) and issubclass(solver, AbstractSolver).

if issubclass(solver, AbstractSolver):
msg = (
"It looks like you forgot to instantiate your solver, e.g. by passing "
"`dfx.Euler` instead of `dfx.Euler()`."
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The dfx abbreviation isn't as standardized as eqx is; I think we should write out diffrax instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants