Skip to main content

PyFinitDiff logo

Meta

Python

Documentation Status

Testing

Unittest Status

Unittest coverage

PyPi

PyPi version

PyPi version

Anaconda

Anaconda version

Anaconda downloads

PyFinitDiff is a robust Python package designed to compute finite-difference matrices with an intuitive API. This package provides an efficient and user-friendly interface for generating finite-difference approximations, making it ideal for numerical analysis and scientific computing.

Features

  • Intuitive API: PyFinitDiff offers an easy-to-use interface that allows users to generate finite-difference matrices with minimal effort.

  • Versatile Applications: Suitable for a wide range of numerical methods including solving partial differential equations (PDEs), performing numerical differentiation, and more.

  • Comprehensive Documentation: Detailed documentation and examples to help users get started quickly.

Installation

PyFinitDiff requires Python 3.10+ and is available on PyPi for various operating systems including Linux and macOS.

Install PyFinitDiff via pip:

pip install PyFinitDiff

Documentation

Comprehensive and up-to-date documentation is available online. You can access it here or by clicking the badge below:

Documentation Status

Usage Example

Below is a simple example to illustrate how to use PyFinitDiff:

from PyFinitDiff.finite_difference_1D import FiniteDifference
from PyFinitDiff.finite_difference_1D import Boundaries

boundaries = Boundaries(left='none', right='none')

n_x = 100
fd = FiniteDifference(
   n_x=n_x,
   dx=1,
   derivative=2,
   accuracy=2,
   boundaries=boundaries
)

fd.triplet.plot()

dense_matrix = fd.triplet.to_scipy_sparse()

sparse_matrix = fd.triplet.to_scipy_sparse()

This would produce the following figure:

example_triplet_0

This example demonstrates the creation of a second-order finite-difference matrix with a specified grid spacing and size.

Testing

To test PyFinitDiff locally, clone the GitHub repository and run the tests with coverage:

git clone https://github.com/MartinPdeS/PyFinitDiff.git
cd PyFinitDiff
pip install PyFinitDiff[testing]
pytest

Contributing

As PyFinitDiff is under continuous development, contributions are welcome! If you would like to collaborate or suggest improvements, feel free to fork the repository and submit a pull request. For major changes, please open an issue first to discuss your ideas.

Contact Information

As of 2024, the project is still under development. If you want to collaborate, it would be a pleasure! I encourage you to contact me.

PyFinitDiff was written by Martin Poinsinet de Sivry-Houle .

Email:martin.poinsinet.de.sivry@gmail.ca .

Metadata

Release files for PyFinitDiff 2.3.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for PyFinitDiff 2.3.1
File Size Uploaded
pyfinitdiff-2.3.1.tar.gz 500.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for PyFinitDiff 2.3.1
File Interpreter ABI Platform
pyfinitdiff-2.3.1-py3-none-any.whl Python 3 none any Details

Total release size: 528.3 kB

Release files / pyfinitdiff-2.3.1.tar.gz

Download URL pyfinitdiff-2.3.1.tar.gz
Size 500.4 kB
Tags Source
SHA-256 checksum
How to use checksums
5150b5fa6dd229a5cdcca86195f446843277105a341242db83dac86f24035d6e
BLAKE2b-256 checksum
How to use checksums
638fd3d10da8b3a57665a7031a2044ea4a5d709cd2201f6e80d790c5c1af7c72
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.9.23

Release files / pyfinitdiff-2.3.1-py3-none-any.whl

Download URL pyfinitdiff-2.3.1-py3-none-any.whl
Size 27.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6646cc7cc9d3440934049a6abeaff8c4912740e1414e4569312f6df66662a90b
BLAKE2b-256 checksum
How to use checksums
a25a65dd741a493f1dd2b87d3997269f52acacd163f14cb32b7d39ea4850a369
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.9.23
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page