PyFinitDiff 1.3.1.post0__tar.gz → 2.0.1.post0__tar.gz

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.
Files changed (211) hide show
  1. pyfinitdiff-2.0.1.post0/.coverage +0 -0
  2. pyfinitdiff-2.0.1.post0/.github/workflows/deploy_coverage.yml +52 -0
  3. pyfinitdiff-2.0.1.post0/.github/workflows/deploy_documentation.yml +55 -0
  4. pyfinitdiff-2.0.1.post0/.github/workflows/deploy_workflow.yml +30 -0
  5. pyfinitdiff-2.0.1.post0/PKG-INFO +175 -0
  6. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/PyFinitDiff/_version.py +2 -2
  7. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/PyFinitDiff/finite_difference_1D/boundaries.py +1 -1
  8. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/PyFinitDiff/finite_difference_1D/diagonals.py +0 -1
  9. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/PyFinitDiff/finite_difference_1D/finite_difference.py +1 -1
  10. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/PyFinitDiff/finite_difference_2D/boundaries.py +1 -1
  11. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/PyFinitDiff/finite_difference_2D/derivative.py +0 -2
  12. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/PyFinitDiff/finite_difference_2D/diagonals.py +1 -1
  13. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/PyFinitDiff/finite_difference_2D/finite_difference.py +1 -1
  14. pyfinitdiff-2.0.1.post0/PyFinitDiff/triplet.py +221 -0
  15. pyfinitdiff-2.0.1.post0/PyFinitDiff.egg-info/PKG-INFO +175 -0
  16. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/PyFinitDiff.egg-info/SOURCES.txt +6 -4
  17. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/PyFinitDiff.egg-info/requires.txt +5 -7
  18. pyfinitdiff-2.0.1.post0/README.rst +112 -0
  19. {pyfinitdiff-1.3.1.post0/docs/source/gallery → pyfinitdiff-2.0.1.post0/docs/examples}/triplets/plot_triplets_0.py +1 -3
  20. {pyfinitdiff-1.3.1.post0/docs/source/gallery → pyfinitdiff-2.0.1.post0/docs/examples}/triplets/plot_triplets_1.py +1 -3
  21. {pyfinitdiff-1.3.1.post0/docs/source/gallery → pyfinitdiff-2.0.1.post0/docs/examples}/triplets/plot_triplets_2.py +1 -3
  22. {pyfinitdiff-1.3.1.post0/docs/source/gallery → pyfinitdiff-2.0.1.post0/docs/examples}/triplets/plot_triplets_3.py +1 -3
  23. pyfinitdiff-2.0.1.post0/docs/images/triplet_example_0.png +0 -0
  24. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/source/conf.py +0 -2
  25. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/pyproject.toml +29 -9
  26. pyfinitdiff-2.0.1.post0/tests/test_1D_api.py +47 -0
  27. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/tests/test_1D_derivative.py +3 -0
  28. pyfinitdiff-2.0.1.post0/tests/test_2D_api.py +83 -0
  29. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/tests/test_2D_derivative.py +3 -0
  30. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/tests/test_2D_eigen.py +2 -1
  31. pyfinitdiff-2.0.1.post0/tests/test_triplet.py +35 -0
  32. pyfinitdiff-1.3.1.post0/.github/workflows/deploy_workflow.yml +0 -54
  33. pyfinitdiff-1.3.1.post0/PKG-INFO +0 -146
  34. pyfinitdiff-1.3.1.post0/PyFinitDiff/finite_difference_2D/dense.py +0 -238
  35. pyfinitdiff-1.3.1.post0/PyFinitDiff/triplet.py +0 -449
  36. pyfinitdiff-1.3.1.post0/PyFinitDiff.egg-info/PKG-INFO +0 -146
  37. pyfinitdiff-1.3.1.post0/README.rst +0 -84
  38. pyfinitdiff-1.3.1.post0/benchmarks/benchmark_0.py +0 -109
  39. pyfinitdiff-1.3.1.post0/tests/__init__.py +0 -0
  40. pyfinitdiff-1.3.1.post0/tests/test_1D_api.py +0 -36
  41. pyfinitdiff-1.3.1.post0/tests/test_2D_api.py +0 -44
  42. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/.github/dependabot.yml +0 -0
  43. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/.gitignore +0 -0
  44. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/.readthedocs.yml +0 -0
  45. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/LICENSE +0 -0
  46. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/PyFinitDiff/__init__.py +0 -0
  47. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/PyFinitDiff/coefficients/__init__.py +0 -0
  48. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/PyFinitDiff/coefficients/backward.py +0 -0
  49. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/PyFinitDiff/coefficients/central.py +0 -0
  50. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/PyFinitDiff/coefficients/forward.py +0 -0
  51. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/PyFinitDiff/finite_difference_1D/__init__.py +0 -0
  52. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/PyFinitDiff/finite_difference_1D/derivative.py +0 -0
  53. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/PyFinitDiff/finite_difference_1D/utils.py +0 -0
  54. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/PyFinitDiff/finite_difference_2D/__init__.py +0 -0
  55. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/PyFinitDiff/finite_difference_2D/utils.py +0 -0
  56. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/PyFinitDiff/tools/__init__.py +0 -0
  57. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/PyFinitDiff/tools/directories.py +0 -0
  58. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/PyFinitDiff/utils.py +0 -0
  59. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/PyFinitDiff.egg-info/dependency_links.txt +0 -0
  60. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/PyFinitDiff.egg-info/top_level.txt +0 -0
  61. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/Makefile +0 -0
  62. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/examples/README.rst +0 -0
  63. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/examples/eigenmodes_1d/README.rst +0 -0
  64. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/examples/eigenmodes_1d/plot_mode_0.py +0 -0
  65. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/examples/eigenmodes_1d/plot_mode_1.py +0 -0
  66. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/examples/eigenmodes_1d/plot_mode_2.py +0 -0
  67. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/examples/eigenmodes_1d/plot_mode_3.py +0 -0
  68. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/examples/eigenmodes_2d/README.rst +0 -0
  69. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/examples/eigenmodes_2d/plot_bottom_anti_symmetric.py +0 -0
  70. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/examples/eigenmodes_2d/plot_bottom_symmetric.py +0 -0
  71. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/examples/eigenmodes_2d/plot_left_anti_symmetric.py +0 -0
  72. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/examples/eigenmodes_2d/plot_left_symmetric.py +0 -0
  73. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/examples/eigenmodes_2d/plot_no_symmetry.py +0 -0
  74. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/examples/eigenmodes_2d/plot_right_anti_symmetric.py +0 -0
  75. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/examples/eigenmodes_2d/plot_right_symmetric.py +0 -0
  76. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/examples/eigenmodes_2d/plot_top_anti_symmetric.py +0 -0
  77. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/examples/eigenmodes_2d/plot_top_symmetric.py +0 -0
  78. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/examples/extras/README.rst +0 -0
  79. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/examples/extras/gradient.py +0 -0
  80. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/examples/extras/plot_WM_field.py +0 -0
  81. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/examples/triplets/README.rst +0 -0
  82. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/images/logo.png +0 -0
  83. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/make.bat +0 -0
  84. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/source/_static/default.css +0 -0
  85. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/source/code.rst +0 -0
  86. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/source/gallery/eigenmodes_1d/images/sphx_glr_plot_mode_0_001.png +0 -0
  87. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/source/gallery/eigenmodes_1d/images/sphx_glr_plot_mode_1_001.png +0 -0
  88. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/source/gallery/eigenmodes_1d/images/sphx_glr_plot_mode_2_001.png +0 -0
  89. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/source/gallery/eigenmodes_1d/images/sphx_glr_plot_mode_3_001.png +0 -0
  90. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/source/gallery/eigenmodes_1d/images/thumb/sphx_glr_plot_mode_0_thumb.png +0 -0
  91. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/source/gallery/eigenmodes_1d/images/thumb/sphx_glr_plot_mode_1_thumb.png +0 -0
  92. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/source/gallery/eigenmodes_1d/images/thumb/sphx_glr_plot_mode_2_thumb.png +0 -0
  93. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/source/gallery/eigenmodes_1d/images/thumb/sphx_glr_plot_mode_3_thumb.png +0 -0
  94. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/source/gallery/eigenmodes_1d/index.rst +0 -0
  95. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/source/gallery/eigenmodes_1d/plot_mode_0.ipynb +0 -0
  96. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/source/gallery/eigenmodes_1d/plot_mode_0.py +0 -0
  97. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/source/gallery/eigenmodes_1d/plot_mode_0.py.md5 +0 -0
  98. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/source/gallery/eigenmodes_1d/plot_mode_0.rst +0 -0
  99. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/source/gallery/eigenmodes_1d/plot_mode_1.ipynb +0 -0
  100. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/source/gallery/eigenmodes_1d/plot_mode_1.py +0 -0
  101. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/source/gallery/eigenmodes_1d/plot_mode_1.py.md5 +0 -0
  102. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/source/gallery/eigenmodes_1d/plot_mode_1.rst +0 -0
  103. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/source/gallery/eigenmodes_1d/plot_mode_2.ipynb +0 -0
  104. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/source/gallery/eigenmodes_1d/plot_mode_2.py +0 -0
  105. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/source/gallery/eigenmodes_1d/plot_mode_2.py.md5 +0 -0
  106. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/source/gallery/eigenmodes_1d/plot_mode_2.rst +0 -0
  107. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/source/gallery/eigenmodes_1d/plot_mode_3.ipynb +0 -0
  108. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/source/gallery/eigenmodes_1d/plot_mode_3.py +0 -0
  109. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/source/gallery/eigenmodes_1d/plot_mode_3.py.md5 +0 -0
  110. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/source/gallery/eigenmodes_1d/plot_mode_3.rst +0 -0
  111. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/source/gallery/eigenmodes_1d/sg_execution_times.rst +0 -0
  112. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/source/gallery/eigenmodes_2d/images/sphx_glr_plot_bottom_anti_symmetric_001.png +0 -0
  113. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/source/gallery/eigenmodes_2d/images/sphx_glr_plot_bottom_symmetric_001.png +0 -0
  114. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/source/gallery/eigenmodes_2d/images/sphx_glr_plot_left_anti_symmetric_001.png +0 -0
  115. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/source/gallery/eigenmodes_2d/images/sphx_glr_plot_left_symmetric_001.png +0 -0
  116. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/source/gallery/eigenmodes_2d/images/sphx_glr_plot_no_symmetry_001.png +0 -0
  117. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/source/gallery/eigenmodes_2d/images/sphx_glr_plot_right_anti_symmetric_001.png +0 -0
  118. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/source/gallery/eigenmodes_2d/images/sphx_glr_plot_right_symmetric_001.png +0 -0
  119. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/source/gallery/eigenmodes_2d/images/sphx_glr_plot_top_anti_symmetric_001.png +0 -0
  120. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/source/gallery/eigenmodes_2d/images/sphx_glr_plot_top_symmetric_001.png +0 -0
  121. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/source/gallery/eigenmodes_2d/images/thumb/sphx_glr_plot_bottom_anti_symmetric_thumb.png +0 -0
  122. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/source/gallery/eigenmodes_2d/images/thumb/sphx_glr_plot_bottom_symmetric_thumb.png +0 -0
  123. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/source/gallery/eigenmodes_2d/images/thumb/sphx_glr_plot_left_anti_symmetric_thumb.png +0 -0
  124. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/source/gallery/eigenmodes_2d/images/thumb/sphx_glr_plot_left_symmetric_thumb.png +0 -0
  125. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/source/gallery/eigenmodes_2d/images/thumb/sphx_glr_plot_no_symmetry_thumb.png +0 -0
  126. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/source/gallery/eigenmodes_2d/images/thumb/sphx_glr_plot_right_anti_symmetric_thumb.png +0 -0
  127. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/source/gallery/eigenmodes_2d/images/thumb/sphx_glr_plot_right_symmetric_thumb.png +0 -0
  128. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/source/gallery/eigenmodes_2d/images/thumb/sphx_glr_plot_top_anti_symmetric_thumb.png +0 -0
  129. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/source/gallery/eigenmodes_2d/images/thumb/sphx_glr_plot_top_symmetric_thumb.png +0 -0
  130. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/source/gallery/eigenmodes_2d/index.rst +0 -0
  131. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/source/gallery/eigenmodes_2d/plot_bottom_anti_symmetric.ipynb +0 -0
  132. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/source/gallery/eigenmodes_2d/plot_bottom_anti_symmetric.py +0 -0
  133. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/source/gallery/eigenmodes_2d/plot_bottom_anti_symmetric.py.md5 +0 -0
  134. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/source/gallery/eigenmodes_2d/plot_bottom_anti_symmetric.rst +0 -0
  135. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/source/gallery/eigenmodes_2d/plot_bottom_symmetric.ipynb +0 -0
  136. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/source/gallery/eigenmodes_2d/plot_bottom_symmetric.py +0 -0
  137. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/source/gallery/eigenmodes_2d/plot_bottom_symmetric.py.md5 +0 -0
  138. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/source/gallery/eigenmodes_2d/plot_bottom_symmetric.rst +0 -0
  139. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/source/gallery/eigenmodes_2d/plot_left_anti_symmetric.ipynb +0 -0
  140. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/source/gallery/eigenmodes_2d/plot_left_anti_symmetric.py +0 -0
  141. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/source/gallery/eigenmodes_2d/plot_left_anti_symmetric.py.md5 +0 -0
  142. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/source/gallery/eigenmodes_2d/plot_left_anti_symmetric.rst +0 -0
  143. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/source/gallery/eigenmodes_2d/plot_left_symmetric.ipynb +0 -0
  144. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/source/gallery/eigenmodes_2d/plot_left_symmetric.py +0 -0
  145. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/source/gallery/eigenmodes_2d/plot_left_symmetric.py.md5 +0 -0
  146. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/source/gallery/eigenmodes_2d/plot_left_symmetric.rst +0 -0
  147. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/source/gallery/eigenmodes_2d/plot_no_symmetry.ipynb +0 -0
  148. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/source/gallery/eigenmodes_2d/plot_no_symmetry.py +0 -0
  149. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/source/gallery/eigenmodes_2d/plot_no_symmetry.py.md5 +0 -0
  150. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/source/gallery/eigenmodes_2d/plot_no_symmetry.rst +0 -0
  151. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/source/gallery/eigenmodes_2d/plot_right_anti_symmetric.ipynb +0 -0
  152. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/source/gallery/eigenmodes_2d/plot_right_anti_symmetric.py +0 -0
  153. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/source/gallery/eigenmodes_2d/plot_right_anti_symmetric.py.md5 +0 -0
  154. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/source/gallery/eigenmodes_2d/plot_right_anti_symmetric.rst +0 -0
  155. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/source/gallery/eigenmodes_2d/plot_right_symmetric.ipynb +0 -0
  156. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/source/gallery/eigenmodes_2d/plot_right_symmetric.py +0 -0
  157. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/source/gallery/eigenmodes_2d/plot_right_symmetric.py.md5 +0 -0
  158. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/source/gallery/eigenmodes_2d/plot_right_symmetric.rst +0 -0
  159. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/source/gallery/eigenmodes_2d/plot_top_anti_symmetric.ipynb +0 -0
  160. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/source/gallery/eigenmodes_2d/plot_top_anti_symmetric.py +0 -0
  161. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/source/gallery/eigenmodes_2d/plot_top_anti_symmetric.py.md5 +0 -0
  162. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/source/gallery/eigenmodes_2d/plot_top_anti_symmetric.rst +0 -0
  163. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/source/gallery/eigenmodes_2d/plot_top_symmetric.ipynb +0 -0
  164. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/source/gallery/eigenmodes_2d/plot_top_symmetric.py +0 -0
  165. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/source/gallery/eigenmodes_2d/plot_top_symmetric.py.md5 +0 -0
  166. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/source/gallery/eigenmodes_2d/plot_top_symmetric.rst +0 -0
  167. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/source/gallery/eigenmodes_2d/sg_execution_times.rst +0 -0
  168. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/source/gallery/extras/gradient.ipynb +0 -0
  169. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/source/gallery/extras/gradient.py +0 -0
  170. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/source/gallery/extras/gradient.rst +0 -0
  171. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/source/gallery/extras/images/sphx_glr_plot_WM_field_001.png +0 -0
  172. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/source/gallery/extras/images/thumb/sphx_glr_gradient_thumb.png +0 -0
  173. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/source/gallery/extras/images/thumb/sphx_glr_plot_WM_field_thumb.png +0 -0
  174. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/source/gallery/extras/index.rst +0 -0
  175. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/source/gallery/extras/plot_WM_field.ipynb +0 -0
  176. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/source/gallery/extras/plot_WM_field.py +0 -0
  177. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/source/gallery/extras/plot_WM_field.py.md5 +0 -0
  178. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/source/gallery/extras/plot_WM_field.rst +0 -0
  179. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/source/gallery/extras/sg_execution_times.rst +0 -0
  180. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/source/gallery/index.rst +0 -0
  181. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/source/gallery/triplets/images/sphx_glr_plot_triplets_0_001.png +0 -0
  182. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/source/gallery/triplets/images/sphx_glr_plot_triplets_1_001.png +0 -0
  183. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/source/gallery/triplets/images/sphx_glr_plot_triplets_2_001.png +0 -0
  184. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/source/gallery/triplets/images/sphx_glr_plot_triplets_3_001.png +0 -0
  185. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/source/gallery/triplets/images/thumb/sphx_glr_plot_triplets_0_thumb.png +0 -0
  186. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/source/gallery/triplets/images/thumb/sphx_glr_plot_triplets_1_thumb.png +0 -0
  187. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/source/gallery/triplets/images/thumb/sphx_glr_plot_triplets_2_thumb.png +0 -0
  188. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/source/gallery/triplets/images/thumb/sphx_glr_plot_triplets_3_thumb.png +0 -0
  189. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/source/gallery/triplets/index.rst +0 -0
  190. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/source/gallery/triplets/plot_triplets_0.ipynb +0 -0
  191. {pyfinitdiff-1.3.1.post0/docs/examples → pyfinitdiff-2.0.1.post0/docs/source/gallery}/triplets/plot_triplets_0.py +0 -0
  192. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/source/gallery/triplets/plot_triplets_0.py.md5 +0 -0
  193. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/source/gallery/triplets/plot_triplets_0.rst +0 -0
  194. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/source/gallery/triplets/plot_triplets_1.ipynb +0 -0
  195. {pyfinitdiff-1.3.1.post0/docs/examples → pyfinitdiff-2.0.1.post0/docs/source/gallery}/triplets/plot_triplets_1.py +0 -0
  196. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/source/gallery/triplets/plot_triplets_1.py.md5 +0 -0
  197. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/source/gallery/triplets/plot_triplets_1.rst +0 -0
  198. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/source/gallery/triplets/plot_triplets_2.ipynb +0 -0
  199. {pyfinitdiff-1.3.1.post0/docs/examples → pyfinitdiff-2.0.1.post0/docs/source/gallery}/triplets/plot_triplets_2.py +0 -0
  200. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/source/gallery/triplets/plot_triplets_2.py.md5 +0 -0
  201. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/source/gallery/triplets/plot_triplets_2.rst +0 -0
  202. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/source/gallery/triplets/plot_triplets_3.ipynb +0 -0
  203. {pyfinitdiff-1.3.1.post0/docs/examples → pyfinitdiff-2.0.1.post0/docs/source/gallery}/triplets/plot_triplets_3.py +0 -0
  204. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/source/gallery/triplets/plot_triplets_3.py.md5 +0 -0
  205. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/source/gallery/triplets/plot_triplets_3.rst +0 -0
  206. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/source/gallery/triplets/sg_execution_times.rst +0 -0
  207. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/source/index.rst +0 -0
  208. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/source/references.rst +0 -0
  209. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/docs/source/theory.rst +0 -0
  210. {pyfinitdiff-1.3.1.post0 → pyfinitdiff-2.0.1.post0}/setup.cfg +0 -0
  211. {pyfinitdiff-1.3.1.post0/docs/examples → pyfinitdiff-2.0.1.post0/tests}/__init__.py +0 -0
