numgrids 0.3.0__tar.gz → 0.5.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 (58) hide show
  1. {numgrids-0.3.0 → numgrids-0.5.0}/LICENSE +1 -1
  2. numgrids-0.5.0/PKG-INFO +113 -0
  3. numgrids-0.5.0/README.md +191 -0
  4. numgrids-0.5.0/docs/pypi_description.md +56 -0
  5. numgrids-0.5.0/numgrids/__init__.py +125 -0
  6. numgrids-0.5.0/numgrids/amr.py +389 -0
  7. numgrids-0.5.0/numgrids/api.py +365 -0
  8. numgrids-0.5.0/numgrids/axes.py +494 -0
  9. numgrids-0.5.0/numgrids/boundary.py +627 -0
  10. numgrids-0.5.0/numgrids/convergence.py +143 -0
  11. numgrids-0.5.0/numgrids/curvilinear.py +760 -0
  12. numgrids-0.5.0/numgrids/diff.py +360 -0
  13. numgrids-0.5.0/numgrids/evolution.py +195 -0
  14. numgrids-0.5.0/numgrids/grids.py +697 -0
  15. numgrids-0.5.0/numgrids/integration.py +90 -0
  16. numgrids-0.5.0/numgrids/interpol.py +286 -0
  17. numgrids-0.5.0/numgrids/io.py +348 -0
  18. numgrids-0.5.0/numgrids/operators.py +425 -0
  19. numgrids-0.5.0/numgrids/plots.py +210 -0
  20. numgrids-0.5.0/numgrids/py.typed +0 -0
  21. numgrids-0.5.0/numgrids/utils.py +92 -0
  22. numgrids-0.5.0/numgrids.egg-info/PKG-INFO +113 -0
  23. numgrids-0.5.0/numgrids.egg-info/SOURCES.txt +41 -0
  24. numgrids-0.5.0/numgrids.egg-info/requires.txt +32 -0
  25. numgrids-0.5.0/pyproject.toml +99 -0
  26. numgrids-0.5.0/tests/test_amr.py +308 -0
  27. numgrids-0.5.0/tests/test_api.py +1143 -0
  28. numgrids-0.5.0/tests/test_axes.py +144 -0
  29. numgrids-0.5.0/tests/test_boundary.py +447 -0
  30. numgrids-0.5.0/tests/test_curvilinear.py +491 -0
  31. numgrids-0.5.0/tests/test_diff.py +623 -0
  32. numgrids-0.5.0/tests/test_features.py +476 -0
  33. numgrids-0.5.0/tests/test_grids.py +535 -0
  34. numgrids-0.5.0/tests/test_integration.py +94 -0
  35. numgrids-0.5.0/tests/test_interpol.py +106 -0
  36. numgrids-0.5.0/tests/test_io.py +220 -0
  37. numgrids-0.5.0/tests/test_operators.py +271 -0
  38. numgrids-0.5.0/tests/test_plots.py +21 -0
  39. numgrids-0.5.0/tests/test_regressions.py +143 -0
  40. numgrids-0.5.0/tests/test_usability.py +216 -0
  41. numgrids-0.3.0/PKG-INFO +0 -37
  42. numgrids-0.3.0/README.md +0 -178
  43. numgrids-0.3.0/numgrids/__init__.py +0 -6
  44. numgrids-0.3.0/numgrids/api.py +0 -167
  45. numgrids-0.3.0/numgrids/axes.py +0 -205
  46. numgrids-0.3.0/numgrids/diff.py +0 -165
  47. numgrids-0.3.0/numgrids/grids.py +0 -275
  48. numgrids-0.3.0/numgrids/integration.py +0 -69
  49. numgrids-0.3.0/numgrids/interpol.py +0 -66
  50. numgrids-0.3.0/numgrids/plots.py +0 -44
  51. numgrids-0.3.0/numgrids/utils.py +0 -8
  52. numgrids-0.3.0/numgrids.egg-info/PKG-INFO +0 -37
  53. numgrids-0.3.0/numgrids.egg-info/SOURCES.txt +0 -17
  54. numgrids-0.3.0/numgrids.egg-info/requires.txt +0 -4
  55. numgrids-0.3.0/setup.py +0 -42
  56. {numgrids-0.3.0 → numgrids-0.5.0}/numgrids.egg-info/dependency_links.txt +0 -0
  57. {numgrids-0.3.0 → numgrids-0.5.0}/numgrids.egg-info/top_level.txt +0 -0
  58. {numgrids-0.3.0 → numgrids-0.5.0}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) [year] [fullname]
