-
Notifications
You must be signed in to change notification settings - Fork 3
Add solvers #26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Add solvers #26
Conversation
deer/fsolve_ivp.py
Outdated
| def success_fn(carry, i): | ||
| yi, _ = carry | ||
| xi = xinp[i-1] | ||
| dx = xinp[i] - xinp[i-1] | ||
| dt = tpts[i] - tpts[i-1] | ||
| yn, success = self.ode_step(func, yi, xi, dt, dx, params) | ||
| return yn, success |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like xinp and tpts variables are coming from outside this function and that would make this function unpure. JAX has a strong obsession with pure function (see this for example), so can you make it a pure function?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed with make function purer
Resolve #18