Binary file
@@ -0,0 +1,52 @@
1
+ # .github/workflows/deploy_coverage.yml
2
+ name: Coverage
3
+
4
+ on:
5
+ pull_request:
6
+ branches: "master"
7
+ push:
8
+ branches: "master"
9
+
10
+
11
+ jobs:
12
+ coverage:
13
+ name: Run test and generate coverage data
14
+ runs-on: ubuntu-latest
15
+ permissions:
16
+ pull-requests: write
17
+ contents: write
18
+
19
+ steps:
20
+ - name: "Set-up: Python 3.10"
21
+ uses: actions/setup-python@v4
22
+ id: cp310
23
+ with:
24
+ python-version: "3.10"
25
+
26
+ - name: "Install: Dependencies for headless server"
27
+ shell: bash
28
+ run: |
29
+ sudo apt-get update
30
+ sudo apt-get install libgl1-mesa-glx xvfb
31
+
32
+ - name: "Checkout requirements and files for testing"
33
+ uses: actions/checkout@v4
34
+ with:
35
+ fetch-depth: 0
36
+ submodules: true
37
+
38
+ - name: Install everything, run the tests, produce the .coverage file
39
+ run: |
40
+ python -m pip install wheel build
41
+ python -m build --wheel
42
+ python -m pip install .[testing]
43
+ pytest
44
+
45
+ - name: Coverage comment
46
+ if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
47
+ uses: py-cov-action/python-coverage-comment-action@v3
48
+ with:
49
+ GITHUB_PR_RUN_ID: ${{ github.event.workflow_run.id }}
50
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
51
+ MINIMUM_GREEN: 90
52
+ MINIMUM_ORANGE: 50
@@ -0,0 +1,55 @@
1
+ # .github/workflows/deploy_documentation.yml
2
+ name: Documentation
3
+
4
+ on:
5
+ pull_request:
6
+ branches: "master"
7
+ push:
8
+ branches: "master"
9
+
10
+ jobs:
11
+ documentation:
12
+ name: Run the documentation building tools
13
+ runs-on: ubuntu-latest
14
+ permissions:
15
+ pull-requests: write
16
+ contents: write
17
+
18
+ steps:
19
+ - name: "Set-up: Python 3.10"
20
+ uses: actions/setup-python@v4
21
+ id: cp310
22
+ with:
23
+ python-version: "3.10"
24
+
25
+ - name: "Install: Dependencies for headless server"
26
+ shell: bash
27
+ run: |
28
+ sudo apt-get update
29
+ sudo apt-get install libgl1-mesa-glx xvfb
30
+
31
+ - name: "Checkout requirements and files for testing"
32
+ uses: actions/checkout@v4
33
+ with:
34
+ fetch-depth: 0
35
+ submodules: true
36
+
37
+ - name: Install everything, run the tests, produce the .coverage file
38
+ run: |
39
+ python -m pip install wheel build
40
+ python -m build --wheel
41
+ python -m pip install .[documentation]
42
+
43
+ - name: "Build: documentation"
44
+ shell: bash
45
+ run: |
46
+ make -C docs html
47
+
48
+ - name: "Upload: GitHub Pages"
49
+ if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
50
+ uses: crazy-max/ghaction-github-pages@v3
51
+ with:
52
+ target_branch: gh-pages
53
+ build_dir: docs/build/html
54
+ env:
55
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -0,0 +1,30 @@
1
+ name: Deploy Wheel
2
+
3
+ on:
4
+ push:
5
+ branches: [ "master" ]
6
+ tags:
7
+ - '*'
8
+ pull_request:
9
+ branches: [ "master" ]
10
+
11
+ permissions:
12
+ contents: write
13
+
14
+ jobs:
15
+ build_pure_python:
16
+ runs-on: ubuntu-latest
17
+ steps:
18
+ - uses: MartinPdeS/MPSActions/build_pure_python_package@master
19
+ with:
20
+ python-version: '3.10'
21
+
22
+ publish_wheel:
23
+ if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
24
+ needs: [build_pure_python]
25
+ runs-on: ubuntu-latest
26
+ steps:
27
+ - uses: MartinPdeS/MPSActions/publish_pypi@master
28
+ with:
29
+ python-version: "3.10"
30
+ password: ${{ secrets.PYPI_API_TOKEN }}
@@ -0,0 +1,175 @@
1
+ Metadata-Version: 2.1
2
+ Name: PyFinitDiff
3
+ Version: 2.0.1.post0
4
+ Summary: A package finit-difference matrix generation.
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
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: pydantic>=2.6.3
45
+ Requires-Dist: numpy
46
+ Requires-Dist: scipy
47
+ Requires-Dist: MPSPlots
48
+ Requires-Dist: tabulate
49
+ Provides-Extra: testing
50
+ Requires-Dist: pytest>=0.6; extra == "testing"
51
+ Requires-Dist: pytest-cov>=2.0; extra == "testing"
52
+ Requires-Dist: pytest-json-report==1.5.0; extra == "testing"
53
+ Requires-Dist: mypy>=0.910; extra == "testing"
54
+ Requires-Dist: flake8>=3.9; extra == "testing"
55
+ Requires-Dist: tox>=3.24; extra == "testing"
56
+ Requires-Dist: coverage==7.6.1; extra == "testing"
57
+ Provides-Extra: documentation
58
+ Requires-Dist: numpydoc==1.8.0; extra == "documentation"
59
+ Requires-Dist: sphinx>=5.1.1; extra == "documentation"
60
+ Requires-Dist: sphinx-gallery==0.17.1; extra == "documentation"
61
+ Requires-Dist: sphinx-rtd-theme==2.0.0; extra == "documentation"
62
+ Requires-Dist: pydata-sphinx-theme==0.15.4; extra == "documentation"
63
+
64
+ PyFinitDiff
65
+ ===========
66
+
67
+ |python| |docs| |coverage| |PyPi| |PyPi_download|
68
+
69
+ PyFinitDiff
70
+ ===========
71
+
72
+ 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.
73
+
74
+
75
+ Features
76
+ ********
77
+ - **Intuitive API**: PyFinitDiff offers an easy-to-use interface that allows users to generate finite-difference matrices with minimal effort.
78
+ - **Versatile Applications**: Suitable for a wide range of numerical methods including solving partial differential equations (PDEs), performing numerical differentiation, and more.
79
+ - **Comprehensive Documentation**: Detailed documentation and examples to help users get started quickly.
80
+
81
+ Installation
82
+ ------------
83
+
84
+ PyFinitDiff requires Python 3.10+ and is available on PyPi for various operating systems including Linux and macOS.
85
+
86
+ Install PyFinitDiff via pip:
87
+
88
+ .. code-block:: bash
89
+
90
+ pip install PyFinitDiff
91
+
92
+ Documentation
93
+ *************
94
+ 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:
95
+
96
+ |docs|
97
+
98
+ Usage Example
99
+ *************
100
+
101
+ Below is a simple example to illustrate how to use PyFinitDiff:
102
+
103
+ .. code-block:: python
104
+
105
+ from PyFinitDiff.finite_difference_1D import FiniteDifference
106
+ from PyFinitDiff.finite_difference_1D import Boundaries
107
+
108
+ boundaries = Boundaries(left='none', right='none')
109
+
110
+ n_x = 100
111
+ fd = FiniteDifference(
112
+ n_x=n_x,
113
+ dx=1,
114
+ derivative=2,
115
+ accuracy=2,
116
+ boundaries=boundaries
117
+ )
118
+
119
+ fd.triplet.plot()
120
+
121
+ dense_matrix = fd.triplet.to_scipy_sparse()
122
+
123
+ sparse_matrix = fd.triplet.to_scipy_sparse()
124
+
125
+ This would produce the following figure:
126
+
127
+ |example_triplet_0|
128
+
129
+ This example demonstrates the creation of a second-order finite-difference matrix with a specified grid spacing and size.
130
+
131
+ Testing
132
+ *******
133
+
134
+ To test PyFinitDiff locally, clone the GitHub repository and run the tests with coverage:
135
+
136
+ .. code-block:: bash
137
+
138
+ git clone https://github.com/MartinPdeS/PyFinitDiff.git
139
+ cd PyFinitDiff
140
+ pip install PyFinitDiff[testing]
141
+ pytest
142
+
143
+ Contributing
144
+ ************
145
+
146
+ 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.
147
+
148
+ Contact Information
149
+ ********************
150
+ 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.
151
+
152
+ PyMieSim was written by `Martin Poinsinet de Sivry-Houle <https://github.com/MartinPdS>`_ .
153
+
154
+ Email:`martin.poinsinet.de.sivry@gmail.ca <mailto:martin.poinsinet.de.sivry@gmail.ca?subject=PyFinitDiff>`_ .
155
+
156
+
157
+ .. |python| image:: https://img.shields.io/pypi/pyversions/pyfinitdiff.svg
158
+ :target: https://www.python.org/
159
+
160
+ .. |example_triplet_0| image:: https://github.com/MartinPdeS/PyFinitDiff/blob/master/docs/images/triplet_example_0.png
161
+ :target: https://www.python.org/
162
+
163
+ .. |docs| image:: https://readthedocs.org/projects/pyfinitdiff/badge/?version=latest
164
+ :target: https://pyfinitdiff.readthedocs.io/en/latest/
165
+ :alt: Documentation Status
166
+
167
+ .. |coverage| image:: https://raw.githubusercontent.com/MartinPdeS/PyFinitDiff/python-coverage-comment-action-data/badge.svg
168
+ :alt: Unittest coverage
169
+ :target: https://htmlpreview.github.io/?https://github.com/MartinPdeS/PyFinitDiff/blob/python-coverage-comment-action-data/htmlcov/index.html
170
+
171
+ .. |PyPi| image:: https://badge.fury.io/py/PyFinitDiff.svg
172
+ :target: https://pypi.org/project/PyFinitDiff/
173
+
174
+ .. |PyPi_download| image:: https://img.shields.io/pypi/dm/pyfinitdiff.svg
175
+ :target: https://pypistats.org/packages/pyfinitdiff
@@ -12,5 +12,5 @@ __version__: str
12
12
  __version_tuple__: VERSION_TUPLE
