Diffrax v0.7.1
Phew, long time between releases! I hope this is what stable software looks like. This release is mostly lots of edge-case bugfixes.
Features
SaveAt(steps=<int>)can now be used to save everynth step. Setting this toTrue(the previous behaviour) still corresponds to saving every step. (Thanks @alessandrofasse! #625, #626)- Events can now be triggered based on the direction of crossing zero. (Thanks @LuggiStruggi #640, #655)
- Recall that we have boolean events (an
f(y)that terminates the solve at the end of a step once it becomes true) and continuous events (anf(y)that triggers whenf(y)= 0, and we do a root-find to get the exactyfor which equality holds). - Specifically, continuous events can now be set to trigger if zero is reached from above, from below, or from either side (the current default).
- Recall that we have boolean events (an
Bugfixes
- v0.7.0 had massively slowed down compilation speeds. This is now fixed. (Thanks @HeSchatz! #606, #618)
- Fixed
PIDController(..., jump_ts=...),PIDController(..., step_ts=...)andClipStepSizeController(...)to correctly be treated as adaptive step size controllers. This was particularly important when used with implicit solvers, which would otherwise complain that they need to be paired with an adaptive step size controller. (Thanks @terhorst! #607, #608, #723) - Fixed
diffrax.ALIGNto correctly be considered an adaptive step size controller. (Thanks @lockwo! #670, #674) - Fixed a crash that occurred in serialization/distributed scenarios, by replacing
is jnp.dtype(bool)with== jnp.dtype(bool). (Thanks @ArianAmani! #678, #679) - Fixed very small timesteps, or very small time intervals, getting undesirably clipped for numerical stability reasons. (Thanks @jpbrodrick89, @varchasgopalaswamy, @aidancrilly! #632, #657, #660, #666. As part of this note that the evolving state for
ConstantStepSizehas changed. Though as the structure of these states is not considered public then this is not considered a breaking change.) - Fixed numerical stability issues sometimes leading to infinite loops when using
PIDController(dt_min=..., force_dtmin=True). (Thanks @philipwijesinghe! #703, #704) - Fixed wrong solve behaviour if the
t0ofdiffeqsolve(t0=...)was exactly 1 ULP before a jump time (ClipStepSizeController(..., jump_ts=...)orPIDController(jump_ts=...)). (Thanks @FFroehlich! #713, #714) - Fixed wrong output when a boolean event is provided, and a root finder is provided, and the boolean event triggers on the first step. (Thanks @BSnelling! #720, #724)
Misc
- Lots and lots of doc updates. (Thanks @andyElking @johannahaffner @homerjed! #469 #620 #647 #675)
- Better error messages when the vector field has the wrong shape. (Thanks @jpbrodrick89! #681, #682)
- For contributors: updated our approach to dependencies, with
dev/test/docextras for runningpre-commit/pytest/mkdocsinside of. See the newCONTRIBUTING.md.
New Contributors
- @homerjed made their first contribution in #675
- @ArianAmani made their first contribution in #679
Full Changelog: v0.7.0...v0.7.1