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

Make package installation automatic and deprecate manual installation #132

Closed LilithHafner closed 7 months ago

LilithHafner commented 7 months ago

This has three benefits

The principle is to use

try
    import Package
catch
    import Pkg
    Pkg.add("Package")
    import Package
end

Before

>>> from juliacall import ode
...
juliacall.JuliaError: ArgumentError: Package OrdinaryDiffEq not found in current path.
- Run `import Pkg; Pkg.add("OrdinaryDiffEq")` to install the OrdinaryDiffEq package. # bad hint
...
>>> import juliacall
>>> juliacall.install() # Installs de and ode
...
>>> from juliacall import ode

After

>>> from juliacall import ode # Installs de

Also changes the API of the internal load_julia_packages to be more reasonable (takes a list of strings instead of a string with commas in it) and more robust ("just works" regardless of instillation status)

TODO: support manual updates with diffeqpy.update() => Pkg.up() or similar.