13
13
  version_tuple: VERSION_TUPLE
14
14
 
15
- __version__ = version = '1.3.1.post0'
16
- __version_tuple__ = version_tuple = (1, 3, 1)
15
+ __version__ = version = '2.0.1.post0'
16
+ __version_tuple__ = version_tuple = (2, 0, 1)
@@ -12,7 +12,7 @@ config_dict = ConfigDict(
12
12
  strict=True,
13
13
  arbitrary_types_allowed=True,
14
14
  kw_only=True,
15
- frozen=True
15
+ frozen=False
16
16
  )
17
17
 
18
18
 
@@ -7,7 +7,6 @@ from dataclasses import dataclass, field
7
7
  # Local imports
8
8
  import numpy
9
9
  from PyFinitDiff.triplet import Triplet
10
- from PyFinitDiff.finite_difference_1D.utils import MeshInfo
11
10
  from PyFinitDiff.finite_difference_1D.boundaries import Boundary
12
11
 
13
12
 
@@ -16,7 +16,7 @@ config_dict = ConfigDict(
16
16
  strict=True,
17
17
  arbitrary_types_allowed=True,
18
18
  kw_only=True,
19
- frozen=True
19
+ frozen=False
20
20
  )
21
21
 
22
22
 
@@ -11,7 +11,7 @@ config_dict = ConfigDict(
11
11
  strict=True,
12
12
  arbitrary_types_allowed=True,
13
13
  kw_only=True,
14
- frozen=True
14
+ frozen=False
15
15
  )
