Specification of sign change direction
Hi diffrax team,
I feel like it would be a nice addition to the current Events, if it was possible to specify the direction of the sign change of the cond_fn that triggers an event and choose between unidirectional (lets say positive to negative) or bidirectional (as it is now). Doesn't have super high prio for me atm but thought i'll throw it in here.
What do you think? If thats useful and you think its easy to do I could have a look how to get that working. Thanks for the help :)
This sounds reasonable as a feature request. Do you have any suggestions on how this should fit into the current API?
I would just extend Event by a parameter bidirectional (Pytree of bool) which If you pass None or True all elements (size of cond_fn) are set to to True. If you pass Falseall elements are set to False and if you pass a PyTree of the right size (same as cond_fn) then that is used?
Then just adjust the logic in _integrate.py to also work with that. Does that sound good? :)
I created a firs draft of this here: https://github.com/patrick-kidger/diffrax/pull/643.