Skip to content
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

Events #387

Merged
merged 28 commits into from
Jun 29, 2024
Merged
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
2b6d8ff
Changes to how events are handled in diffrax.
cholberg Feb 21, 2024
3e367f2
Test now fails when no root finder is provided
cholberg May 7, 2024
3f67a27
Saving events with `SubSaveAt`s
cholberg May 15, 2024
76762c1
Accounting for `SubSaveAt.fn` returning a PyTree
cholberg May 15, 2024
76cd083
Adjustments to #387 (events):
patrick-kidger May 19, 2024
e2ab3ce
Save values returned by root find when
cholberg May 23, 2024
0853e49
now returns condition function
cholberg May 24, 2024
1488206
Fixed error for . All tests pass now.
cholberg May 24, 2024
4872009
Added additional tests
cholberg May 26, 2024
a1f577c
Fixed save_index update and shape+dtype check for cond_fn
cholberg May 27, 2024
95ac30f
Added PyTree check in _outer_cond_fn
cholberg May 27, 2024
0c820f3
Added tests for checking that events error out correctly under misspe…
cholberg May 27, 2024
57d90c5
Fixed small error in the save_index update for events
cholberg May 27, 2024
1bdf1d2
Updated how events are saved
cholberg May 27, 2024
55e04e8
Added tests for different configurations of saveat
cholberg May 27, 2024
d8a8ba7
Changed to ValueError when cond_fn returns non-boolean/float.
cholberg May 28, 2024
70e044f
Added docstring to Event class
cholberg May 28, 2024
4c509b6
Updated docstring for steady_state_event
cholberg May 28, 2024
fbea794
Updated docstring for ImplicitAdjoint
cholberg May 28, 2024
b158800
Added example to Event docstring
cholberg May 28, 2024
812e5c6
Updated steady state example to use the new syntax
cholberg May 28, 2024
eb16e57
Fixed weird type checker error
cholberg Jun 1, 2024
09c92c3
Updated steady state test to use the new syntax
cholberg Jun 10, 2024
d07c8f4
Doc tweaks for events
patrick-kidger Jun 15, 2024
883841f
Typo in comment
cholberg Jun 16, 2024
0c62f4c
Simplified unsaving
cholberg Jun 18, 2024
7588482
Deleted extra unnecessary argument
cholberg Jun 25, 2024
e4935ae
Changed to strict inequality to be in line with the usual saving behv…
cholberg Jun 27, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fixed weird type checker error
cholberg committed Jun 25, 2024
commit eb16e57c8e521f5915d6ee98515c5b3d1680a804
4 changes: 2 additions & 2 deletions diffrax/_integrate.py
Original file line number Diff line number Diff line change
@@ -553,7 +553,7 @@ def _outer_cond_fn(cond_fn_i, old_event_value_i):
event_structure = jtu.tree_structure(event.cond_fn, is_leaf=callable)
event_values, event_mask = jtu.tree_transpose(
event_structure,
None, # pyright: ignore
jtu.tree_structure((0, 0)),
event_values__mask,
)
had_event = False
@@ -1334,7 +1334,7 @@ def _outer_cond_fn(cond_fn_i):
event_structure = jtu.tree_structure(event.cond_fn, is_leaf=callable)
event_values, event_mask = jtu.tree_transpose(
event_structure,
None, # pyright: ignore
jtu.tree_structure((0, 0)),
event_values__mask,
)
had_event = False