PyFishPack 0.1.0__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 (78) hide show
  1. pyfishpack-0.1.0/LICENSE +21 -0
  2. pyfishpack-0.1.0/PKG-INFO +81 -0
  3. pyfishpack-0.1.0/PyFishPack/__init__.py +74 -0
  4. pyfishpack-0.1.0/PyFishPack/_dummy.c +23 -0
  5. pyfishpack-0.1.0/PyFishPack/apps.py +3640 -0
  6. pyfishpack-0.1.0/PyFishPack/meson.build +213 -0
  7. pyfishpack-0.1.0/PyFishPack/src/archive/f77/Makefile +19 -0
  8. pyfishpack-0.1.0/PyFishPack/src/archive/f77/blktri.f +1404 -0
  9. pyfishpack-0.1.0/PyFishPack/src/archive/f77/cblktri.f +1414 -0
  10. pyfishpack-0.1.0/PyFishPack/src/archive/f77/cmgnbn.f +1592 -0
  11. pyfishpack-0.1.0/PyFishPack/src/archive/f77/comf.f +186 -0
  12. pyfishpack-0.1.0/PyFishPack/src/archive/f77/fftpack.f +2968 -0
  13. pyfishpack-0.1.0/PyFishPack/src/archive/f77/genbun.f +1335 -0
  14. pyfishpack-0.1.0/PyFishPack/src/archive/f77/gnbnaux.f +314 -0
  15. pyfishpack-0.1.0/PyFishPack/src/archive/f77/hstcrt.f +443 -0
  16. pyfishpack-0.1.0/PyFishPack/src/archive/f77/hstcsp.f +683 -0
  17. pyfishpack-0.1.0/PyFishPack/src/archive/f77/hstcyl.f +485 -0
  18. pyfishpack-0.1.0/PyFishPack/src/archive/f77/hstplr.f +538 -0
  19. pyfishpack-0.1.0/PyFishPack/src/archive/f77/hstssp.f +634 -0
  20. pyfishpack-0.1.0/PyFishPack/src/archive/f77/hw3crt.f +687 -0
  21. pyfishpack-0.1.0/PyFishPack/src/archive/f77/hwscrt.f +512 -0
  22. pyfishpack-0.1.0/PyFishPack/src/archive/f77/hwscsp.f +728 -0
  23. pyfishpack-0.1.0/PyFishPack/src/archive/f77/hwscyl.f +538 -0
  24. pyfishpack-0.1.0/PyFishPack/src/archive/f77/hwsplr.f +602 -0
  25. pyfishpack-0.1.0/PyFishPack/src/archive/f77/hwsssp.f +780 -0
  26. pyfishpack-0.1.0/PyFishPack/src/archive/f77/pois3d.f +550 -0
  27. pyfishpack-0.1.0/PyFishPack/src/archive/f77/poistg.f +875 -0
  28. pyfishpack-0.1.0/PyFishPack/src/archive/f77/sepaux.f +361 -0
  29. pyfishpack-0.1.0/PyFishPack/src/archive/f77/sepeli.f +1029 -0
  30. pyfishpack-0.1.0/PyFishPack/src/archive/f77/sepx4.f +958 -0
  31. pyfishpack-0.1.0/PyFishPack/src/centered_axisymmetric_spherical_solver.f90 +1002 -0
  32. pyfishpack-0.1.0/PyFishPack/src/centered_cartesian_helmholtz_solver_3d.f90 +819 -0
  33. pyfishpack-0.1.0/PyFishPack/src/centered_cartesian_solver.f90 +583 -0
  34. pyfishpack-0.1.0/PyFishPack/src/centered_cylindrical_solver.f90 +634 -0
  35. pyfishpack-0.1.0/PyFishPack/src/centered_helmholtz_solvers.f90 +156 -0
  36. pyfishpack-0.1.0/PyFishPack/src/centered_polar_solver.f90 +746 -0
  37. pyfishpack-0.1.0/PyFishPack/src/centered_real_linear_systems_solver.f90 +280 -0
  38. pyfishpack-0.1.0/PyFishPack/src/centered_spherical_solver.f90 +928 -0
  39. pyfishpack-0.1.0/PyFishPack/src/complex_block_tridiagonal_linear_systems_solver.f90 +1947 -0
  40. pyfishpack-0.1.0/PyFishPack/src/complex_linear_systems_solver.f90 +1787 -0
  41. pyfishpack-0.1.0/PyFishPack/src/fftpack_c_api.f90 +86 -0
  42. pyfishpack-0.1.0/PyFishPack/src/fishpack.f90 +191 -0
  43. pyfishpack-0.1.0/PyFishPack/src/fishpack.pyf +504 -0
  44. pyfishpack-0.1.0/PyFishPack/src/fishpack_c_api.f90 +365 -0
  45. pyfishpack-0.1.0/PyFishPack/src/fishpack_original.pyf +2119 -0
  46. pyfishpack-0.1.0/PyFishPack/src/fishpack_precision.f90 +53 -0
  47. pyfishpack-0.1.0/PyFishPack/src/general_linear_systems_solver_3d.f90 +296 -0
  48. pyfishpack-0.1.0/PyFishPack/src/iterative_solvers.f90 +969 -0
  49. pyfishpack-0.1.0/PyFishPack/src/main.f90 +10 -0
  50. pyfishpack-0.1.0/PyFishPack/src/pyfishpack_module.c +1302 -0
  51. pyfishpack-0.1.0/PyFishPack/src/real_block_tridiagonal_linear_systems_solver.f90 +319 -0
  52. pyfishpack-0.1.0/PyFishPack/src/sepeli.f90 +1454 -0
  53. pyfishpack-0.1.0/PyFishPack/src/sepx4.f90 +1338 -0
  54. pyfishpack-0.1.0/PyFishPack/src/staggered_axisymmetric_spherical_solver.f90 +908 -0
  55. pyfishpack-0.1.0/PyFishPack/src/staggered_cartesian_solver.f90 +553 -0
  56. pyfishpack-0.1.0/PyFishPack/src/staggered_cylindrical_solver.f90 +630 -0
  57. pyfishpack-0.1.0/PyFishPack/src/staggered_helmholtz_solvers.f90 +172 -0
  58. pyfishpack-0.1.0/PyFishPack/src/staggered_polar_solver.f90 +651 -0
  59. pyfishpack-0.1.0/PyFishPack/src/staggered_real_linear_systems_solver.f90 +258 -0
  60. pyfishpack-0.1.0/PyFishPack/src/staggered_spherical_solver.f90 +758 -0
  61. pyfishpack-0.1.0/PyFishPack/src/three_dimensional_solvers.f90 +602 -0
  62. pyfishpack-0.1.0/PyFishPack/src/type_CenteredCyclicReductionUtility.f90 +1714 -0
  63. pyfishpack-0.1.0/PyFishPack/src/type_CyclicReductionUtility.f90 +472 -0
  64. pyfishpack-0.1.0/PyFishPack/src/type_FishpackWorkspace.f90 +290 -0
  65. pyfishpack-0.1.0/PyFishPack/src/type_GeneralizedCyclicReductionUtility.f90 +1980 -0
  66. pyfishpack-0.1.0/PyFishPack/src/type_PeriodicFastFourierTransform.f90 +3789 -0
  67. pyfishpack-0.1.0/PyFishPack/src/type_SepAux.f90 +586 -0
  68. pyfishpack-0.1.0/PyFishPack/src/type_StaggeredCyclicReductionUtility.f90 +893 -0
  69. pyfishpack-0.1.0/PyFishPack.egg-info/PKG-INFO +81 -0
  70. pyfishpack-0.1.0/PyFishPack.egg-info/SOURCES.txt +76 -0
  71. pyfishpack-0.1.0/PyFishPack.egg-info/dependency_links.txt +1 -0
  72. pyfishpack-0.1.0/PyFishPack.egg-info/not-zip-safe +1 -0
  73. pyfishpack-0.1.0/PyFishPack.egg-info/requires.txt +14 -0
  74. pyfishpack-0.1.0/PyFishPack.egg-info/top_level.txt +1 -0
  75. pyfishpack-0.1.0/README.md +37 -0
  76. pyfishpack-0.1.0/pyproject.toml +189 -0
  77. pyfishpack-0.1.0/setup.cfg +4 -0
  78. pyfishpack-0.1.0/setup.py +402 -0
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Qianye Su
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,81 @@
1
+ Metadata-Version: 2.4
2
+ Name: PyFishPack
3
+ Version: 0.1.0
4
+ Summary: Python wrapper for FISHPACK - Fast direct solvers for separable elliptic PDEs
5
+ Home-page: https://github.com/QianyeSu/PyFishPack
6
+ Author: PyFishPack Contributors
7
+ Author-email: your.email@example.com
8
+ License-Expression: MIT
9
+ Project-URL: Homepage, https://github.com/QianyeSu/PyFishPack
10
+ Project-URL: Repository, https://github.com/QianyeSu/PyFishPack
11
+ Project-URL: Bug Tracker, https://github.com/QianyeSu/PyFishPack/issues
12
+ Keywords: numerical-analysis,pde-solver,elliptic-equations,scientific-computing,fishpack,fortran
13
+ Classifier: Development Status :: 4 - Beta
14
+ Classifier: Intended Audience :: Science/Research
15
+ Classifier: Topic :: Scientific/Engineering :: Mathematics
16
+ Classifier: Topic :: Scientific/Engineering :: Physics
17
+ Classifier: Programming Language :: Python :: 3
18
+ Classifier: Programming Language :: Python :: 3.9
19
+ Classifier: Programming Language :: Python :: 3.10
20
+ Classifier: Programming Language :: Python :: 3.11
21
+ Classifier: Programming Language :: Python :: 3.12
22
+ Classifier: Programming Language :: Python :: 3.13
23
+ Classifier: Programming Language :: Fortran
24
+ Classifier: Operating System :: OS Independent
25
+ Requires-Python: >=3.8
26
+ Description-Content-Type: text/markdown
27
+ License-File: LICENSE
28
+ Requires-Dist: numpy>=1.24.0
29
+ Provides-Extra: dev
30
+ Requires-Dist: pytest; extra == "dev"
31
+ Requires-Dist: pytest-cov; extra == "dev"
32
+ Requires-Dist: black; extra == "dev"
33
+ Requires-Dist: isort; extra == "dev"
34
+ Requires-Dist: flake8; extra == "dev"
35
+ Provides-Extra: build
36
+ Requires-Dist: meson; extra == "build"
37
+ Requires-Dist: ninja; extra == "build"
38
+ Requires-Dist: build; extra == "build"
39
+ Requires-Dist: wheel; extra == "build"
40
+ Dynamic: author-email
41
+ Dynamic: home-page
42
+ Dynamic: license-file
43
+ Dynamic: requires-python
44
+
45
+ # PyFishPack
46
+
47
+ PyFishPack is a modernized Python-facing Fortran solver package derived from NCAR FISHPACK.
48
+
49
+ Project links:
50
+
51
+ - Homepage: https://github.com/QianyeSu/PyFishPack
52
+ - Repository: https://github.com/QianyeSu/PyFishPack
53
+ - Bug Tracker: https://github.com/QianyeSu/PyFishPack/issues
54
+
55
+ ## Source layout
56
+
57
+ - Modern Fortran `.f90` sources live under `PyFishPack/src`.
58
+ - Original F77 `.f` sources are kept as archive material under `PyFishPack/src/archive/f77`.
59
+ - The backend uses modern Fortran `bind(C)` entry points plus a thin NumPy C API wrapper.
60
+
61
+ ## Build
62
+
63
+ Use the `skyborn_dev` conda environment with Meson and Ninja.
64
+
65
+ ```bash
66
+ conda activate skyborn_dev
67
+ meson setup build
68
+ ninja -C build
69
+ ```
70
+
71
+ ## Public APIs
72
+
73
+ PyFishPack exposes xinvert-style equation helpers from `PyFishPack.apps`, including:
74
+
75
+ `invert_Poisson`, `invert_geostrophic`, `invert_PV2D`, `invert_Eliassen`, `invert_Fofonoff`, `invert_GillMatsuno`, `invert_GillMatsuno_test`, `invert_BrethertonHaidvogel`, `invert_Stommel`, `invert_StommelMunk`, `invert_Stommel_test`, `invert_StommelArons`, `invert_omega`, `invert_3DOcean`, `invert_RefState`, `invert_RefStateSWM`, `invert_MultiGrid`.
76
+
77
+ The compiled `fishpack` backend also exposes direct solver and transform entry points for the modern Fortran kernels, including the `genbun`, `poistg`, `pois3d`, Helmholtz, SOR, and FFTPACK interfaces.
78
+
79
+ ## Verification
80
+
81
+ The current backend verification covers the exposed equation APIs, source-layout checks, a local xinvert benchmark, and backend import checks. The modern backend reports `modern-fortran` through `fishpack.backend_info()`.
@@ -0,0 +1,74 @@
1
+ """
2
+ PyFishPack - Python wrapper for FISHPACK Fortran library
3
+
4
+ FISHPACK is a collection of Fortran routines for solving separable
5
+ elliptic partial differential equations.
6
+ """
7
+
8
+ __version__ = "0.1.0"
9
+
10
+ try:
11
+ # Import the compiled fishpack extension
12
+ from . import fishpack
13
+ from .apps import (
14
+ invert_3DOcean,
15
+ invert_BrethertonHaidvogel,
16
+ invert_Eliassen,
17
+ invert_Fofonoff,
18
+ invert_GillMatsuno,
19
+ invert_GillMatsuno_test,
20
+ invert_MultiGrid,
21
+ invert_PV2D,
22
+ invert_Poisson,
23
+ invert_RefState,
24
+ invert_RefStateSWM,
25
+ invert_Stommel,
26
+ invert_StommelArons,
27
+ invert_StommelMunk,
28
+ invert_Stommel_test,
29
+ invert_geostrophic,
30
+ invert_omega,
31
+ spectral_transform,
32
+ )
33
+
34
+ # Make commonly used functions available at package level
35
+ # These will be available as PyFishPack.genbun, etc.
36
+ from .fishpack import *
37
+
38
+ __all__ = [name for name in dir(fishpack) if not name.startswith('_')]
39
+ __all__.extend([
40
+ "invert_3DOcean",
41
+ "invert_BrethertonHaidvogel",
42
+ "invert_Eliassen",
43
+ "invert_Fofonoff",
44
+ "invert_GillMatsuno",
45
+ "invert_GillMatsuno_test",
46
+ "invert_MultiGrid",
47
+ "invert_PV2D",
48
+ "invert_Poisson",
49
+ "invert_RefState",
50
+ "invert_RefStateSWM",
51
+ "invert_Stommel",
52
+ "invert_StommelArons",
53
+ "invert_StommelMunk",
54
+ "invert_Stommel_test",
55
+ "invert_geostrophic",
56
+ "invert_omega",
57
+ "spectral_transform",
58
+ ])
59
+
60
+ except ImportError as e:
61
+ import warnings
62
+ print(f"Warning: Could not import fishpack extension: {e}")
63
+ print("Make sure the extension is compiled correctly.")
64
+ warnings.warn(f"Could not import fishpack extension: {e}. "
65
+ f"Make sure the extension is compiled correctly.",
66
+ ImportWarning)
67
+
68
+ # Fallback - define empty __all__
69
+ __all__ = []
70
+
71
+ # Package metadata
72
+ __author__ = "Qianye Su"
73
+ __email__ = "suqianye2000@gmail.com"
74
+ __url__ = "https://github.com/QianyeSu/PyFishPack"
@@ -0,0 +1,23 @@
1
+ /* Dummy C extension for Windows compatibility */
2
+ #include <Python.h>
3
+
4
+ static PyObject* dummy_function(PyObject* self, PyObject* args) {
5
+ return Py_None;
6
+ }
7
+
8
+ static PyMethodDef DummyMethods[] = {
9
+ {"dummy", dummy_function, METH_VARARGS, "Dummy function"},
10
+ {NULL, NULL, 0, NULL}
11
+ };
12
+
13
+ static struct PyModuleDef dummymodule = {
14
+ PyModuleDef_HEAD_INIT,
15
+ "_dummy",
16
+ NULL,
17
+ -1,
18
+ DummyMethods
19
+ };
20
+
21
+ PyMODINIT_FUNC PyInit__dummy(void) {
22
+ return PyModule_Create(&dummymodule);
23
+ }