PyFinitDiff 2.3.1__py3-none-any.whl → 2.3.2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- PyFinitDiff/_version.py +3 -32
- PyFinitDiff/coefficients/backward.py +12 -1
- PyFinitDiff/coefficients/central.py +2 -2
- PyFinitDiff/coefficients/forward.py +12 -1
- pyfinitdiff-2.3.2.dist-info/METADATA +213 -0
- {pyfinitdiff-2.3.1.dist-info → pyfinitdiff-2.3.2.dist-info}/RECORD +9 -9
- {pyfinitdiff-2.3.1.dist-info → pyfinitdiff-2.3.2.dist-info}/WHEEL +1 -1
- pyfinitdiff-2.3.1.dist-info/METADATA +0 -208
- {pyfinitdiff-2.3.1.dist-info → pyfinitdiff-2.3.2.dist-info}/licenses/LICENSE +0 -0
- {pyfinitdiff-2.3.1.dist-info → pyfinitdiff-2.3.2.dist-info}/top_level.txt +0 -0
PyFinitDiff/_version.py
CHANGED
|
@@ -1,34 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
# don't change, don't track in version control
|
|
3
|
-
|
|
4
|
-
__all__ = [
|
|
5
|
-
"__version__",
|
|
6
|
-
"__version_tuple__",
|
|
7
|
-
"version",
|
|
8
|
-
"version_tuple",
|
|
9
|
-
"__commit_id__",
|
|
10
|
-
"commit_id",
|
|
11
|
-
]
|
|
12
|
-
|
|
13
|
-
TYPE_CHECKING = False
|
|
14
|
-
if TYPE_CHECKING:
|
|
15
|
-
from typing import Tuple
|
|
16
|
-
from typing import Union
|
|
17
|
-
|
|
18
|
-
VERSION_TUPLE = Tuple[Union[int, str], ...]
|
|
19
|
-
COMMIT_ID = Union[str, None]
|
|
20
|
-
else:
|
|
21
|
-
VERSION_TUPLE = object
|
|
22
|
-
COMMIT_ID = object
|
|
23
|
-
|
|
24
|
-
version: str
|
|
25
|
-
__version__: str
|
|
26
|
-
__version_tuple__: VERSION_TUPLE
|
|
27
|
-
version_tuple: VERSION_TUPLE
|
|
28
|
-
commit_id: COMMIT_ID
|
|
29
|
-
__commit_id__: COMMIT_ID
|
|
30
|
-
|
|
31
|
-
__version__ = version = '2.3.1'
|
|
32
|
-
__version_tuple__ = version_tuple = (2, 3, 1)
|
|
1
|
+
"""Release version maintained by martinpdes-maintenance."""
|
|
33
2
|
|
|
3
|
+
__version__ = version = "2.3.2"
|
|
4
|
+
__version_tuple__ = version_tuple = tuple(int(part) for part in version.split("."))
|
|
34
5
|
__commit_id__ = commit_id = None
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
__accuracy_list__ = [2, 4, 6]
|
|
2
|
+
__accuracy_list__ = [2, 4, 6, 8]
|
|
3
3
|
__derivative_list__ = [1, 2, 3]
|
|
4
4
|
|
|
5
5
|
coefficients = {
|
|
@@ -24,6 +24,17 @@ coefficients = {
|
|
|
24
24
|
(-4, +15.0 / 4.0),
|
|
25
25
|
(-5, -6.0 / 5.0),
|
|
26
26
|
(-6, +1.0 / 6.0)
|
|
27
|
+
),
|
|
28
|
+
'a8': (
|
|
29
|
+
(+0, +761.0 / 280.0),
|
|
30
|
+
(-1, -8.0),
|
|
31
|
+
(-2, +14.0),
|
|
32
|
+
(-3, -56.0 / 3.0),
|
|
33
|
+
(-4, +35.0 / 2.0),
|
|
34
|
+
(-5, -56.0 / 5.0),
|
|
35
|
+
(-6, +14.0 / 3.0),
|
|
36
|
+
(-7, -8.0 / 7.0),
|
|
37
|
+
(-8, +1.0 / 8.0),
|
|
27
38
|
)
|
|
28
39
|
},
|
|
29
40
|
'd2': {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
__accuracy_list__ = [2, 4, 6]
|
|
1
|
+
__accuracy_list__ = [2, 4, 6, 8]
|
|
2
2
|
__derivative_list__ = [1, 2, 3]
|
|
3
3
|
|
|
4
4
|
|
|
@@ -25,6 +25,17 @@ coefficients = {
|
|
|
25
25
|
(+4, -15.0 / 4.0),
|
|
26
26
|
(+5, +6.0 / 5.0),
|
|
27
27
|
(+6, -1.0 / 6.0)
|
|
28
|
+
),
|
|
29
|
+
'a8': (
|
|
30
|
+
(+0, -761.0 / 280.0),
|
|
31
|
+
(+1, +8.0),
|
|
32
|
+
(+2, -14.0),
|
|
33
|
+
(+3, +56.0 / 3.0),
|
|
34
|
+
(+4, -35.0 / 2.0),
|
|
35
|
+
(+5, +56.0 / 5.0),
|
|
36
|
+
(+6, -14.0 / 3.0),
|
|
37
|
+
(+7, +8.0 / 7.0),
|
|
38
|
+
(+8, -1.0 / 8.0),
|
|
28
39
|
)
|
|
29
40
|
},
|
|
30
41
|
'd2': {
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: PyFinitDiff
|
|
3
|
+
Version: 2.3.2
|
|
4
|
+
Summary: A package for generating finite-difference matrices, particularly suited for physics and engineering applications.
|
|
5
|
+
Author-email: Martin Poinsinet de Sivry-Houle <martin.poinsinet.de.sivry@gmail.com>
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/MartinPdeS/PyFinitDiff
|
|
8
|
+
Project-URL: Documentation, https://martinpdes.github.io/PyFinitDiff/
|
|
9
|
+
Project-URL: Repository, https://github.com/MartinPdeS/PyFinitDiff.git
|
|
10
|
+
Keywords: finite-difference,solving,linear algebra,physics,matrix,engineering
|
|
11
|
+
Classifier: Programming Language :: Python
|
|
12
|
+
Classifier: Programming Language :: Python :: 3
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
15
|
+
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
16
|
+
Classifier: Development Status :: 4 - Beta
|
|
17
|
+
Classifier: Topic :: Scientific/Engineering :: Physics
|
|
18
|
+
Classifier: Intended Audience :: Science/Research
|
|
19
|
+
Requires-Python: >=3.10
|
|
20
|
+
Description-Content-Type: text/x-rst
|
|
21
|
+
License-File: LICENSE
|
|
22
|
+
Requires-Dist: scipy>=1.14
|
|
23
|
+
Requires-Dist: pydantic<3,>=2
|
|
24
|
+
Requires-Dist: numpy
|
|
25
|
+
Requires-Dist: MPSPlots
|
|
26
|
+
Requires-Dist: tabulate
|
|
27
|
+
Provides-Extra: release
|
|
28
|
+
Requires-Dist: martinpdes-maintenance==0.2.3; extra == "release"
|
|
29
|
+
Provides-Extra: dev
|
|
30
|
+
Requires-Dist: martinpdes-maintenance[quality]==0.2.3; extra == "dev"
|
|
31
|
+
Requires-Dist: twine<7,>=6; extra == "dev"
|
|
32
|
+
Requires-Dist: flake8==7.3.0; extra == "dev"
|
|
33
|
+
Provides-Extra: testing
|
|
34
|
+
Requires-Dist: martinpdes-maintenance[testing]==0.2.3; extra == "testing"
|
|
35
|
+
Requires-Dist: pytest<9,>=7.4; extra == "testing"
|
|
36
|
+
Requires-Dist: pytest-cov<8; extra == "testing"
|
|
37
|
+
Requires-Dist: pytest-json-report~=1.5; extra == "testing"
|
|
38
|
+
Requires-Dist: coverage~=7.6; extra == "testing"
|
|
39
|
+
Provides-Extra: documentation
|
|
40
|
+
Requires-Dist: MartinPdeS-docs<0.5,>=0.4.0; extra == "documentation"
|
|
41
|
+
Dynamic: license-file
|
|
42
|
+
|
|
43
|
+
PyFinitDiff
|
|
44
|
+
===========
|
|
45
|
+
|
|
46
|
+
.. image:: https://raw.githubusercontent.com/MartinPdeS/PyFinitDiff/HEAD/docs/images/logo.png
|
|
47
|
+
:alt: PyFinitDiff logo
|
|
48
|
+
:width: 100%
|
|
49
|
+
|
|
50
|
+
.. list-table::
|
|
51
|
+
:width: 100%
|
|
52
|
+
:widths: 35 65
|
|
53
|
+
:header-rows: 1
|
|
54
|
+
|
|
55
|
+
* - Badge
|
|
56
|
+
- Status
|
|
57
|
+
* - Python versions
|
|
58
|
+
- |mps-python|
|
|
59
|
+
* - Documentation
|
|
60
|
+
- |mps-docs|
|
|
61
|
+
* - Tests
|
|
62
|
+
- |mps-ci| |mps-coverage|
|
|
63
|
+
* - PyPI
|
|
64
|
+
- |mps-pypi| |mps-downloads|
|
|
65
|
+
* - Conda
|
|
66
|
+
- |mps-conda| |mps-conda-downloads| |mps-conda-release|
|
|
67
|
+
|
|
68
|
+
A package for generating finite-difference matrices, particularly suited for physics and engineering applications.
|
|
69
|
+
|
|
70
|
+
Construct sparse derivative operators from the mesh spacing, derivative order,
|
|
71
|
+
accuracy, and boundary conditions. Inspect the matrix entries before combining the
|
|
72
|
+
operator with a potential or solving an eigenvalue problem.
|
|
73
|
+
|
|
74
|
+
Installation
|
|
75
|
+
------------
|
|
76
|
+
|
|
77
|
+
Requires Python ``>=3.10``.
|
|
78
|
+
|
|
79
|
+
.. code-block:: console
|
|
80
|
+
|
|
81
|
+
$ python -m pip install PyFinitDiff
|
|
82
|
+
|
|
83
|
+
Install from the ``martinpdes`` Conda channel:
|
|
84
|
+
|
|
85
|
+
.. code-block:: console
|
|
86
|
+
|
|
87
|
+
$ conda install -c martinpdes pyfinitdiff
|
|
88
|
+
|
|
89
|
+
For an editable source installation:
|
|
90
|
+
|
|
91
|
+
.. code-block:: console
|
|
92
|
+
|
|
93
|
+
$ git clone https://github.com/MartinPdeS/PyFinitDiff.git
|
|
94
|
+
$ cd PyFinitDiff
|
|
95
|
+
$ python -m pip install -e .
|
|
96
|
+
|
|
97
|
+
Inspect a two-dimensional finite-difference stencil
|
|
98
|
+
---------------------------------------------------
|
|
99
|
+
|
|
100
|
+
.. code-block:: python
|
|
101
|
+
|
|
102
|
+
"""
|
|
103
|
+
Example: triplets 0
|
|
104
|
+
===================
|
|
105
|
+
|
|
106
|
+
In this example, we generate a finite difference instance and visualize the resulting triplets.
|
|
107
|
+
The boundary conditions, derivative, and accuracy settings are specified for demonstration purposes.
|
|
108
|
+
"""
|
|
109
|
+
|
|
110
|
+
# %%
|
|
111
|
+
# .. list-table:: Finite-difference parameters
|
|
112
|
+
# :widths: 25
|
|
113
|
+
# :header-rows: 1
|
|
114
|
+
#
|
|
115
|
+
# * - boundaries: {left: 0, right: 0, top: 0, bottom: 0}
|
|
116
|
+
# * - derivative: 2
|
|
117
|
+
# * - accuracy: 4
|
|
118
|
+
|
|
119
|
+
# %%
|
|
120
|
+
# Importing required packages
|
|
121
|
+
# ---------------------------
|
|
122
|
+
# Here we import the necessary libraries for numerical computations and finite difference operations.
|
|
123
|
+
|
|
124
|
+
from PyFinitDiff.finite_difference_2D import FiniteDifference, Boundaries
|
|
125
|
+
import matplotlib.pyplot as plt
|
|
126
|
+
|
|
127
|
+
# %%
|
|
128
|
+
# Setting up the finite difference instance and boundaries
|
|
129
|
+
# ---------------------------------------------------------
|
|
130
|
+
# We define the grid size and set up the finite difference instance with specified boundary conditions.
|
|
131
|
+
|
|
132
|
+
sparse_instance = FiniteDifference(
|
|
133
|
+
n_x=20,
|
|
134
|
+
n_y=20,
|
|
135
|
+
dx=1,
|
|
136
|
+
dy=1,
|
|
137
|
+
derivative=2,
|
|
138
|
+
accuracy=2,
|
|
139
|
+
boundaries=Boundaries()
|
|
140
|
+
)
|
|
141
|
+
|
|
142
|
+
# %%
|
|
143
|
+
# Visualizing the triplets with matplotlib
|
|
144
|
+
# -----------------------------------------
|
|
145
|
+
# We plot the triplets using matplotlib to visualize the finite difference operator.
|
|
146
|
+
|
|
147
|
+
sparse_instance.triplet.plot()
|
|
148
|
+
|
|
149
|
+
plt.show()
|
|
150
|
+
|
|
151
|
+
# -
|
|
152
|
+
|
|
153
|
+
.. figure:: https://raw.githubusercontent.com/MartinPdeS/PyFinitDiff/HEAD/docs/images/triplet_example_0.png
|
|
154
|
+
|
|
155
|
+
Triplet representation of the finite-difference operator.
|
|
156
|
+
|
|
157
|
+
Documentation
|
|
158
|
+
-------------
|
|
159
|
+
|
|
160
|
+
Use the `PyFinitDiff documentation <https://martinpdes.github.io/PyFinitDiff/>`__ to work through
|
|
161
|
+
examples and look up the inputs and return values of individual functions.
|
|
162
|
+
|
|
163
|
+
Contributing
|
|
164
|
+
------------
|
|
165
|
+
|
|
166
|
+
Bug reports, worked examples, and documentation corrections are welcome.
|
|
167
|
+
To set up a development checkout and run the tests, follow the `contributing guide <https://github.com/MartinPdeS/PyFinitDiff/blob/HEAD/CONTRIBUTING.md>`__.
|
|
168
|
+
|
|
169
|
+
Contact
|
|
170
|
+
-------
|
|
171
|
+
|
|
172
|
+
For questions, contact `Martin Poinsinet de Sivry-Houle <mailto:martin.poinsinet.de.sivry@gmail.com?subject=PyFinitDiff>`__.
|
|
173
|
+
|
|
174
|
+
License
|
|
175
|
+
-------
|
|
176
|
+
|
|
177
|
+
PyFinitDiff is licensed under `MIT <https://github.com/MartinPdeS/PyFinitDiff/blob/HEAD/LICENSE>`__.
|
|
178
|
+
|
|
179
|
+
.. |mps-python| image:: https://img.shields.io/pypi/pyversions/pyfinitdiff.svg
|
|
180
|
+
:alt: Supported Python versions
|
|
181
|
+
:target: https://pypi.org/project/pyfinitdiff/
|
|
182
|
+
|
|
183
|
+
.. |mps-pypi| image:: https://img.shields.io/pypi/v/pyfinitdiff.svg
|
|
184
|
+
:alt: PyPI version
|
|
185
|
+
:target: https://pypi.org/project/pyfinitdiff/
|
|
186
|
+
|
|
187
|
+
.. |mps-downloads| image:: https://img.shields.io/pypi/dm/pyfinitdiff.svg
|
|
188
|
+
:alt: Monthly PyPI downloads
|
|
189
|
+
:target: https://pypistats.org/packages/pyfinitdiff
|
|
190
|
+
|
|
191
|
+
.. |mps-docs| image:: https://github.com/MartinPdeS/PyFinitDiff/actions/workflows/deploy_documentation.yml/badge.svg
|
|
192
|
+
:alt: Documentation
|
|
193
|
+
:target: https://martinpdes.github.io/PyFinitDiff/
|
|
194
|
+
|
|
195
|
+
.. |mps-ci| image:: https://github.com/MartinPdeS/PyFinitDiff/actions/workflows/tests.yml/badge.svg
|
|
196
|
+
:alt: Tests
|
|
197
|
+
:target: https://github.com/MartinPdeS/PyFinitDiff/actions/workflows/tests.yml
|
|
198
|
+
|
|
199
|
+
.. |mps-coverage| image:: https://raw.githubusercontent.com/MartinPdeS/PyFinitDiff/python-coverage-comment-action-data/badge.svg
|
|
200
|
+
:alt: Test coverage
|
|
201
|
+
:target: https://htmlpreview.github.io/?https://github.com/MartinPdeS/PyFinitDiff/blob/python-coverage-comment-action-data/htmlcov/index.html
|
|
202
|
+
|
|
203
|
+
.. |mps-conda| image:: https://anaconda.org/martinpdes/pyfinitdiff/badges/version.svg
|
|
204
|
+
:alt: Anaconda version
|
|
205
|
+
:target: https://anaconda.org/martinpdes/pyfinitdiff
|
|
206
|
+
|
|
207
|
+
.. |mps-conda-downloads| image:: https://anaconda.org/martinpdes/pyfinitdiff/badges/downloads.svg
|
|
208
|
+
:alt: Anaconda downloads
|
|
209
|
+
:target: https://anaconda.org/martinpdes/pyfinitdiff
|
|
210
|
+
|
|
211
|
+
.. |mps-conda-release| image:: https://anaconda.org/martinpdes/pyfinitdiff/badges/latest_release_relative_date.svg
|
|
212
|
+
:alt: Latest Anaconda release
|
|
213
|
+
:target: https://anaconda.org/martinpdes/pyfinitdiff
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
PyFinitDiff/__init__.py,sha256=2W6LdHIO-28A_9Y5iNndtZ0Dd53aMF4VR1041JgLQXQ,175
|
|
2
|
-
PyFinitDiff/_version.py,sha256=
|
|
2
|
+
PyFinitDiff/_version.py,sha256=L54-o7iHwiAwuKG2vfgTDJT34yYJMgeJTEuCubgjjS4,210
|
|
3
3
|
PyFinitDiff/boundary_values.py,sha256=SPqckrx85N7aDoM8G9xfp01-f7zUQ3iRN-3fMXL5YWI,907
|
|
4
4
|
PyFinitDiff/diagonal.py,sha256=mHPEniSMiRppjGjIgolkmxVCylD4MWphyTgxroB3ISI,10296
|
|
5
5
|
PyFinitDiff/directories.py,sha256=CjG37eY-Z68Czo5L7MzHJpu8KEJNhZPnh5VB5MTQ2Tg,837
|
|
6
6
|
PyFinitDiff/triplet.py,sha256=rlNFtfXea3sQGSACAGenV_J7HiIFV3_utlPEfOxiA1E,13878
|
|
7
7
|
PyFinitDiff/coefficients/__init__.py,sha256=D6leOHW6065G9S6rdcQLmTc99bhWJ9OldfR8lWYQJIU,4179
|
|
8
|
-
PyFinitDiff/coefficients/backward.py,sha256=
|
|
9
|
-
PyFinitDiff/coefficients/central.py,sha256=
|
|
10
|
-
PyFinitDiff/coefficients/forward.py,sha256=
|
|
8
|
+
PyFinitDiff/coefficients/backward.py,sha256=4PQ1Yb3TOey7PnEhQs1nBRnpJo_aqhAKGeeSDWRZbCo,2274
|
|
9
|
+
PyFinitDiff/coefficients/central.py,sha256=xrnZeK2CfgaAcuhAfofBo6WiBNQZKGJ-61vBXLaQ82s,2377
|
|
10
|
+
PyFinitDiff/coefficients/forward.py,sha256=2mhE40Ywerl3wDCm_ygJ3m2Wh8ALZG3p-y2myvN20h0,2270
|
|
11
11
|
PyFinitDiff/finite_difference_1D/__init__.py,sha256=VIxWZB2VhtmtnU-Qz-VDGLIz1V1ufqXHyUxlIAYKgW4,237
|
|
12
12
|
PyFinitDiff/finite_difference_1D/boundaries.py,sha256=yA5RsLDQA0DJQq1a9Ks4ujlKU9f5fpXOH6pxTEfF8E4,6093
|
|
13
13
|
PyFinitDiff/finite_difference_1D/derivative.py,sha256=DjJD_b9GBJdjaIyeET2WgcPT18CeCJ9rnxq3igVX5LY,1698
|
|
@@ -18,8 +18,8 @@ PyFinitDiff/finite_difference_2D/boundaries.py,sha256=3UKMpxDnmeNP8x7f3dVkSwpleJ
|
|
|
18
18
|
PyFinitDiff/finite_difference_2D/derivative.py,sha256=5BvZl7gImgGHMxAkAdNrtofGrv9m9e2BIYR4Uuz08HI,2013
|
|
19
19
|
PyFinitDiff/finite_difference_2D/finite_difference.py,sha256=bVzpGZGXDnmBERT6laWa_1wOok7JrBQ71N-1htKJGxU,8381
|
|
20
20
|
PyFinitDiff/finite_difference_2D/utils.py,sha256=299k0sFfGRw5l0f8nFQef9x5J1zFMoD-IaifdX6LLhs,2454
|
|
21
|
-
pyfinitdiff-2.3.
|
|
22
|
-
pyfinitdiff-2.3.
|
|
23
|
-
pyfinitdiff-2.3.
|
|
24
|
-
pyfinitdiff-2.3.
|
|
25
|
-
pyfinitdiff-2.3.
|
|
21
|
+
pyfinitdiff-2.3.2.dist-info/licenses/LICENSE,sha256=U6YG4UEW9XJzHa53oijR0qw6JNN_SZ38WOBmYn3NPd0,1072
|
|
22
|
+
pyfinitdiff-2.3.2.dist-info/METADATA,sha256=lhsv1M8Fb9Q_v8yIfFIILJAdui0iKMLFbfSoEdMXPtw,7326
|
|
23
|
+
pyfinitdiff-2.3.2.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
|
|
24
|
+
pyfinitdiff-2.3.2.dist-info/top_level.txt,sha256=yl_A1Z9VT4HxBK5PTOM4ZyRcXZb-VtbQo1TzRUc1mW4,12
|
|
25
|
+
pyfinitdiff-2.3.2.dist-info/RECORD,,
|
|
@@ -1,208 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: PyFinitDiff
|
|
3
|
-
Version: 2.3.1
|
|
4
|
-
Summary: A package for generating finite-difference matrices, particularly suited for physics and engineering applications.
|
|
5
|
-
Author-email: Martin Poinsinet de Sivry-Houle <martin.poinsinet.de.sivry@gmail.com>
|
|
6
|
-
License: MIT License
|
|
7
|
-
|
|
8
|
-
Copyright (c) 2020 Martin de Sivry
|
|
9
|
-
|
|
10
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
11
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
12
|
-
in the Software without restriction, including without limitation the rights
|
|
13
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
14
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
15
|
-
furnished to do so, subject to the following conditions:
|
|
16
|
-
|
|
17
|
-
The above copyright notice and this permission notice shall be included in all
|
|
18
|
-
copies or substantial portions of the Software.
|
|
19
|
-
|
|
20
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
21
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
22
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
23
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
24
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
25
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
26
|
-
SOFTWARE.
|
|
27
|
-
|
|
28
|
-
Project-URL: Homepage, https://github.com/MartinPdeS/PyFinitDiff
|
|
29
|
-
Project-URL: Documentation, https://martinpdes.github.io/PyFinitDiff/
|
|
30
|
-
Project-URL: Repository, https://github.com/MartinPdeS/PyFinitDiff.git
|
|
31
|
-
Keywords: finite-difference,solving,linear algebra,physics,matrix,engineering
|
|
32
|
-
Classifier: Programming Language :: Python
|
|
33
|
-
Classifier: Programming Language :: Python :: 3
|
|
34
|
-
Classifier: Programming Language :: Python :: 3.11
|
|
35
|
-
Classifier: Programming Language :: Python :: 3.12
|
|
36
|
-
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
37
|
-
Classifier: Development Status :: 4 - Beta
|
|
38
|
-
Classifier: Topic :: Scientific/Engineering :: Physics
|
|
39
|
-
Classifier: License :: OSI Approved :: MIT License
|
|
40
|
-
Classifier: Intended Audience :: Science/Research
|
|
41
|
-
Requires-Python: >=3.10
|
|
42
|
-
Description-Content-Type: text/x-rst
|
|
43
|
-
License-File: LICENSE
|
|
44
|
-
Requires-Dist: scipy>=1.14
|
|
45
|
-
Requires-Dist: pydantic
|
|
46
|
-
Requires-Dist: numpy
|
|
47
|
-
Requires-Dist: MPSPlots
|
|
48
|
-
Requires-Dist: tabulate
|
|
49
|
-
Provides-Extra: testing
|
|
50
|
-
Requires-Dist: pytest<9.0,>=7.4; extra == "testing"
|
|
51
|
-
Requires-Dist: pytest-cov<7,>=2; extra == "testing"
|
|
52
|
-
Requires-Dist: pytest-json-report~=1.5; extra == "testing"
|
|
53
|
-
Requires-Dist: coverage~=7.6; extra == "testing"
|
|
54
|
-
Provides-Extra: documentation
|
|
55
|
-
Requires-Dist: numpydoc~=1.8; extra == "documentation"
|
|
56
|
-
Requires-Dist: sphinx>=6; extra == "documentation"
|
|
57
|
-
Requires-Dist: sphinx-gallery~=0.17; extra == "documentation"
|
|
58
|
-
Requires-Dist: sphinx-rtd-theme~=3.0; extra == "documentation"
|
|
59
|
-
Requires-Dist: pydata-sphinx-theme~=0.15; extra == "documentation"
|
|
60
|
-
Provides-Extra: dev
|
|
61
|
-
Requires-Dist: flake8==7.2.0; extra == "dev"
|
|
62
|
-
Dynamic: license-file
|
|
63
|
-
|
|
64
|
-
PyFinitDiff
|
|
65
|
-
===========
|
|
66
|
-
|
|
67
|
-
|logo|
|
|
68
|
-
|
|
69
|
-
.. list-table::
|
|
70
|
-
:widths: 10 25 25
|
|
71
|
-
:header-rows: 0
|
|
72
|
-
|
|
73
|
-
* - Meta
|
|
74
|
-
- |python|
|
|
75
|
-
- |docs|
|
|
76
|
-
* - Testing
|
|
77
|
-
- |ci/cd|
|
|
78
|
-
- |coverage|
|
|
79
|
-
* - PyPi
|
|
80
|
-
- |PyPi|
|
|
81
|
-
- |PyPi_download|
|
|
82
|
-
* - Anaconda
|
|
83
|
-
- |anaconda|
|
|
84
|
-
- |anaconda_download|
|
|
85
|
-
|
|
86
|
-
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.
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
Features
|
|
90
|
-
********
|
|
91
|
-
- **Intuitive API**: PyFinitDiff offers an easy-to-use interface that allows users to generate finite-difference matrices with minimal effort.
|
|
92
|
-
- **Versatile Applications**: Suitable for a wide range of numerical methods including solving partial differential equations (PDEs), performing numerical differentiation, and more.
|
|
93
|
-
- **Comprehensive Documentation**: Detailed documentation and examples to help users get started quickly.
|
|
94
|
-
|
|
95
|
-
Installation
|
|
96
|
-
------------
|
|
97
|
-
|
|
98
|
-
PyFinitDiff requires Python 3.10+ and is available on PyPi for various operating systems including Linux and macOS.
|
|
99
|
-
|
|
100
|
-
Install PyFinitDiff via pip:
|
|
101
|
-
|
|
102
|
-
.. code-block:: bash
|
|
103
|
-
|
|
104
|
-
pip install PyFinitDiff
|
|
105
|
-
|
|
106
|
-
Documentation
|
|
107
|
-
*************
|
|
108
|
-
Comprehensive and up-to-date documentation is available online. You can access it `here <https://pyfinitdiff.readthedocs.io/en/latest/>`_ or by clicking the badge below:
|
|
109
|
-
|
|
110
|
-
|docs|
|
|
111
|
-
|
|
112
|
-
Usage Example
|
|
113
|
-
*************
|
|
114
|
-
|
|
115
|
-
Below is a simple example to illustrate how to use PyFinitDiff:
|
|
116
|
-
|
|
117
|
-
.. code-block:: python
|
|
118
|
-
|
|
119
|
-
from PyFinitDiff.finite_difference_1D import FiniteDifference
|
|
120
|
-
from PyFinitDiff.finite_difference_1D import Boundaries
|
|
121
|
-
|
|
122
|
-
boundaries = Boundaries(left='none', right='none')
|
|
123
|
-
|
|
124
|
-
n_x = 100
|
|
125
|
-
fd = FiniteDifference(
|
|
126
|
-
n_x=n_x,
|
|
127
|
-
dx=1,
|
|
128
|
-
derivative=2,
|
|
129
|
-
accuracy=2,
|
|
130
|
-
boundaries=boundaries
|
|
131
|
-
)
|
|
132
|
-
|
|
133
|
-
fd.triplet.plot()
|
|
134
|
-
|
|
135
|
-
dense_matrix = fd.triplet.to_scipy_sparse()
|
|
136
|
-
|
|
137
|
-
sparse_matrix = fd.triplet.to_scipy_sparse()
|
|
138
|
-
|
|
139
|
-
This would produce the following figure:
|
|
140
|
-
|
|
141
|
-
|example_triplet_0|
|
|
142
|
-
|
|
143
|
-
This example demonstrates the creation of a second-order finite-difference matrix with a specified grid spacing and size.
|
|
144
|
-
|
|
145
|
-
Testing
|
|
146
|
-
*******
|
|
147
|
-
|
|
148
|
-
To test PyFinitDiff locally, clone the GitHub repository and run the tests with coverage:
|
|
149
|
-
|
|
150
|
-
.. code-block:: bash
|
|
151
|
-
|
|
152
|
-
git clone https://github.com/MartinPdeS/PyFinitDiff.git
|
|
153
|
-
cd PyFinitDiff
|
|
154
|
-
pip install PyFinitDiff[testing]
|
|
155
|
-
pytest
|
|
156
|
-
|
|
157
|
-
Contributing
|
|
158
|
-
************
|
|
159
|
-
|
|
160
|
-
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.
|
|
161
|
-
|
|
162
|
-
Contact Information
|
|
163
|
-
********************
|
|
164
|
-
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.
|
|
165
|
-
|
|
166
|
-
PyFinitDiff was written by `Martin Poinsinet de Sivry-Houle <https://github.com/MartinPdS>`_ .
|
|
167
|
-
|
|
168
|
-
Email:`martin.poinsinet.de.sivry@gmail.ca <mailto:martin.poinsinet.de.sivry@gmail.ca?subject=PyFinitDiff>`_ .
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
.. |python| image:: https://img.shields.io/pypi/pyversions/pyfinitdiff.svg
|
|
172
|
-
:alt: Python
|
|
173
|
-
:target: https://www.python.org/
|
|
174
|
-
|
|
175
|
-
.. |logo| image:: https://github.com/MartinPdeS/PyFinitDiff/raw/master/docs/images/logo.png
|
|
176
|
-
:alt: PyFinitDiff logo
|
|
177
|
-
|
|
178
|
-
.. |docs| image:: https://github.com/martinpdes/pyfinitdiff/actions/workflows/deploy_documentation.yml/badge.svg
|
|
179
|
-
:target: https://martinpdes.github.io/PyFinitDiff/
|
|
180
|
-
:alt: Documentation Status
|
|
181
|
-
|
|
182
|
-
.. |coverage| image:: https://raw.githubusercontent.com/MartinPdeS/PyFinitDiff/python-coverage-comment-action-data/badge.svg
|
|
183
|
-
:alt: Unittest coverage
|
|
184
|
-
:target: https://htmlpreview.github.io/?https://github.com/MartinPdeS/PyFinitDiff/blob/python-coverage-comment-action-data/htmlcov/index.html
|
|
185
|
-
|
|
186
|
-
.. |PyPi| image:: https://badge.fury.io/py/PyFinitDiff.svg
|
|
187
|
-
:alt: PyPi version
|
|
188
|
-
:target: https://pypi.org/project/PyFinitDiff/
|
|
189
|
-
|
|
190
|
-
.. |PyPi_download| image:: https://img.shields.io/pypi/dm/pyfinitdiff.svg
|
|
191
|
-
:alt: PyPi version
|
|
192
|
-
:target: https://pypistats.org/packages/pyfinitdiff
|
|
193
|
-
|
|
194
|
-
.. |ci/cd| image:: https://github.com/martinpdes/pyfinitdiff/actions/workflows/deploy_coverage.yml/badge.svg
|
|
195
|
-
:target: https://martinpdes.github.io/PyFinitDiff/actions
|
|
196
|
-
:alt: Unittest Status
|
|
197
|
-
|
|
198
|
-
.. |example_triplet_0| image:: https://github.com/MartinPdeS/PyFinitDiff/blob/master/docs/images/triplet_example_0.png
|
|
199
|
-
:target: https://www.python.org/
|
|
200
|
-
|
|
201
|
-
.. |anaconda_download| image:: https://anaconda.org/martinpdes/pyfinitdiff/badges/downloads.svg
|
|
202
|
-
:alt: Anaconda downloads
|
|
203
|
-
:target: https://anaconda.org/martinpdes/pyfinitdiff
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
.. |anaconda| image:: https://anaconda.org/martinpdes/pyfinitdiff/badges/version.svg
|
|
207
|
-
:alt: Anaconda version
|
|
208
|
-
:target: https://anaconda.org/martinpdes/pyfinitdiff
|
|
File without changes
|
|
File without changes
|