SciML / diffeqpy

Solving differential equations in Python using DifferentialEquations.jl and the SciML Scientific Machine Learning organization
MIT License
508 stars 39 forks source link

Add support for PresetTimeCallback #92

Closed alexlenail closed 3 years ago

alexlenail commented 3 years ago

Low priority, since I can get what I need from DiscreteCallback.

~ » julia
               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.5.4 (2021-03-11)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
|__/                   |

julia> using DifferentialEquations

julia> DiscreteCallback
DiscreteCallback

julia> PresetTimeCallback
PresetTimeCallback (generic function with 1 method)

julia>
------------------------------------------------------------
~ » python
Python 3.7.10 (default, Apr 27 2021, 08:49:44)
[Clang 12.0.0 (clang-1200.0.32.29)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from diffeqpy import ode
>>> ode.DiscreteCallback
<PyCall.jlwrap DiffEqBase.DiscreteCallback>
>>> ode.PresetTimeCallback
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.7/site-packages/julia/core.py", line 176, in __getattr__
    return self.__try_getattr(name)
  File "/usr/local/lib/python3.7/site-packages/julia/core.py", line 199, in __try_getattr
    raise AttributeError(name)
AttributeError: PresetTimeCallback
>>>
alexlenail commented 3 years ago

Hmm, it seems like PresetTimeCallback exists under de but not ode.

>>> from diffeqpy import de
>>> de.PresetTimeCallback
<PyCall.jlwrap PresetTimeCallback>
ChrisRackauckas commented 3 years ago

yes, it's in DifferentialEquations.jl but not OrdinaryDiffEq.jl.