A Python package for finite difference derivatives in any number of dimensions. Current version 0.13.1, released on PyPI. Provides tools to compute partial derivatives of discrete functions on uniform and non-uniform grids with automatic stencil generation. Supports periodic boundary conditions and symbolic capabilities. Active development with periodic releases.
pip install findiffNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Compute the first derivative of sin(x) on a uniform grid with second-order accuracy.
Update import to `from findiff import FinDiff, Diff`. If using old positional arguments, ensure accuracy is passed correctly. Review migration guide in changelog.
Install scipy: `pip install scipy` before calling to_sparse().
For non-uniform grids, consider using the `Diff` class with explicit grid coordinates. Check the documentation for `FinDiff` on non-uniform grids.
Use `from findiff import FinDiff`.
Change import to `from findiff import FinDiff`.
Ensure the second argument is the list of grid coordinates for each dimension. For 1D, `FinDiff(0, x, 1)` is correct. For higher dimensions, pass a list of arrays, e.g., `FinDiff(0, [x, y], 1)`.
Upgrade findiff to 0.10.0 or later: `pip install --upgrade findiff`.
Use `accuracy` instead of `acc` when initializing FinDiff or Diff. For example: `FinDiff(0, x, 1, accuracy=2)`.