pnkraemer / probdiffeq

Probabilistic solvers for differential equations in JAX. Adaptive ODE solvers with calibration, state-space model factorisations, and custom information operators. Compatible with the broader JAX scientific computing ecosystem.
https://pnkraemer.github.io/probdiffeq/
MIT License
30 stars 2 forks source link

Regroup parts of the public API to reduce how many modules we must import before solving an ODE #747

Closed pnkraemer closed 2 months ago

pnkraemer commented 2 months ago

Context: To solve an ODE with probdiffeq, a user needs to import many modules even though there exist multiple pairs of modules that are always used together and even depend on each other in some cases. For example, here is the header of the Probabilistic solvers as collocation methods tutorial:

"""Demonstrate how probabilistic solvers work via conditioning on constraints."""

import jax
import jax.numpy as jnp
import matplotlib.pyplot as plt
from diffeqzoo import backend

from probdiffeq import adaptive, ivpsolve, timestep
from probdiffeq.impl import impl
from probdiffeq.solvers import markov, uncalibrated
from probdiffeq.solvers.strategies import fixedpoint
from probdiffeq.solvers.strategies.components import corrections, priors
from probdiffeq.taylor import autodiff
from probdiffeq.util.doc_util import notebook

What: I suggest merging the following modules:

These changes break the existing API. Therefore, the next version (after completing this issue) will increase the minor version, not the patch version.

More context:

pnkraemer commented 2 months ago

This issue is now resolved. For an update, here is how the above-linked header changed:

"""Demonstrate how probabilistic solvers work via conditioning on constraints."""

import jax
import jax.numpy as jnp
import matplotlib.pyplot as plt
from diffeqzoo import backend

from probdiffeq import ivpsolve, ivpsolvers, stats, taylor
from probdiffeq.impl import impl
from probdiffeq.util.doc_util import notebook