PyFinitDiff 1.3.0__py3-none-any.whl → 2.0.0.post0__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/__init__.py +8 -0
- PyFinitDiff/_version.py +16 -0
- {PyFinitDiff-1.3.0.dist-info → PyFinitDiff-2.0.0.post0.dist-info}/METADATA +44 -23
- PyFinitDiff-2.0.0.post0.dist-info/RECORD +28 -0
- {PyFinitDiff-1.3.0.dist-info → PyFinitDiff-2.0.0.post0.dist-info}/WHEEL +1 -1
- {PyFinitDiff-1.3.0.dist-info → PyFinitDiff-2.0.0.post0.dist-info}/top_level.txt +0 -1
- PyFinitDiff/VERSION +0 -1
- PyFinitDiff/__pycache__/__init__.cpython-311.pyc +0 -0
- PyFinitDiff/__pycache__/triplet.cpython-311.pyc +0 -0
- PyFinitDiff/__pycache__/utils.cpython-311.pyc +0 -0
- PyFinitDiff/coefficients/__pycache__/__init__.cpython-311.pyc +0 -0
- PyFinitDiff/coefficients/__pycache__/backward.cpython-311.pyc +0 -0
- PyFinitDiff/coefficients/__pycache__/central.cpython-311.pyc +0 -0
- PyFinitDiff/coefficients/__pycache__/forward.cpython-311.pyc +0 -0
- PyFinitDiff/finite_difference_1D/__pycache__/__init__.cpython-311.pyc +0 -0
- PyFinitDiff/finite_difference_1D/__pycache__/boundaries.cpython-311.pyc +0 -0
- PyFinitDiff/finite_difference_1D/__pycache__/derivative.cpython-311.pyc +0 -0
- PyFinitDiff/finite_difference_1D/__pycache__/diagonals.cpython-311.pyc +0 -0
- PyFinitDiff/finite_difference_1D/__pycache__/finite_difference.cpython-311.pyc +0 -0
- PyFinitDiff/finite_difference_1D/__pycache__/utils.cpython-311.pyc +0 -0
- PyFinitDiff/finite_difference_2D/__pycache__/__init__.cpython-311.pyc +0 -0
- PyFinitDiff/finite_difference_2D/__pycache__/boundaries.cpython-311.pyc +0 -0
- PyFinitDiff/finite_difference_2D/__pycache__/derivative.cpython-311.pyc +0 -0
- PyFinitDiff/finite_difference_2D/__pycache__/diagonals.cpython-311.pyc +0 -0
- PyFinitDiff/finite_difference_2D/__pycache__/finite_difference.cpython-311.pyc +0 -0
- PyFinitDiff/finite_difference_2D/__pycache__/utils.cpython-311.pyc +0 -0
- PyFinitDiff-1.3.0.dist-info/RECORD +0 -61
- tests/1D/__init__.py +0 -0
- tests/1D/__pycache__/__init__.cpython-311.pyc +0 -0
- tests/1D/__pycache__/test_api.cpython-311-pytest-8.2.2.pyc +0 -0
- tests/1D/__pycache__/test_derivative.cpython-311-pytest-8.2.2.pyc +0 -0
- tests/1D/test_api.py +0 -36
- tests/1D/test_derivative.py +0 -60
- tests/2D/__init__.py +0 -0
- tests/2D/__pycache__/__init__.cpython-311.pyc +0 -0
- tests/2D/__pycache__/test_api.cpython-311-pytest-8.2.2.pyc +0 -0
- tests/2D/__pycache__/test_derivative.cpython-311-pytest-8.2.2.pyc +0 -0
- tests/2D/__pycache__/test_eigen.cpython-311-pytest-8.2.2.pyc +0 -0
- tests/2D/test_api.py +0 -44
- tests/2D/test_derivative.py +0 -76
- tests/2D/test_eigen.py +0 -58
- {PyFinitDiff-1.3.0.dist-info → PyFinitDiff-2.0.0.post0.dist-info}/LICENSE +0 -0
PyFinitDiff/__init__.py
CHANGED
PyFinitDiff/_version.py
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# file generated by setuptools_scm
|
|
2
|
+
# don't change, don't track in version control
|
|
3
|
+
TYPE_CHECKING = False
|
|
4
|
+
if TYPE_CHECKING:
|
|
5
|
+
from typing import Tuple, Union
|
|
6
|
+
VERSION_TUPLE = Tuple[Union[int, str], ...]
|
|
7
|
+
else:
|
|
8
|
+
VERSION_TUPLE = object
|
|
9
|
+
|
|
10
|
+
version: str
|
|
11
|
+
__version__: str
|
|
12
|
+
__version_tuple__: VERSION_TUPLE
|
|
13
|
+
version_tuple: VERSION_TUPLE
|
|
14
|
+
|
|
15
|
+
__version__ = version = '2.0.0.post0'
|
|
16
|
+
__version_tuple__ = version_tuple = (2, 0, 0)
|
|
@@ -1,44 +1,65 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: PyFinitDiff
|
|
3
|
-
Version:
|
|
3
|
+
Version: 2.0.0.post0
|
|
4
4
|
Summary: A package finit-difference matrix generation.
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
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://pyfinitdiff.readthedocs.io/en/latest/
|
|
30
|
+
Project-URL: Repository, https://github.com/MartinPdeS/PyFinitDiff.git
|
|
31
|
+
Keywords: finit-difference,matrix
|
|
13
32
|
Classifier: Programming Language :: Python
|
|
14
33
|
Classifier: Programming Language :: Python :: 3
|
|
15
34
|
Classifier: Programming Language :: Python :: 3.11
|
|
35
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
16
36
|
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
17
37
|
Classifier: Development Status :: 4 - Beta
|
|
18
38
|
Classifier: Topic :: Scientific/Engineering :: Physics
|
|
19
39
|
Classifier: License :: OSI Approved :: MIT License
|
|
20
40
|
Classifier: Intended Audience :: Science/Research
|
|
41
|
+
Requires-Python: >=3.10
|
|
21
42
|
Description-Content-Type: text/x-rst
|
|
22
43
|
License-File: LICENSE
|
|
23
|
-
Requires-Dist: pydantic
|
|
44
|
+
Requires-Dist: pydantic>=2.6.3
|
|
24
45
|
Requires-Dist: numpy
|
|
25
46
|
Requires-Dist: scipy
|
|
26
|
-
Requires-Dist: MPSPlots
|
|
47
|
+
Requires-Dist: MPSPlots
|
|
27
48
|
Requires-Dist: tabulate
|
|
28
49
|
Provides-Extra: documentation
|
|
29
|
-
Requires-Dist: numpydoc
|
|
30
|
-
Requires-Dist: sphinx
|
|
31
|
-
Requires-Dist: sphinx-gallery
|
|
32
|
-
Requires-Dist: sphinx-rtd-theme
|
|
33
|
-
Requires-Dist: pydata-sphinx-theme
|
|
50
|
+
Requires-Dist: numpydoc==1.6.0; extra == "documentation"
|
|
51
|
+
Requires-Dist: sphinx>=5.1.1; extra == "documentation"
|
|
52
|
+
Requires-Dist: sphinx-gallery==0.15.0; extra == "documentation"
|
|
53
|
+
Requires-Dist: sphinx-rtd-theme==2.0.0; extra == "documentation"
|
|
54
|
+
Requires-Dist: pydata-sphinx-theme==0.14.1; extra == "documentation"
|
|
34
55
|
Provides-Extra: testing
|
|
35
|
-
Requires-Dist: pytest
|
|
36
|
-
Requires-Dist: pytest-cov
|
|
37
|
-
Requires-Dist: pytest-json-report
|
|
38
|
-
Requires-Dist: mypy
|
|
39
|
-
Requires-Dist: flake8
|
|
40
|
-
Requires-Dist: tox
|
|
41
|
-
Requires-Dist: coverage
|
|
56
|
+
Requires-Dist: pytest>=0.6; extra == "testing"
|
|
57
|
+
Requires-Dist: pytest-cov>=2.0; extra == "testing"
|
|
58
|
+
Requires-Dist: pytest-json-report==1.5.0; extra == "testing"
|
|
59
|
+
Requires-Dist: mypy>=0.910; extra == "testing"
|
|
60
|
+
Requires-Dist: flake8>=3.9; extra == "testing"
|
|
61
|
+
Requires-Dist: tox>=3.24; extra == "testing"
|
|
62
|
+
Requires-Dist: coverage==6.5.0; extra == "testing"
|
|
42
63
|
|
|
43
64
|
PyFinitDiff
|
|
44
65
|
===========
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
PyFinitDiff/__init__.py,sha256=aM48cMAdbYIlGfbEhIvsYBykH2h-u4UpT8DL2utijYQ,121
|
|
2
|
+
PyFinitDiff/_version.py,sha256=SNS4RofNHfIk5adzMeBrr3fs3NDC5R9cQ1UbL_LRKYE,417
|
|
3
|
+
PyFinitDiff/triplet.py,sha256=o_pnW-Y_igF29IosZGQX6WJdX0QZtIGDL2Mu-1X1Ihg,12701
|
|
4
|
+
PyFinitDiff/utils.py,sha256=oKaaG1qbAjJe3Kd9rS86LuylEuoYu2oPeKgTjKtdxME,3175
|
|
5
|
+
PyFinitDiff/coefficients/__init__.py,sha256=D6leOHW6065G9S6rdcQLmTc99bhWJ9OldfR8lWYQJIU,4179
|
|
6
|
+
PyFinitDiff/coefficients/backward.py,sha256=cTti5MkcrhvuJVNURLJqnTcMmSQhdPvRPImu6ZSEsfY,1977
|
|
7
|
+
PyFinitDiff/coefficients/central.py,sha256=Xq1W-yXnTFLNugYwHajl8XynHPWdV7jH6ll2fy_NVSI,2377
|
|
8
|
+
PyFinitDiff/coefficients/forward.py,sha256=znCszjYptZpQiINx_VQXFeLTNKhntm3MV1g7CNOW67E,1973
|
|
9
|
+
PyFinitDiff/finite_difference_1D/__init__.py,sha256=VIxWZB2VhtmtnU-Qz-VDGLIz1V1ufqXHyUxlIAYKgW4,237
|
|
10
|
+
PyFinitDiff/finite_difference_1D/boundaries.py,sha256=2HWURIrSMWLUTn4KoSBXYHZdWQEISzw-m6yZxt7CF3w,6159
|
|
11
|
+
PyFinitDiff/finite_difference_1D/derivative.py,sha256=OK6jN426iXHriiesQSy4hsZEN6z1I6osTw7IUK5aqMY,1476
|
|
12
|
+
PyFinitDiff/finite_difference_1D/diagonals.py,sha256=v6C0bPAApLl4qSwFMeoDPKzg8THlObVm9qc7co8QgnM,7082
|
|
13
|
+
PyFinitDiff/finite_difference_1D/finite_difference.py,sha256=q9UpPDxAxN78iBarW1x8W5UEdHTsE6o2BcXddKBIDXM,5871
|
|
14
|
+
PyFinitDiff/finite_difference_1D/utils.py,sha256=wFToOvAEK3A9VqBf_9e4O3cXRdP_igA_iS-67_5JV3Y,1708
|
|
15
|
+
PyFinitDiff/finite_difference_2D/__init__.py,sha256=TIijlPbN-SiZ9UsaO5zVSZrb5ZsKVm0P63TZ_rjEySU,234
|
|
16
|
+
PyFinitDiff/finite_difference_2D/boundaries.py,sha256=jokzZ1VXq680XLCMsgAxS9Aza_DTmlYN-w2O_IRe33c,7312
|
|
17
|
+
PyFinitDiff/finite_difference_2D/dense.py,sha256=hWcncevb1gSk_-LSHr2SIk5LWy1bcCKN8UKCFI2robM,9199
|
|
18
|
+
PyFinitDiff/finite_difference_2D/derivative.py,sha256=MlO2aGFuxuK5yAf8q8dEOlc3dgRdf68lf1HTFh7IRzo,1820
|
|
19
|
+
PyFinitDiff/finite_difference_2D/diagonals.py,sha256=KPcmx8LoNyUuBQIJC330GUNEdP5UP4mrg__Vtpy1ZQU,9581
|
|
20
|
+
PyFinitDiff/finite_difference_2D/finite_difference.py,sha256=QRMwCjp4iF7jqkp3LqwzOQum2qT_VwRpjl7ZZp73aEI,6889
|
|
21
|
+
PyFinitDiff/finite_difference_2D/utils.py,sha256=OZgp9Wk1NuOEwXSf8PvQyHXOe927K37shu-WDjN21CM,2182
|
|
22
|
+
PyFinitDiff/tools/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
23
|
+
PyFinitDiff/tools/directories.py,sha256=CjG37eY-Z68Czo5L7MzHJpu8KEJNhZPnh5VB5MTQ2Tg,837
|
|
24
|
+
PyFinitDiff-2.0.0.post0.dist-info/LICENSE,sha256=U6YG4UEW9XJzHa53oijR0qw6JNN_SZ38WOBmYn3NPd0,1072
|
|
25
|
+
PyFinitDiff-2.0.0.post0.dist-info/METADATA,sha256=7ZiNmmaEeZuumv-MsEcacviQ_yXbO73Pzvi5skYAuOw,5192
|
|
26
|
+
PyFinitDiff-2.0.0.post0.dist-info/WHEEL,sha256=Mdi9PDNwEZptOjTlUcAth7XJDFtKrHYaQMPulZeBCiQ,91
|
|
27
|
+
PyFinitDiff-2.0.0.post0.dist-info/top_level.txt,sha256=yl_A1Z9VT4HxBK5PTOM4ZyRcXZb-VtbQo1TzRUc1mW4,12
|
|
28
|
+
PyFinitDiff-2.0.0.post0.dist-info/RECORD,,
|
PyFinitDiff/VERSION
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
1.3.0
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
PyFinitDiff/VERSION,sha256=ZNI_hY71Gw-Zbklm1OJ8A3G0N-LSeHiQsfetItTsVmM,6
|
|
2
|
-
PyFinitDiff/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
3
|
-
PyFinitDiff/triplet.py,sha256=o_pnW-Y_igF29IosZGQX6WJdX0QZtIGDL2Mu-1X1Ihg,12701
|
|
4
|
-
PyFinitDiff/utils.py,sha256=oKaaG1qbAjJe3Kd9rS86LuylEuoYu2oPeKgTjKtdxME,3175
|
|
5
|
-
PyFinitDiff/__pycache__/__init__.cpython-311.pyc,sha256=9e16m5kCObiwhKE-CMQH_HaHtUVTNuBCXuxoggChXqE,174
|
|
6
|
-
PyFinitDiff/__pycache__/triplet.cpython-311.pyc,sha256=9wGGAsXwwnJpXrVW_8afegFKxw2_0lW8awxuzeG9hvg,21838
|
|
7
|
-
PyFinitDiff/__pycache__/utils.cpython-311.pyc,sha256=geiigp4FhZ2U3ABm9GPThkhoz1W3dwx12EL1rsr1yfo,5020
|
|
8
|
-
PyFinitDiff/coefficients/__init__.py,sha256=D6leOHW6065G9S6rdcQLmTc99bhWJ9OldfR8lWYQJIU,4179
|
|
9
|
-
PyFinitDiff/coefficients/backward.py,sha256=cTti5MkcrhvuJVNURLJqnTcMmSQhdPvRPImu6ZSEsfY,1977
|
|
10
|
-
PyFinitDiff/coefficients/central.py,sha256=Xq1W-yXnTFLNugYwHajl8XynHPWdV7jH6ll2fy_NVSI,2377
|
|
11
|
-
PyFinitDiff/coefficients/forward.py,sha256=znCszjYptZpQiINx_VQXFeLTNKhntm3MV1g7CNOW67E,1973
|
|
12
|
-
PyFinitDiff/coefficients/__pycache__/__init__.cpython-311.pyc,sha256=rM9vRmDfISHm69MJ_71I-frCtCt8vn61xwVzUyvlE8I,7581
|
|
13
|
-
PyFinitDiff/coefficients/__pycache__/backward.cpython-311.pyc,sha256=aGpidbhd8mMg9bHPFYVW8zQ86JzohXQ-o84BIQDRwMk,1326
|
|
14
|
-
PyFinitDiff/coefficients/__pycache__/central.cpython-311.pyc,sha256=-o8CjzMpRHALHGyNJWhBB9bYvBSYdlBmuMXLLDqiiRU,1404
|
|
15
|
-
PyFinitDiff/coefficients/__pycache__/forward.cpython-311.pyc,sha256=gSP2jgtk_8Snq7aBksFJiIBuGcm02Pq04qMbttgmIp0,1321
|
|
16
|
-
PyFinitDiff/finite_difference_1D/__init__.py,sha256=VIxWZB2VhtmtnU-Qz-VDGLIz1V1ufqXHyUxlIAYKgW4,237
|
|
17
|
-
PyFinitDiff/finite_difference_1D/boundaries.py,sha256=2HWURIrSMWLUTn4KoSBXYHZdWQEISzw-m6yZxt7CF3w,6159
|
|
18
|
-
PyFinitDiff/finite_difference_1D/derivative.py,sha256=OK6jN426iXHriiesQSy4hsZEN6z1I6osTw7IUK5aqMY,1476
|
|
19
|
-
PyFinitDiff/finite_difference_1D/diagonals.py,sha256=v6C0bPAApLl4qSwFMeoDPKzg8THlObVm9qc7co8QgnM,7082
|
|
20
|
-
PyFinitDiff/finite_difference_1D/finite_difference.py,sha256=q9UpPDxAxN78iBarW1x8W5UEdHTsE6o2BcXddKBIDXM,5871
|
|
21
|
-
PyFinitDiff/finite_difference_1D/utils.py,sha256=wFToOvAEK3A9VqBf_9e4O3cXRdP_igA_iS-67_5JV3Y,1708
|
|
22
|
-
PyFinitDiff/finite_difference_1D/__pycache__/__init__.cpython-311.pyc,sha256=-ZArBy1_sj36fQxNrl8jYe3ElQ2T9QTuQnarNIaHbwM,473
|
|
23
|
-
PyFinitDiff/finite_difference_1D/__pycache__/boundaries.cpython-311.pyc,sha256=BPoq2d7HIGNFVQ7OiKpJzYyr6ifNiTDlMAJrFIkkXco,8541
|
|
24
|
-
PyFinitDiff/finite_difference_1D/__pycache__/derivative.cpython-311.pyc,sha256=wjianpKLMZ-D5ZDl1c4L6sPK0C9-Nitznv6gttkrXvI,1816
|
|
25
|
-
PyFinitDiff/finite_difference_1D/__pycache__/diagonals.cpython-311.pyc,sha256=Q5fOEgO93DGk5Mio-QzDFlWsVh79H8E3v775OW7kCQ8,11354
|
|
26
|
-
PyFinitDiff/finite_difference_1D/__pycache__/finite_difference.cpython-311.pyc,sha256=DYm8zaRsa8zg8X97wXB8cs5mgJ40EEr8gAkc_JAX0xw,7368
|
|
27
|
-
PyFinitDiff/finite_difference_1D/__pycache__/utils.cpython-311.pyc,sha256=qIX5etmoiYcUFJp6Mo22xGen9l0OSO7AnasEm9FTTu8,2682
|
|
28
|
-
PyFinitDiff/finite_difference_2D/__init__.py,sha256=TIijlPbN-SiZ9UsaO5zVSZrb5ZsKVm0P63TZ_rjEySU,234
|
|
29
|
-
PyFinitDiff/finite_difference_2D/boundaries.py,sha256=jokzZ1VXq680XLCMsgAxS9Aza_DTmlYN-w2O_IRe33c,7312
|
|
30
|
-
PyFinitDiff/finite_difference_2D/dense.py,sha256=hWcncevb1gSk_-LSHr2SIk5LWy1bcCKN8UKCFI2robM,9199
|
|
31
|
-
PyFinitDiff/finite_difference_2D/derivative.py,sha256=MlO2aGFuxuK5yAf8q8dEOlc3dgRdf68lf1HTFh7IRzo,1820
|
|
32
|
-
PyFinitDiff/finite_difference_2D/diagonals.py,sha256=KPcmx8LoNyUuBQIJC330GUNEdP5UP4mrg__Vtpy1ZQU,9581
|
|
33
|
-
PyFinitDiff/finite_difference_2D/finite_difference.py,sha256=QRMwCjp4iF7jqkp3LqwzOQum2qT_VwRpjl7ZZp73aEI,6889
|
|
34
|
-
PyFinitDiff/finite_difference_2D/utils.py,sha256=OZgp9Wk1NuOEwXSf8PvQyHXOe927K37shu-WDjN21CM,2182
|
|
35
|
-
PyFinitDiff/finite_difference_2D/__pycache__/__init__.cpython-311.pyc,sha256=WK7cD3zPzFawDannqFty5AHmRc51uszHBmEy7XBBhVI,470
|
|
36
|
-
PyFinitDiff/finite_difference_2D/__pycache__/boundaries.cpython-311.pyc,sha256=44JlTNY0EjIOSh2JwYhLrHxhV3nf3yqj6FjGyTIoaQo,9894
|
|
37
|
-
PyFinitDiff/finite_difference_2D/__pycache__/derivative.cpython-311.pyc,sha256=ef89zIvIyGiT963_vL_K-u0NoTQ66PHgF81cgJ1mCP4,2350
|
|
38
|
-
PyFinitDiff/finite_difference_2D/__pycache__/diagonals.cpython-311.pyc,sha256=nbIwfQpFDR3j9c19WnymQBO_5gOI0mV0vvuk_Q8qjuM,14480
|
|
39
|
-
PyFinitDiff/finite_difference_2D/__pycache__/finite_difference.cpython-311.pyc,sha256=jzLyDEyWLdQiQ8AGBsLzsKVaBJ-WfQu-sqS1EJsYrlw,8842
|
|
40
|
-
PyFinitDiff/finite_difference_2D/__pycache__/utils.cpython-311.pyc,sha256=SnuvmKNDMdbgWgnrzTq_07UmUrmgXXXJpO0h9p3oHoE,3308
|
|
41
|
-
PyFinitDiff/tools/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
42
|
-
PyFinitDiff/tools/directories.py,sha256=CjG37eY-Z68Czo5L7MzHJpu8KEJNhZPnh5VB5MTQ2Tg,837
|
|
43
|
-
tests/1D/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
44
|
-
tests/1D/test_api.py,sha256=A69vKTYoka7Xc2CCbsodzJOURzkVAipWlRQZQDdIoWY,1384
|
|
45
|
-
tests/1D/test_derivative.py,sha256=K0r0zg_Ds3WzIM3g37Jgrgk_ZmlYW64MZUhmgxBjIjs,2088
|
|
46
|
-
tests/1D/__pycache__/__init__.cpython-311.pyc,sha256=X5DqcdwMIWnTwLKFPgvEhMFg2k2Y8zzkhAdShxsWTjA,171
|
|
47
|
-
tests/1D/__pycache__/test_api.cpython-311-pytest-8.2.2.pyc,sha256=i5ZF4uNKIdhZuBnXxTgDas0XTykUm7-oOV21QGrY96w,2076
|
|
48
|
-
tests/1D/__pycache__/test_derivative.cpython-311-pytest-8.2.2.pyc,sha256=SlvVykvQn3i-xrHNmOw5Fbx9_Jkw2cCXV5fkiuDJS3A,3335
|
|
49
|
-
tests/2D/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
50
|
-
tests/2D/test_api.py,sha256=uZ_4cgfYhZvdreCpggFfHs_EUfE8YmkGcWDjEMlx-mc,1738
|
|
51
|
-
tests/2D/test_derivative.py,sha256=QkgXlrbZNkasyp_c8pcYYAr-kaA9RVUuhm_Ib66KXOI,2266
|
|
52
|
-
tests/2D/test_eigen.py,sha256=Pn_j_Fqkk6h0k94uOzEYIMyFeUKHDh5STg6BEgd4YAI,1702
|
|
53
|
-
tests/2D/__pycache__/__init__.cpython-311.pyc,sha256=sxS3dSCdNHH55VKsefzR9ePCcGBci30NGp5oFKn2j3I,171
|
|
54
|
-
tests/2D/__pycache__/test_api.cpython-311-pytest-8.2.2.pyc,sha256=Ylw691Y7nl43DaMDd-QwAN84hOipPeyJucE7Kuxqjzo,2292
|
|
55
|
-
tests/2D/__pycache__/test_derivative.cpython-311-pytest-8.2.2.pyc,sha256=y-XI0DYsaPQvTeEsRgHIb1eTBLXlcxqVTMGMeaECjhU,4128
|
|
56
|
-
tests/2D/__pycache__/test_eigen.cpython-311-pytest-8.2.2.pyc,sha256=ttmczUnRA6j0yV-SbyT9gPlISH5r5oQ_DGVwGCt-BcQ,2197
|
|
57
|
-
PyFinitDiff-1.3.0.dist-info/LICENSE,sha256=U6YG4UEW9XJzHa53oijR0qw6JNN_SZ38WOBmYn3NPd0,1072
|
|
58
|
-
PyFinitDiff-1.3.0.dist-info/METADATA,sha256=b5SCHAEkG_SKkbVeM2PUrdZpL11xQQirm0agEQtRaaU,3779
|
|
59
|
-
PyFinitDiff-1.3.0.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
|
60
|
-
PyFinitDiff-1.3.0.dist-info/top_level.txt,sha256=2ZG92aJV6elyv6Xl7U2Mhqv6Jcu9s3U2507uMBKTXiI,18
|
|
61
|
-
PyFinitDiff-1.3.0.dist-info/RECORD,,
|
tests/1D/__init__.py
DELETED
|
File without changes
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
tests/1D/test_api.py
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env python
|
|
2
|
-
# -*- coding: utf-8 -*-
|
|
3
|
-
|
|
4
|
-
import pytest
|
|
5
|
-
from PyFinitDiff.finite_difference_1D import FiniteDifference, Boundaries
|
|
6
|
-
|
|
7
|
-
# Define boundary conditions for testing
|
|
8
|
-
boundary_conditions = [
|
|
9
|
-
Boundaries(left='zero', right='zero'),
|
|
10
|
-
Boundaries(left='symmetric', right='zero')
|
|
11
|
-
]
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
@pytest.mark.parametrize("boundaries", boundary_conditions, ids=[b.__repr__() for b in boundary_conditions])
|
|
15
|
-
@pytest.mark.parametrize('accuracy', [2, 4, 6], ids=['accuracy_2', 'accuracy_4', 'accuracy_6'])
|
|
16
|
-
@pytest.mark.parametrize('derivative', [1, 2], ids=['derivative_1', 'derivative_2'])
|
|
17
|
-
def test_finite_difference(boundaries, accuracy, derivative):
|
|
18
|
-
"""
|
|
19
|
-
Tests the FiniteDifference class with various boundary conditions, accuracy levels, and derivatives.
|
|
20
|
-
|
|
21
|
-
Args:
|
|
22
|
-
boundaries (Boundaries): Boundary conditions for the finite difference calculation.
|
|
23
|
-
accuracy (int): Accuracy level of the finite difference calculation.
|
|
24
|
-
derivative (int): Order of the derivative for the finite difference calculation.
|
|
25
|
-
"""
|
|
26
|
-
# Initialize a FiniteDifference instance with specified parameters
|
|
27
|
-
finite_diff_instance = FiniteDifference(
|
|
28
|
-
n_x=20,
|
|
29
|
-
dx=1,
|
|
30
|
-
derivative=derivative,
|
|
31
|
-
accuracy=accuracy,
|
|
32
|
-
boundaries=boundaries
|
|
33
|
-
)
|
|
34
|
-
|
|
35
|
-
# Construct the finite difference triplet representation
|
|
36
|
-
finite_diff_instance.construct_triplet()
|
tests/1D/test_derivative.py
DELETED
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env python
|
|
2
|
-
# -*- coding: utf-8 -*-
|
|
3
|
-
|
|
4
|
-
import pytest
|
|
5
|
-
import numpy as np
|
|
6
|
-
import math
|
|
7
|
-
from PyFinitDiff.finite_difference_1D import get_function_derivative
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
def foo(x, power: int):
|
|
11
|
-
"""
|
|
12
|
-
A simple function to return x raised to the power specified.
|
|
13
|
-
|
|
14
|
-
Args:
|
|
15
|
-
x (float): The input value.
|
|
16
|
-
power (int): The power to which x is raised.
|
|
17
|
-
|
|
18
|
-
Returns:
|
|
19
|
-
float: x raised to the specified power.
|
|
20
|
-
"""
|
|
21
|
-
return x**power
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
# List of coefficient types to be tested
|
|
25
|
-
coefficient_type_list = ['central', 'backward', 'forward']
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
@pytest.mark.parametrize("coefficient_type", coefficient_type_list)
|
|
29
|
-
@pytest.mark.parametrize("accuracy", [2, 4, 6], ids=['accuracy_2', 'accuracy_4', 'accuracy_6'])
|
|
30
|
-
@pytest.mark.parametrize("derivative", [1, 2, 3], ids=['derivative_1', 'derivative_2', 'derivative_3'])
|
|
31
|
-
def test_central_derivative(accuracy: int, coefficient_type: str, derivative: int):
|
|
32
|
-
"""
|
|
33
|
-
Tests the get_function_derivative function with various accuracy levels, coefficient types, and derivatives.
|
|
34
|
-
|
|
35
|
-
Args:
|
|
36
|
-
accuracy (int): Accuracy level of the finite difference calculation.
|
|
37
|
-
coefficient_type (str): Type of finite difference coefficients ('central', 'backward', 'forward').
|
|
38
|
-
derivative (int): Order of the derivative for the finite difference calculation.
|
|
39
|
-
"""
|
|
40
|
-
# Evaluate the derivative of the function using finite differences
|
|
41
|
-
evaluation = get_function_derivative(
|
|
42
|
-
function=foo,
|
|
43
|
-
x_eval=3,
|
|
44
|
-
derivative=derivative,
|
|
45
|
-
accuracy=accuracy,
|
|
46
|
-
delta=1,
|
|
47
|
-
function_kwargs=dict(power=derivative),
|
|
48
|
-
coefficient_type=coefficient_type
|
|
49
|
-
)
|
|
50
|
-
|
|
51
|
-
# Compute the theoretical value of the derivative
|
|
52
|
-
theoretical = math.factorial(derivative)
|
|
53
|
-
|
|
54
|
-
# Check if the evaluated derivative is close to the theoretical value
|
|
55
|
-
discrepancy = np.isclose(evaluation, theoretical, atol=1e-5)
|
|
56
|
-
|
|
57
|
-
assert discrepancy, (
|
|
58
|
-
f"[derivative = {derivative} | accuracy = {accuracy}] "
|
|
59
|
-
f"Evaluation output is unexpected. evaluation = {evaluation:.7f} | theoretical = {theoretical:.7f}"
|
|
60
|
-
)
|
tests/2D/__init__.py
DELETED
|
File without changes
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
tests/2D/test_api.py
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env python
|
|
2
|
-
# -*- coding: utf-8 -*-
|
|
3
|
-
|
|
4
|
-
import pytest
|
|
5
|
-
from PyFinitDiff.finite_difference_2D import FiniteDifference, Boundaries
|
|
6
|
-
|
|
7
|
-
# Define accuracies and derivatives to be tested
|
|
8
|
-
accuracies = [2, 4, 6]
|
|
9
|
-
derivatives = [1, 2]
|
|
10
|
-
|
|
11
|
-
# Define boundary conditions for testing
|
|
12
|
-
boundary_conditions = [
|
|
13
|
-
Boundaries(left='zero', right='zero', top='zero', bottom='zero'),
|
|
14
|
-
Boundaries(left='symmetric', right='zero', top='zero', bottom='zero'),
|
|
15
|
-
Boundaries(left='anti-symmetric', right='zero', top='zero', bottom='zero'),
|
|
16
|
-
Boundaries(left='anti-symmetric', right='zero', top='symmetric', bottom='zero')
|
|
17
|
-
]
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
@pytest.mark.parametrize("boundaries", boundary_conditions, ids=[b.__repr__() for b in boundary_conditions])
|
|
21
|
-
@pytest.mark.parametrize('accuracy', accuracies, ids=['accuracy_2', 'accuracy_4', 'accuracy_6'])
|
|
22
|
-
@pytest.mark.parametrize('derivative', derivatives, ids=['derivative_1', 'derivative_2'])
|
|
23
|
-
def test_compare_sparse_dense_0(boundaries, accuracy, derivative):
|
|
24
|
-
"""
|
|
25
|
-
Tests the FiniteDifference class with various boundary conditions, accuracy levels, and derivatives.
|
|
26
|
-
|
|
27
|
-
Args:
|
|
28
|
-
boundaries (Boundaries): Boundary conditions for the finite difference calculation.
|
|
29
|
-
accuracy (int): Accuracy level of the finite difference calculation.
|
|
30
|
-
derivative (int): Order of the derivative for the finite difference calculation.
|
|
31
|
-
"""
|
|
32
|
-
# Initialize a FiniteDifference instance with specified parameters
|
|
33
|
-
finite_diff_instance = FiniteDifference(
|
|
34
|
-
n_x=20,
|
|
35
|
-
n_y=20,
|
|
36
|
-
dx=1,
|
|
37
|
-
dy=1,
|
|
38
|
-
derivative=derivative,
|
|
39
|
-
accuracy=accuracy,
|
|
40
|
-
boundaries=boundaries
|
|
41
|
-
)
|
|
42
|
-
|
|
43
|
-
# Construct the finite difference triplet representation
|
|
44
|
-
finite_diff_instance.construct_triplet()
|
tests/2D/test_derivative.py
DELETED
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env python
|
|
2
|
-
# -*- coding: utf-8 -*-
|
|
3
|
-
|
|
4
|
-
import numpy as np
|
|
5
|
-
import math
|
|
6
|
-
import pytest
|
|
7
|
-
from PyFinitDiff.finite_difference_2D import FiniteDifference, Boundaries
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
def foo(power: int, size: int = 20):
|
|
11
|
-
"""
|
|
12
|
-
Generates 2D arrays for testing finite difference calculations.
|
|
13
|
-
|
|
14
|
-
Args:
|
|
15
|
-
power (int): The power to which elements in the x_array are raised.
|
|
16
|
-
size (int, optional): The size of the generated arrays. Default is 20.
|
|
17
|
-
|
|
18
|
-
Returns:
|
|
19
|
-
tuple: A tuple containing the x_array and y_array.
|
|
20
|
-
"""
|
|
21
|
-
x_array = np.arange(0, size) ** power
|
|
22
|
-
y_array = np.ones(size)
|
|
23
|
-
x_array, y_array = np.meshgrid(x_array, y_array)
|
|
24
|
-
return x_array, y_array
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
# Define derivatives and accuracies to be tested
|
|
28
|
-
derivatives = [1, 2, 3]
|
|
29
|
-
derivatives_ids = [f'derivative: {d}' for d in derivatives]
|
|
30
|
-
accuracies = [2, 4, 6]
|
|
31
|
-
accuracies_ids = [f'accuracy: {a}' for a in accuracies]
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
@pytest.mark.parametrize('derivative', derivatives, ids=derivatives_ids)
|
|
35
|
-
@pytest.mark.parametrize('accuracy', accuracies, ids=accuracies_ids)
|
|
36
|
-
def test_derivative(accuracy, derivative):
|
|
37
|
-
"""
|
|
38
|
-
Tests the finite difference derivative calculations with various accuracies and derivatives.
|
|
39
|
-
|
|
40
|
-
Args:
|
|
41
|
-
accuracy (int): Accuracy level of the finite difference calculation.
|
|
42
|
-
derivative (int): Order of the derivative for the finite difference calculation.
|
|
43
|
-
"""
|
|
44
|
-
size = 20
|
|
45
|
-
x_array, y_array = foo(power=derivative, size=size)
|
|
46
|
-
|
|
47
|
-
boundaries = Boundaries(
|
|
48
|
-
top='symmetric',
|
|
49
|
-
bottom='symmetric',
|
|
50
|
-
right='symmetric',
|
|
51
|
-
left='symmetric'
|
|
52
|
-
)
|
|
53
|
-
|
|
54
|
-
finite_difference = FiniteDifference(
|
|
55
|
-
n_x=size,
|
|
56
|
-
n_y=size,
|
|
57
|
-
dx=1,
|
|
58
|
-
dy=1,
|
|
59
|
-
derivative=derivative,
|
|
60
|
-
accuracy=accuracy,
|
|
61
|
-
boundaries=boundaries
|
|
62
|
-
)
|
|
63
|
-
|
|
64
|
-
sparse_matrix = finite_difference.triplet.to_scipy_sparse()
|
|
65
|
-
y_gradient = sparse_matrix * x_array.ravel()
|
|
66
|
-
y_gradient = y_gradient.reshape([size, size])
|
|
67
|
-
|
|
68
|
-
theoretical = math.factorial(derivative)
|
|
69
|
-
evaluation = y_gradient[size // 2, size // 2]
|
|
70
|
-
|
|
71
|
-
discrepancy = np.isclose(evaluation, theoretical, atol=1e-5)
|
|
72
|
-
|
|
73
|
-
assert discrepancy, (
|
|
74
|
-
f'Deviation from theoretical value for derivative. '
|
|
75
|
-
f'Evaluation: {evaluation}, Theoretical: {theoretical}'
|
|
76
|
-
)
|
tests/2D/test_eigen.py
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env python
|
|
2
|
-
# -*- coding: utf-8 -*-
|
|
3
|
-
|
|
4
|
-
import pytest
|
|
5
|
-
from scipy.sparse import linalg
|
|
6
|
-
from PyFinitDiff.finite_difference_2D import FiniteDifference, Boundaries
|
|
7
|
-
from PyFinitDiff.utils import get_2D_circular_mesh_triplet
|
|
8
|
-
|
|
9
|
-
# Define boundary conditions for testing
|
|
10
|
-
boundary_conditions = [
|
|
11
|
-
Boundaries(left='zero', right='zero', top='zero', bottom='zero'),
|
|
12
|
-
Boundaries(left='symmetric', right='zero', top='zero', bottom='zero'),
|
|
13
|
-
Boundaries(left='anti-symmetric', right='zero', top='zero', bottom='zero'),
|
|
14
|
-
Boundaries(left='anti-symmetric', right='zero', top='symmetric', bottom='zero')
|
|
15
|
-
]
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
@pytest.mark.parametrize("boundaries", boundary_conditions, ids=[b.__repr__() for b in boundary_conditions])
|
|
19
|
-
def test_compute_eigenmode_sparse_0(boundaries):
|
|
20
|
-
"""
|
|
21
|
-
Tests the computation of eigenmodes using sparse matrices with a 2D finite difference method.
|
|
22
|
-
"""
|
|
23
|
-
n_x = n_y = 40
|
|
24
|
-
|
|
25
|
-
# Create a FiniteDifference instance with specified parameters
|
|
26
|
-
sparse_instance = FiniteDifference(
|
|
27
|
-
n_x=n_x,
|
|
28
|
-
n_y=n_y,
|
|
29
|
-
dx=1,
|
|
30
|
-
dy=1,
|
|
31
|
-
derivative=2,
|
|
32
|
-
accuracy=2,
|
|
33
|
-
boundaries=boundaries
|
|
34
|
-
)
|
|
35
|
-
|
|
36
|
-
# Create a 2D circular mesh triplet
|
|
37
|
-
mesh_triplet = get_2D_circular_mesh_triplet(
|
|
38
|
-
n_x=n_x,
|
|
39
|
-
n_y=n_y,
|
|
40
|
-
value_in=1.0,
|
|
41
|
-
value_out=1.4444,
|
|
42
|
-
x_offset=0,
|
|
43
|
-
y_offset=0,
|
|
44
|
-
radius=70
|
|
45
|
-
)
|
|
46
|
-
|
|
47
|
-
# Combine the finite difference triplet with the mesh triplet
|
|
48
|
-
dynamic_triplet = sparse_instance.triplet + mesh_triplet
|
|
49
|
-
|
|
50
|
-
# Compute the eigenvalues and eigenvectors
|
|
51
|
-
eigen_values, eigen_vectors = linalg.eigs(
|
|
52
|
-
dynamic_triplet.to_dense(),
|
|
53
|
-
k=5,
|
|
54
|
-
which='LM',
|
|
55
|
-
sigma=1.44
|
|
56
|
-
)
|
|
57
|
-
|
|
58
|
-
# -
|
|
File without changes
|