3
+ Copyright (c) 2023 Matthias Baer
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -0,0 +1,113 @@
1
+ Metadata-Version: 2.4
2
+ Name: numgrids
3
+ Version: 0.5.0
4
+ Summary: Working with numerical grids made easy.
5
+ Author-email: Matthias Baer <matthias.r.baer@googlemail.com>
6
+ License: MIT
7
+ Project-URL: Homepage, https://github.com/maroba/numgrids
8
+ Project-URL: Documentation, https://maroba.github.io/numgrids/
9
+ Project-URL: Repository, https://github.com/maroba/numgrids
10
+ Project-URL: Issues, https://github.com/maroba/numgrids/issues
11
+ Project-URL: Changelog, https://maroba.github.io/numgrids/dev/changelog.html
12
+ Keywords: numerical grids,spectral methods,finite differences,chebyshev,pde,differential equations,curvilinear coordinates,scientific computing
13
+ Classifier: Development Status :: 4 - Beta
14
+ Classifier: Intended Audience :: Science/Research
15
+ Classifier: Intended Audience :: Education
16
+ Classifier: License :: OSI Approved :: MIT License
17
+ Classifier: Operating System :: OS Independent
18
+ Classifier: Programming Language :: Python :: 3
19
+ Classifier: Programming Language :: Python :: 3 :: Only
20
+ Classifier: Programming Language :: Python :: 3.10
21
+ Classifier: Programming Language :: Python :: 3.11
22
+ Classifier: Programming Language :: Python :: 3.12
23
+ Classifier: Programming Language :: Python :: 3.13
24
+ Classifier: Topic :: Scientific/Engineering :: Mathematics
25
+ Classifier: Topic :: Scientific/Engineering :: Physics
26
+ Classifier: Typing :: Typed
27
+ Requires-Python: >=3.10
28
+ Description-Content-Type: text/markdown
29
+ License-File: LICENSE
30
+ Requires-Dist: numpy>=1.22
31
+ Requires-Dist: scipy>=1.10.1
32
+ Requires-Dist: findiff>=0.10
33
+ Provides-Extra: plot
34
+ Requires-Dist: matplotlib>=3.5; extra == "plot"
35
+ Provides-Extra: xarray
36
+ Requires-Dist: xarray>=2023.1; extra == "xarray"
37
+ Provides-Extra: all
38
+ Requires-Dist: numgrids[plot,xarray]; extra == "all"
39
+ Provides-Extra: test
40
+ Requires-Dist: numgrids[all]; extra == "test"
41
+ Requires-Dist: pytest>=7; extra == "test"
42
+ Requires-Dist: pytest-cov; extra == "test"
43
+ Requires-Dist: netCDF4; extra == "test"
44
+ Provides-Extra: docs
45
+ Requires-Dist: numgrids[all]; extra == "docs"
46
+ Requires-Dist: sphinx; extra == "docs"
47
+ Requires-Dist: furo; extra == "docs"
48
+ Requires-Dist: sphinx-design; extra == "docs"
49
+ Requires-Dist: myst-parser; extra == "docs"
50
+ Requires-Dist: nbsphinx; extra == "docs"
51
+ Requires-Dist: ipython; extra == "docs"
52
+ Requires-Dist: ipykernel; extra == "docs"
53
+ Provides-Extra: dev
54
+ Requires-Dist: numgrids[docs,test]; extra == "dev"
55
+ Requires-Dist: ruff; extra == "dev"
56
+ Dynamic: license-file
57
+
58
+ <h1 align="center">numgrids</h1>
59
+ <p align="center"> Working with numerical grids made easy.</p>
60
+
61
+ Setting up numerical grids, differentiation matrices, and coordinate
62
+ transformations by hand is tedious and error-prone.
63
+ *numgrids* gives you a high-level, NumPy-friendly API that handles all of
64
+ this — so you can focus on the physics or mathematics of your problem instead
65
+ of bookkeeping grid indices and scale factors.
66
+
67
+ **Main Features**
68
+
69
+ - Numerical grids in any dimension from **equidistant**, **Chebyshev**, **logarithmic**, and **periodic** axes
70
+ - High-precision **spectral methods** (FFT + Chebyshev) selected automatically where possible
71
+ - Differentiation, integration (Clenshaw–Curtis, trapezoidal), and interpolation (spline or spectral)
72
+ - **Curvilinear coordinates**: spherical, cylindrical, polar, elliptic cylindrical, prolate and oblate spheroidal — or your own via scale factors
73
+ - **Vector calculus**: gradient, divergence, curl, and Laplacian; volume and surface integrals
74
+ - **Operator algebra** with built-in `solve()` for boundary value problems and `eig()` for eigenvalue problems
75
+ - **Boundary conditions**: Dirichlet, Neumann, and Robin, specified per face in one line
76
+ - **Time evolution** (method of lines) for heat, wave, and Schrödinger-type equations
77
+ - **Adaptive mesh refinement**, convergence studies, multigrid hierarchies
78
+ - **Plotting**, **save / load** to `.npz`, and **xarray / NetCDF** interoperability
79
+ - Fully compatible with *NumPy* and *SciPy*
80
+
81
+ ## Installation
82
+
83
+ ```shell
84
+ pip install --upgrade numgrids
85
+ ```
86
+
87
+ Optional extras: `numgrids[plot]` (matplotlib), `numgrids[xarray]` (xarray), or `numgrids[all]`.
88
+
89
+ ## Quick Start
90
+
91
+ ```python
92
+ from numgrids import *
93
+ import numpy as np
94
+
95
+ # A 2D grid: Chebyshev points in x, periodic in y
96
+ grid = Grid(x=chebyshev(30, 0, 1), y=periodic(40))
97
+ f = grid.evaluate(lambda x, y: x**2 * np.sin(y))
98
+
99
+ df_dx = grid.diff(f, axis="x") # spectral derivative
100
+ total = grid.integrate(f**2) # integral over the domain
101
+
102
+ # Solve the Poisson equation with u = 0 on the boundary
103
+ grid = Grid(x=chebyshev(30, 0, 1), y=chebyshev(30, 0, 1))
104
+ u = grid.laplacian_operator().solve(1.0, bcs=0)
105
+
106
+ # Quantum harmonic oscillator: lowest energies 0.5, 1.5, 2.5, ...
107
+ grid = Grid(x=chebyshev(80, -10, 10))
108
+ H = -0.5 * grid.diff_operator(2) + 0.5 * grid.coords**2
109
+ energies, states = H.eig(k=4, bcs=0)
110
+ ```
111
+
112
+ Full documentation including API reference and example notebooks is available at
113
+ **[maroba.github.io/numgrids](https://maroba.github.io/numgrids/)**.
@@ -0,0 +1,191 @@
1
+ <h1 align="center">numgrids</h1>
2
+ <p align="center"> Working with numerical grids made easy. </p>
3
+
4
+ <p align="center"><a href="https://badge.fury.io/py/numgrids"> <img src="https://badge.fury.io/py/numgrids.svg?branch=main&kill_cache=1" alt="PyPI version"></a> <a href="https://github.com/maroba/numgrids/actions/workflows/checks.yml"> <img src="https://github.com/maroba/numgrids/actions/workflows/checks.yml/badge.svg" alt="build"></a><a href="https://codecov.io/gh/maroba/numgrids"> <img src="https://codecov.io/gh/maroba/numgrids/branch/main/graph/badge.svg?token=JNH9SP7BRG" alt=""></a> <a href="https://maroba.github.io/numgrids/"><img src="https://img.shields.io/badge/docs-GitHub%20Pages-blue" alt="Documentation"></a></p>
5
+
6
+ <div align="center"><img src="docs/assets/torus.png" width="25%"> <img src="docs/assets/disk320.png" width="25%"> <img src="docs/assets/cubic.png" width="25%"></div>
7
+
8
+ Setting up numerical grids, differentiation matrices, and coordinate
9
+ transformations by hand is tedious and error-prone.
10
+ *numgrids* gives you a high-level, NumPy-friendly API that handles all of
11
+ this — so you can focus on the physics or mathematics of your problem instead
12
+ of bookkeeping grid indices and scale factors.
13
+
14
+ **Main Features**
15
+
16
+ - Numerical grids in any dimension from **equidistant**, **Chebyshev**, **logarithmic**, and **periodic** axes
17
+ - High-precision **spectral methods** (FFT + Chebyshev) selected automatically where possible
18
+ - Differentiation, integration (Clenshaw–Curtis, trapezoidal), and interpolation (spline or spectral)
19
+ - **Curvilinear coordinates**: spherical, cylindrical, polar, elliptic cylindrical, prolate and oblate spheroidal — or your own via scale factors
20
+ - **Vector calculus**: gradient, divergence, curl, and Laplacian on Cartesian and curvilinear grids; volume and surface integrals
21
+ - **Operator algebra** — write `-0.5 * D2 + V` — with built-in `solve()` for boundary value problems and `eig()` for eigenvalue problems
22
+ - **Boundary conditions**: Dirichlet, Neumann, and Robin, specified as compactly as `bcs={"x_low": 0, "x_high": Neumann(1)}`
23
+ - **Time evolution** (method of lines) for heat, wave, and Schrödinger-type equations
24
+ - **Adaptive mesh refinement**, convergence studies, multigrid hierarchies
25
+ - **Plotting**, **save / load** to `.npz`, and **xarray / NetCDF** interoperability
26
+ - Fully compatible with *NumPy* and *SciPy* (all operators export sparse matrices)
27
+
28
+ ## Installation
29
+
30
+ ```shell
31
+ pip install --upgrade numgrids
32
+ ```
33
+
34
+ Optional extras: `numgrids[plot]` (matplotlib), `numgrids[xarray]` (xarray), or `numgrids[all]`.
35
+
36
+ ## Documentation
37
+
38
+ Full documentation including user guide, API reference and example notebooks is available at
39
+ **[maroba.github.io/numgrids](https://maroba.github.io/numgrids/)**.
40
+
41
+ ## Quick Start
42
+
43
+ ### Grids, derivatives, integrals
44
+
45
+ ```python
46
+ from numgrids import *
47
+ import numpy as np
48
+
49
+ # A 2D grid: Chebyshev points in x, periodic in y. Keyword arguments name the axes.
50
+ grid = Grid(x=chebyshev(30, 0, 1), y=periodic(40, 0, 2 * np.pi))
51
+
52
+ f = grid.evaluate(lambda x, y: x**2 * np.sin(y)) # sample a function
53
+
54
+ df_dx = grid.diff(f, axis="x") # partial derivatives (spectrally accurate)
55
+ d2f_dy2 = grid.diff(f, order=2, axis="y")
56
+ lap = grid.laplacian(f)
57
+ total = grid.integrate(f**2) # integral over the whole domain
58
+ value = grid.interpolate(f, (0.3, 1.2), method="spectral")
59
+ ```
60
+
61
+ Axis types: `chebyshev(n, low, high)`, `equidistant(...)`, `periodic(...)`, `logarithmic(...)`.
62
+ The differentiation method (FFT, Chebyshev, finite differences) is chosen automatically
63
+ according to the axis type.
64
+
65
+ ### Solving PDEs
66
+
67
+ Combine operators like formulas, then solve:
68
+
69
+ ```python
70
+ # Poisson equation ∇²u = -2π² sin(πx) sin(πy) with u = 0 on the boundary
71
+ grid = Grid(x=chebyshev(30, 0, 1), y=chebyshev(30, 0, 1))
72
+ L = grid.laplacian_operator()
73
+ u = L.solve(lambda x, y: -2 * np.pi**2 * np.sin(np.pi * x) * np.sin(np.pi * y), bcs=0)
74
+
75
+ # Mixed boundary conditions per face
76
+ u = L.solve(1.0, bcs={"x_low": 0, "x_high": Neumann(0), "y_low": 0, "y_high": Robin(1, 1, 0)})
77
+ ```
78
+
79
+ Eigenvalue problems — here the quantum harmonic oscillator — come without spurious modes:
80
+
81
+ ```python
82
+ grid = Grid(x=chebyshev(80, -10, 10))
83
+ x = grid.coords
84
+ H = -0.5 * grid.diff_operator(2) + 0.5 * x**2
85
+
86
+ energies, states = H.eig(k=4, bcs=0) # [0.5, 1.5, 2.5, 3.5]
87
+ ```
88
+
89
+ Time-dependent problems are integrated with the method of lines:
90
+
91
+ ```python
92
+ grid = Grid(x=chebyshev(40, 0, 1))
93
+ result = evolve(grid, 0.1 * grid.laplacian_operator(), # heat equation u_t = 0.1 u_xx
94
+ np.sin(np.pi * grid.coords), t_span=(0, 1), bcs=0, method="BDF")
95
+ grid.plot(result.final)
96
+ ```
97
+
98
+ ### Curvilinear grids & vector calculus
99
+
100
+ ```python
101
+ grid = SphericalGrid(
102
+ chebyshev(25, 0.1, 5), # r
103
+ chebyshev(20, 0.1, np.pi - 0.1), # theta
104
+ periodic(30), # phi
105
+ )
106
+ R, Theta, Phi = grid.meshed_coords
107
+ f = R**2
108
+
109
+ grid.laplacian(f) # = 6
110
+ gr, gt, gp = grid.gradient(f) # (2r, 0, 0)
111
+ grid.divergence(gr, gt, gp) # div(grad f) = laplacian f
112
+ grid.curl(gr, gt, gp) # curl(grad f) = 0
113
+ grid.integrate(np.ones(grid.shape)) # volume of the shell (volume element included)
114
+ grid.faces["r_high"].integrate(f) # surface integral over the outer sphere
115
+ ```
116
+
117
+ `PolarGrid`, `CylindricalGrid`, `EllipticCylindricalGrid`, `ProlateSpheroidalGrid` and
118
+ `OblateSpheroidalGrid` work the same way. Any other orthogonal coordinate system can be
119
+ defined by its scale factors:
120
+
121
+ ```python
122
+ grid = CurvilinearGrid(
123
+ axis_q1, axis_q2, axis_q3,
124
+ scale_factors=(
125
+ lambda c: np.ones_like(c[0]), # h_1(q)
126
+ lambda c: c[0], # h_2(q) = q_1
127
+ lambda c: c[0] * np.sin(c[1]), # h_3(q) = q_1 sin(q_2)
128
+ ),
129
+ )
130
+ ```
131
+
132
+ ## Example Notebooks
133
+
134
+ - [Operators and solvers: Poisson, eigenmodes, time evolution](examples/operators-and-solvers.ipynb)
135
+ - [Heat equation in a rod](examples/heat-equation-rod.ipynb)
136
+ - [Poisson equation in 2D](examples/poisson-equation-2d.ipynb)
137
+ - [Quantum harmonic oscillator](examples/quantum-harmonic-oscillator.ipynb)
138
+ - [Vibrations of a drum](examples/wave-equation-drum.ipynb)
139
+ - [Spherical harmonics](examples/spherical-harmonics.ipynb)
140
+ - [Convergence study](examples/convergence-study.ipynb)
141
+ - [Adaptive mesh refinement](examples/adaptive-refinement-demo.ipynb)
142
+
143
+ ## How to Cite
144
+
145
+ If you use *numgrids* in a publication, please cite it as:
146
+
147
+ > M. Baer. *numgrids* software package. URL: https://github.com/maroba/numgrids. 2023
148
+
149
+ BibTeX entry:
150
+
151
+ ```bibtex
152
+ @misc{numgrids,
153
+ title = {{numgrids} Software Package},
154
+ author = {M. Baer},
155
+ url = {https://github.com/maroba/numgrids},
156
+ key = {numgrids},
157
+ note = {\url{https://github.com/maroba/numgrids}},
158
+ year = {2023}
159
+ }
160
+ ```
161
+
162
+ ## Development
163
+
164
+ Clone the repository and install it in development mode with all extras:
165
+
166
+ ```shell
167
+ git clone https://github.com/maroba/numgrids.git
168
+ cd numgrids
169
+ pip install -e ".[dev]"
170
+ ```
171
+
172
+ Run the tests (including the doctests in the docstrings) and the linter:
173
+
174
+ ```shell
175
+ python -m pytest
176
+ ruff check numgrids tests
177
+ ```
178
+
179
+ Build the documentation:
180
+
181
+ ```shell
182
+ sphinx-build -b html docs docs/_build/html
183
+ ```
184
+
185
+ ### Contributing
186
+
187
+ 1. Fork the repository
188
+ 2. Develop
189
+ 3. Write tests!
190
+ 4. Create an [issue](https://github.com/maroba/numgrids/issues)
191
+ 5. Create a pull request, when done
@@ -0,0 +1,56 @@
1
+ <h1 align="center">numgrids</h1>
2
+ <p align="center"> Working with numerical grids made easy.</p>
3
+
4
+ Setting up numerical grids, differentiation matrices, and coordinate
5
+ transformations by hand is tedious and error-prone.
6
+ *numgrids* gives you a high-level, NumPy-friendly API that handles all of
7
+ this — so you can focus on the physics or mathematics of your problem instead
8
+ of bookkeeping grid indices and scale factors.
9
+
10
+ **Main Features**
11
+
12
+ - Numerical grids in any dimension from **equidistant**, **Chebyshev**, **logarithmic**, and **periodic** axes
13
+ - High-precision **spectral methods** (FFT + Chebyshev) selected automatically where possible
14
+ - Differentiation, integration (Clenshaw–Curtis, trapezoidal), and interpolation (spline or spectral)
15
+ - **Curvilinear coordinates**: spherical, cylindrical, polar, elliptic cylindrical, prolate and oblate spheroidal — or your own via scale factors
16
+ - **Vector calculus**: gradient, divergence, curl, and Laplacian; volume and surface integrals
17
+ - **Operator algebra** with built-in `solve()` for boundary value problems and `eig()` for eigenvalue problems
18
+ - **Boundary conditions**: Dirichlet, Neumann, and Robin, specified per face in one line
19
+ - **Time evolution** (method of lines) for heat, wave, and Schrödinger-type equations
20
+ - **Adaptive mesh refinement**, convergence studies, multigrid hierarchies
21
+ - **Plotting**, **save / load** to `.npz`, and **xarray / NetCDF** interoperability
22
+ - Fully compatible with *NumPy* and *SciPy*
23
+
24
+ ## Installation
25
+
26
+ ```shell
27
+ pip install --upgrade numgrids
28
+ ```
29
+
30
+ Optional extras: `numgrids[plot]` (matplotlib), `numgrids[xarray]` (xarray), or `numgrids[all]`.
31
+
32
+ ## Quick Start
33
+
34
+ ```python
35
+ from numgrids import *
36
+ import numpy as np
37
+
38
+ # A 2D grid: Chebyshev points in x, periodic in y
39
+ grid = Grid(x=chebyshev(30, 0, 1), y=periodic(40))
40
+ f = grid.evaluate(lambda x, y: x**2 * np.sin(y))
41
+
42
+ df_dx = grid.diff(f, axis="x") # spectral derivative
43
+ total = grid.integrate(f**2) # integral over the domain
44
+
45
+ # Solve the Poisson equation with u = 0 on the boundary
46
+ grid = Grid(x=chebyshev(30, 0, 1), y=chebyshev(30, 0, 1))
47
+ u = grid.laplacian_operator().solve(1.0, bcs=0)
48
+
49
+ # Quantum harmonic oscillator: lowest energies 0.5, 1.5, 2.5, ...
50
+ grid = Grid(x=chebyshev(80, -10, 10))
51
+ H = -0.5 * grid.diff_operator(2) + 0.5 * grid.coords**2
52
+ energies, states = H.eig(k=4, bcs=0)
53
+ ```
54
+
55
+ Full documentation including API reference and example notebooks is available at
56
+ **[maroba.github.io/numgrids](https://maroba.github.io/numgrids/)**.
@@ -0,0 +1,125 @@
1
+ """numgrids -- working with numerical grids made easy."""
2
+
3
+ from importlib.metadata import PackageNotFoundError as _PackageNotFoundError
4
+ from importlib.metadata import version as _version
5
+
6
+ try:
7
+ __version__ = _version("numgrids")
8
+ except _PackageNotFoundError: # pragma: no cover - running from a source tree
9
+ __version__ = "0.0.0+unknown"
10
+
11
+ # Import the ``numgrids.diff`` submodule eagerly: importing it lazily later
12
+ # would rebind the package attribute ``numgrids.diff`` from the function
13
+ # (imported below) to the module.
14
+ from . import diff as _diff_module # noqa: F401, I001
15
+ from .amr import AdaptationResult, ErrorEstimator, adapt, estimate_error
16
+ from .api import (
17
+ AxisType,
18
+ Diff,
19
+ chebyshev,
20
+ create_axis,
21
+ diff,
22
+ equidistant,
23
+ integrate,
24
+ interpolate,
25
+ logarithmic,
26
+ periodic,
27
+ )
28
+ from .axes import ChebyshevAxis, EquidistantAxis, LogAxis
29
+ from .boundary import (
30
+ BoundaryFace,
31
+ Dirichlet,
32
+ DirichletBC,
33
+ Neumann,
34
+ NeumannBC,
35
+ Robin,
36
+ RobinBC,
37
+ apply_bcs,
38
+ resolve_bcs,
39
+ )
40
+ from .convergence import ConvergenceResult, convergence_study
41
+ from .curvilinear import (
42
+ CurvilinearGrid,
43
+ CylindricalGrid,
44
+ EllipticCylindricalGrid,
45
+ OblateSpheroidalGrid,
46
+ PolarGrid,
47
+ ProlateSpheroidalGrid,
48
+ SphericalGrid,
49
+ )
50
+ from .evolution import EvolutionResult, evolve
51
+ from .grids import Grid, MultiGrid
52
+ from .integration import Integral
53
+ from .interpol import Interpolator
54
+ from .io import from_xarray, load_grid, save_grid, to_xarray
55
+ from .operators import Operator
56
+
57
+
58
+ def Axis(*args, **kwargs):
59
+ """Deprecated alias of :func:`create_axis`.
60
+
61
+ .. deprecated:: 0.5.0
62
+ Use :func:`create_axis` or the short-hand factories
63
+ :func:`chebyshev`, :func:`equidistant`, :func:`periodic` and
64
+ :func:`logarithmic` instead. The axis base class lives in
65
+ :mod:`numgrids.axes`.
66
+ """
67
+ import warnings
68
+ warnings.warn(
69
+ "numgrids.Axis is deprecated; use numgrids.create_axis (or chebyshev, "
70
+ "equidistant, periodic, logarithmic) instead.",
71
+ DeprecationWarning,
72
+ stacklevel=2,
73
+ )
74
+ return create_axis(*args, **kwargs)
75
+
76
+
77
+ __all__ = [
78
+ "AdaptationResult",
79
+ "Axis",
80
+ "AxisType",
81
+ "BoundaryFace",
82
+ "ChebyshevAxis",
83
+ "ConvergenceResult",
84
+ "CurvilinearGrid",
85
+ "CylindricalGrid",
86
+ "Diff",
87
+ "Dirichlet",
88
+ "DirichletBC",
89
+ "EllipticCylindricalGrid",
90
+ "EquidistantAxis",
91
+ "ErrorEstimator",
92
+ "EvolutionResult",
93
+ "Grid",
94
+ "Integral",
95
+ "Interpolator",
96
+ "LogAxis",
97
+ "MultiGrid",
98
+ "Neumann",
99
+ "NeumannBC",
100
+ "OblateSpheroidalGrid",
101
+ "Operator",
102
+ "PolarGrid",
103
+ "ProlateSpheroidalGrid",
104
+ "Robin",
105
+ "RobinBC",
106
+ "SphericalGrid",
107
+ "adapt",
108
+ "apply_bcs",
109
+ "chebyshev",
110
+ "convergence_study",
111
+ "create_axis",
112
+ "diff",
113
+ "equidistant",
114
+ "estimate_error",
115
+ "evolve",
116
+ "from_xarray",
117
+ "integrate",
118
+ "interpolate",
119
+ "load_grid",
120
+ "logarithmic",
121
+ "periodic",
122
+ "resolve_bcs",
123
+ "save_grid",
124
+ "to_xarray",
125
+ ]