Pycaputo

Latest version: v0.8.1

Safety actively analyzes 681844 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 2

0.8.1

---------------------------------

Dependencies
^^^^^^^^^^^^

* Add official support for Python 3.13.

Features
^^^^^^^^

* Add :class:`~pycaputo.fode.caputo.BackwardEuler` as a special case of
:class:`~pycaputo.fode.caputo.WeightedEuler` (that should also be slightly
faster).

Fixes
^^^^^

* Make :class:`~pycaputo.controller.FixedController` work correctly when doubling
the time step. Now, when calling :func:`~pycaputo.controller.make_fixed_controller`
with ``dt1`` and ``dt2 = dt1/2``, you'll get exactly double the time steps and they
interlock in such a way that ``t1 == t2[::2]``.

0.8.0

----------------------------------

Dependencies
^^^^^^^^^^^^

* Bumped minimum Python version to 3.10. This is a hard requirement, as it
comes with some changes to the typing syntax and other functions
(e.g. we make use of ``zip(..., strict=True)``).

Features
^^^^^^^^

* Add a :mod:`pycaputo.typing` module containing some helpful typing definitions
(mostly previously in :mod:`pycaputo.utils`).
* Reworked :func:`~functools.singledispatch` functions for
:class:`~pycaputo.differentiation.DerivativeMethod`. We now have
:func:`~pycaputo.differentiation.quadrature_weights`,
:func:`~pycaputo.differentiation.differentiation_matrix`,
:func:`~pycaputo.differentiation.diffs`, and
:func:`~pycaputo.differentiation.diff`. Not all of these need to be implemented
and most methods are not ported yet. Currently only the
:class:`~pycaputo.differentiation.caputo.L1` and
:class:`~pycaputo.differentiation.caputo.L2` methods implement these new functions.
* Introduce some more specific methods for the Caputo derivative. The
:class:`~pycaputo.differentiation.caputo.L2F` uses the L2 method with function
evaluations outside of the interval of definition. The
:class:`~pycaputo.differentiation.caputo.LXD` allows evaluating arbitrary
Caputo derivatives when the integer derivatives are known.
* Added a lot of fancy chaotic systems to :mod:`pycaputo.fode.gallery`. These
are mostly used to showcase the library.

Breaking Changes
^^^^^^^^^^^^^^^^

* Renamed `pycaputo.differentiation.caputo.SpectralJacobi` to
:class:`~pycaputo.differentiation.caputo.Jacobi`.

0.7.0

------------------------------

Dependencies
^^^^^^^^^^^^

* Official support for numpy 2.0. Everything works and is tested on the CI!

Features
^^^^^^^^

* Extend :class:`~pycaputo.fode.caputo.PECE`, :class:`~pycaputo.fode.caputo.PEC`
and :class:`~pycaputo.fode.caputo.ModifiedPECE` to support systems with different
orders (:ghpr:`46` and :ghissue:`17`).
* Implement diffusive methods for evaluating the Riemann-Liouville integral (:ghpr:`48`):
:class:`~pycaputo.quadrature.riemann_liouville.YuanAgrawal`,
:class:`~pycaputo.quadrature.riemann_liouville.Diethelm`, and
:class:`~pycaputo.quadrature.riemann_liouville.BirkSong`.
* Implement diffusive methods for evaluating the Caputo derivative (:ghpr:`49`):
:class:`~pycaputo.differentiation.caputo.YuanAgrawal`,
:class:`~pycaputo.differentiation.caputo.Diethelm`, and
:class:`~pycaputo.differentiation.caputo.BirkSong`.
* Implement approximations of the Grünwald-Letnikov derivative (:ghpr:`51`):
:class:`~pycaputo.differentiation.grunwald_letnikov.GrunwaldLetnikov`,
:class:`~pycaputo.differentiation.grunwald_letnikov.ShiftedGrunwaldLetnikov`,
:class:`~pycaputo.differentiation.grunwald_letnikov.TianZhouDeng2`, and
:class:`~pycaputo.differentiation.grunwald_letnikov.TianZhouDeng3`.
* Add derivatives of some known elementary functions in :mod:`pycaputo.special`
(:ghpr:`50`): ``exp``, ``sin``, ``cos`` and ``pow``. They're mainly based on
the Mittag-Leffler function.

Breaking Changes
^^^^^^^^^^^^^^^^