16
16
 
17
17
 
@@ -9,7 +9,6 @@ def get_array_derivative(
9
9
  array: np.ndarray,
10
10
  derivative: int,
11
11
  accuracy: int = 4,
12
- coefficient_type: str = 'central',
13
12
  dx: float = 1,
14
13
  dy: float = 1,
15
14
  x_derivative: bool = True,
@@ -22,7 +21,6 @@ def get_array_derivative(
22
21
  array (np.ndarray): The array for which to compute the nth derivative.
23
22
  derivative (int): The order of the derivative.
24
23
  accuracy (int, optional): The accuracy for the derivative. Defaults to 4.
25
- coefficient_type (str, optional): The coefficient type. Defaults to 'central'.
26
24
  dx (float, optional): The delta value in the x direction. Defaults to 1.
27
25
  dy (float, optional): The delta value in the y direction. Defaults to 1.
28
26
  x_derivative (bool, optional): Whether to compute the x derivative. Defaults to True.
@@ -18,7 +18,7 @@ config_dict = ConfigDict(
18
18
  extra='forbid',
19
19
  strict=True,
20
20
  kw_only=True,
21
- frozen=True,
21
+ frozen=False,
22
22
  arbitrary_types_allowed=True
23
23
  )
24
24
 
@@ -17,7 +17,7 @@ config_dict = ConfigDict(
17
17
  strict=True,
18
18
  arbitrary_types_allowed=True,
19
19
  kw_only=True,
20
- frozen=True
20
+ frozen=False
21
21
  )
22
22
 
23
23
 
@@ -0,0 +1,221 @@
1
+ #!/usr/bin/env python
2
+ # -*- coding: utf-8 -*-
3
+
4
+ from typing import NoReturn, Tuple, Union
5
+ import numpy
6
+ from scipy.sparse import coo_matrix
7
+ from dataclasses import dataclass
8
+ import matplotlib.pyplot as plt
9
+
10
+
11
+ @dataclass
12
+ class Triplet:
13
+ shape: Tuple[int, int]
14
+ array: numpy.ndarray
15
+ add_extra_column: bool = False
16
+
17
+ def __post_init__(self):
18
+ """
19
+ Post-initialization to ensure the correct shape of the input array and to handle optional
20
+ addition of an extra column to the array.
21
+ """
22
+ self.array = numpy.atleast_2d(self.array)
23
+ self.shape = numpy.asarray(self.shape)
24
+
25
+ if self.add_extra_column:
26
+ self.array = numpy.c_[self.array, numpy.ones(self.array.shape[0])]
27
+
28
+ if self.array.shape[1] != 3:
29
+ raise ValueError("Array must have exactly 3 columns.")
30
+
31
+ @property
32
+ def index(self) -> numpy.ndarray:
33
+ """Return the first two columns of the array, representing the indices."""
34
+ return self.array[:, :2].astype(int)
35
+
36
+ @property
37
+ def rows(self) -> numpy.ndarray:
38
+ """Return the row indices (first column)."""
39
+ return self.array[:, 0].astype(int)
40
+
41
+ @property
42
+ def columns(self) -> numpy.ndarray:
43
+ """Return the column indices (second column)."""
44
+ return self.array[:, 1].astype(int)
45
+
46
+ @property
47
+ def values(self) -> numpy.ndarray:
48
+ """Return the values (third column)."""
49
+ return self.array[:, 2]
50
+
51
+ @values.setter
52
+ def values(self, value: Union[float, numpy.ndarray]) -> None:
53
+ """Set the values in the array."""
54
+ self.array[:, 2] = value
55
+
56
+ @property
57
+ def size(self) -> int:
58
+ """Return the number of entries in the triplet."""
59
+ return self.array.shape[0]
60
+
61
+ def remove_below_i(self, i_value: int) -> 'Triplet':
62
+ """Remove all entries with row indices below i_value."""
63
+ self.array = self.array[self.rows > i_value]
64
+ return self
65
+
66
+ def remove_above_i(self, i_value: int) -> 'Triplet':
67
+ """Remove all entries with row indices above i_value."""
68
+ self.array = self.array[self.rows < i_value]
69
+ return self
70
+
71
+ def remove_below_j(self, j_value: int) -> 'Triplet':
72
+ """Remove all entries with column indices below j_value."""
73
+ self.array = self.array[self.columns > j_value]
74
+ return self
75
+
76
+ def remove_above_j(self, j_value: int) -> 'Triplet':
77
+ """Remove all entries with column indices above j_value."""
78
+ self.array = self.array[self.columns < j_value]
79
+ return self
80
+
81
+ def delete(self, index: numpy.ndarray) -> None:
82
+ """Delete entries at the given indices."""
83
+ self.array = numpy.delete(self.array, index.astype(int), axis=0)
84
+
85
+ def append(self, other: 'Triplet') -> None:
86
+ """Append another triplet to this one."""
87
+ self.array = numpy.r_[self.array, other.array]
88
+
89
+ def append_array(self, array: numpy.ndarray) -> None:
90
+ """Append a NumPy array to this triplet."""
91
+ self.array = numpy.r_[self.array, array]
92
+
93
+ def __add__(self, other: 'Triplet') -> 'Triplet':
94
+ """Concatenate two triplets and merge any duplicate indices."""
95
+ combined_array = numpy.r_[self.array, other.array]
96
+ return Triplet(array=combined_array, shape=self.shape).remove_duplicate()
97
+
98
+ def __mul__(self, factor: float) -> 'Triplet':
99
+ """Multiply all values in the triplet by a factor."""
100
+ return Triplet(array=self.array * [1, 1, factor], shape=self.shape)
101
+
102
+ __rmul__ = __mul__
103
+
104
+ def remove_duplicate(self) -> 'Triplet':
105
+ """Remove duplicate entries by summing their values."""
106
+ new_array = self.array
107
+ index_to_delete = []
108
+ duplicate = self.get_duplicate_index()
109
+
110
+ if duplicate.size == 0:
111
+ return Triplet(array=self.array, shape=self.shape)
112
+
113
+ for duplicate in duplicate:
114
+ index_to_keep = duplicate[0]
115
+ for index_to_merge in duplicate[1:]:
116
+ index_to_delete.append(index_to_merge)
117
+ new_array[index_to_keep, 2] += new_array[index_to_merge, 2]
118
+
119
+ triplet_array = numpy.delete(new_array, index_to_delete, axis=0)
120
+
121
+ return Triplet(array=triplet_array, shape=self.shape)
122
+
123
+ def coincide_i(self, mask: 'Triplet') -> None:
124
+ """Remove entries whose row indices do not coincide with those in the mask."""
125
+ mask_i_unique = numpy.unique(mask.rows[mask.values != 0])
126
+ self.array = numpy.vstack([self.array[self.rows == i] for i in mask_i_unique])
127
+
128
+ def __sub__(self, other: 'Triplet') -> 'Triplet':
129
+ """Subtract another triplet by removing matching row indices."""
130
+ non_matching_indices = ~numpy.isin(self.rows, other.rows)
131
+ return Triplet(array=self.array[non_matching_indices], shape=self.shape)
132
+
133
+ def __iter__(self):
134
+ """Iterator to yield the indices and values as tuples."""
135
+ return iter((int(i), int(j), value) for i, j, value in self.array)
136
+
137
+ def enumerate(self, start: int = 0, stop: int = None):
138
+ """Enumerate over the entries, yielding an index and the entry values."""
139
+ for idx, (i, j, value) in enumerate(self.array[start:stop], start=start):
140
+ yield idx, (int(i), int(j), value)
141
+
142
+ def merge_duplicate(self) -> None:
143
+ """Merge duplicate entries by summing their values."""
144
+ duplicates = self.get_duplicate_index()
145
+ if duplicates.size == 0:
146
+ return
147
+ for duplicate in duplicates:
148
+ first_idx = duplicate[0]
149
+ self.array[first_idx, 2] = self.array[duplicate, 2].sum()
150
+ self.delete(duplicate[1:])
151
+
152
+ def get_duplicate_index(self) -> numpy.ndarray:
153
+ """Get indices of duplicate entries."""
154
+ unique_indices, inverse_indices, counts = numpy.unique(self.index, axis=0, return_inverse=True, return_counts=True)
155
+ duplicate_indices = numpy.where(counts > 1)[0]
156
+ return numpy.array([numpy.where(inverse_indices == idx)[0] for idx in duplicate_indices], dtype=object)
157
+
158
+ @property
159
+ def max_i(self) -> int:
160
+ """Return the maximum row index."""
161
+ return self.rows.max()
162
+
163
+ @property
164
+ def max_j(self) -> int:
165
+ """Return the maximum column index."""
166
+ return self.columns.max()
167
+
168
+ @property
169
+ def min_i(self) -> int:
170
+ """Return the minimum row index."""
171
+ return self.rows.min()
172
+
173
+ @property
174
+ def min_j(self) -> int:
175
+ """Return the minimum column index."""
176
+ return self.columns.min()
177
+
178
+ @property
179
+ def diagonal(self) -> numpy.ndarray:
180
+ """Return the diagonal elements of the triplet."""
181
+ return self.array[self.rows == self.columns]
182
+
183
+ def shift_diagonal(self, value: float) -> 'Triplet':
184
+ """Shift the diagonal elements by a specified value."""
185
+ diagonal_triplet = DiagonalTriplet(numpy.ones(min(self.max_i, self.max_j)) * value, shape=self.shape)
186
+ return self + diagonal_triplet
187
+
188
+ def update_elements(self, other_triplet: 'Triplet', i_range: slice) -> 'Triplet':
189
+ """Update elements within a specified range."""
190
+ self.array[i_range, :] = other_triplet.array[i_range, :]
191
+ return self
192
+
193
+ def to_dense(self) -> numpy.ndarray:
194
+ """Convert the triplet to a dense matrix representation."""
195
+ return self.to_scipy_sparse().toarray()
196
+
197
+ def plot(self) -> NoReturn:
198
+ """Plot the dense matrix representation of the triplet."""
199
+ plt.figure()
200
+ plt.title('Finite-difference coefficients structure')
201
+ plt.xlabel('Columns')
202
+ plt.ylabel('Rows')
203
+
204
+ dense_matrix = numpy.flip(self.to_dense(), axis=0)
205
+ plt.pcolormesh(dense_matrix, cmap='Blues')
206
+ plt.gca().set_aspect('equal')
207
+ plt.grid(True)
208
+ plt.colorbar()
209
+ plt.show()
210
+
211
+ def to_scipy_sparse(self) -> coo_matrix:
212
+ """Convert the triplet to a SciPy sparse matrix."""
213
+ return coo_matrix((self.values, (self.rows, self.columns)), shape=(numpy.prod(self.shape),) * 2)
214
+
215
+
216
+ class DiagonalTriplet(Triplet):
217
+ def __init__(self, mesh: numpy.ndarray, shape: Tuple[int, int]):
218
+ size = mesh.size
219
+ triplet_array = numpy.column_stack((numpy.arange(size), numpy.arange(size), mesh.ravel()))
220
+ super().__init__(array=triplet_array, shape=shape)
221
+