cbherbert / stochrare

This Python package aims at providing tools to study stochastic processes: integrate SDEs, solve Fokker-Planck equations, sample rare events,...
GNU General Public License v3.0
8 stars 5 forks source link

Unify diffusion modules into single dynamics.diffusion #4

Open tlestang opened 4 years ago

tlestang commented 4 years ago

Currently, the diffusion1d module provides a separate interface to diffusion that focuses on one dimensional processes. The rationale for implementing a separate diffusion1d module are

However the module stochrare.dynamics.diffusion1d effectively greatly overlaps with the more general stochrare.dynamics.diffusion. For example, key methods trajectory and update do not depend on the dimension of the process. Moreover, it is expected that as stochrare grows, both modules will implement the same methods, with the exception of additional methods specific to the 1d case.

We could diffusion1d into the diffusion module, resulting in a single API covering both 1D and n-D processes.

For example:

# New API
from stochrare.dynamics import diffusion
model = diffusion.ConstantDiffusionProcess(lambda x: 2*x, 1)

Should be equivalent to

# Old API
from stochrare.dynamics import diffusion1d
model = diffusion1d.ConstantDiffusionProcess1D(lambda x: 2*x, 1)

For this to work, we must

This issues depends on

tlestang commented 4 years ago

This issue depends on