* Renamed ``RiemannLiouvilleFromCaputoDerivativeMethod`` to
:class:`~pycaputo.differentiation.riemann_liouville.RiemannLiouvilleFromCaputoMethod`.
* Renamed ``CaputoDerivativeMethod`` to
:class:`~pycaputo.differentiation.caputo.CaputoMethod`.

Fixes
^^^^^

* Fix convergence of :class:`~pycaputo.fode.caputo.ModifiedPECE` (:ghissue:`15`).

0.6.0

-----------------------------

Features
^^^^^^^^

* Implement Riemann-Lioville quadrature based on high-order Lagrange polynomials
in :class:`~pycaputo.quadrature.riemann_liouville.SplineLagrange`. These methods
require knowledge of the function :math:`f` being integrated, but can obtain
high order :math:`> 3`.
* Implement the implicit :class:`~pycaputo.fode.caputo.Trapezoidal` and
:class:`~pycaputo.fode.caputo.ExplicitTrapezoidal` methods. These methods are
closely related to the standard :class:`~pycaputo.fode.caputo.PECE` method.
The implicit method has better stability.
* Implement the Mittag-Leffler algorithm from [Garrappa2015]_.
* Added the :mod:`pycaputo.fode.special` module with some exact solutions. This
is subject to a lot of change, but in general it is desired to have some
examples for testing and demonstration.

Breaking Changes
^^^^^^^^^^^^^^^^

* The base :class:`~pycaputo.derivatives.FractionalOperator` no longer defines
an ``order`` attribute. This does not make sense for more complex operators
with multiple parameters.
* :mod:`pycaputo.differentiation` no longer exports all the underlying methods.
It is not required to do e.g. ``from pycaputo.differentiation.caputo import L1``.
* All the methods in :mod:`pycaputo.differentiation` have been renamed without the
derivative type, e.g ``CaputoL1Method`` becomes simply ``L1``.
* The methods in :mod:`pycaputo.differentiation` no longer provide an order. This
was not well-defined, since e.g. the L1 method has different orders depending
on the smoothness of the operand.
* The :mod:`pycaputo.quadrature` module went through similar changes to the
differentiation one.
* The :mod:`pycaputo.fode.caputo` module went through similar changes to the
differentiation and quadrature ones.

0.5.0

-------------------------------

Features
^^^^^^^^

* Implement an implicit adaptive L1 type method for Integrate-and-Fire models
in :mod:`pycaputo.integrate_fire`.
* Implement PIF, LIF, EIF and AdEx models explicitly. These can be used to model
neurons using fractional dynamics.

Maintenance
^^^^^^^^^^^

* Use `uv <https://github.com/astral-sh/uv>`__ to handled pinning dependencies.
* Use `hatchling <https://hatch.pypa.io>`__ as the build backend instead of ``setuptools``.
* Start using `pytest-benchmark <https://pytest-benchmark.readthedocs.io>`__ to
benchmark the code. This still needs a lot of work.

0.4.0

---------------------------------

Features
^^^^^^^^

* Implement an implicit L1 method in :class:`pycaputo.fode.caputo.L1`.
* Store an :class:`~numpy.ndarray` for the orders so that they are not recomputed
at each time step in :class:`~pycaputo.stepping.FractionalDifferentialEquationMethod`.
Several functions using :func:`~pycaputo.utils.cached_on_first_arg`, e.g.
:func:`~pycaputo.stepping.gamma1p` are also cached.
* Rework the hierarchy for the product integration methods and update their
names. They are now available in :mod:`pycaputo.fode.caputo` only and called
directly ``ForwardEuler`` (before it was ``CaputoForwardEulerMethod``).
* Promote events to :mod:`pycaputo.events`. Specific methods can then inherit
from there to return additional information, as required.
* Add some dataclass helpers, e.g. :func:`~pycaputo.utils.dc_stringify`. All
numerical methods store their parameters in a dataclass, so these are used
all over.

Fixes
^^^^^

* Add more extensive tests for the Mittag-Leffler function.
* Add a ``py.typed`` file for upstream projects.
* Updated and fixed Lorenz example with
:class:`~pycaputo.fode.caputo.WeightedEuler` (:ghpr:`19`).
* Use :func:`numpy.einsum` to compute weights for faster evaluation.

Maintenance
^^^^^^^^^^^

* Use ``ruff format`` for our formatting needs.
* Switch to a ``src`` based layout.

Page 1 of 2

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.