pygeoinf 1.2.8__py3-none-any.whl → 1.2.9__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.
@@ -29,10 +29,16 @@ import matplotlib.ticker as mticker
29
29
  import numpy as np
30
30
  from scipy.sparse import diags, coo_array
31
31
 
32
- import pyshtools as sh
33
- import cartopy.crs as ccrs
34
- import cartopy.feature as cfeature
35
- from cartopy.mpl.ticker import LongitudeFormatter, LatitudeFormatter
32
+ try:
33
+ import pyshtools as sh
34
+ import cartopy.crs as ccrs
35
+ import cartopy.feature as cfeature
36
+ from cartopy.mpl.ticker import LongitudeFormatter, LatitudeFormatter
37
+ except ImportError:
38
+ raise ImportError(
39
+ "pyshtools and cartopy are required for the sphere module. "
40
+ "Please install them with 'pip install pygeoinf[sphere]'"
41
+ )
36
42
 
37
43
  from pygeoinf.hilbert_space import (
38
44
  HilbertModule,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: pygeoinf
3
- Version: 1.2.8
3
+ Version: 1.2.9
4
4
  Summary: A package for solving geophysical inference and inverse problems
5
5
  License: BSD-3-Clause
6
6
  Author: David Al-Attar and Dan Heathcote
@@ -10,12 +10,11 @@ Classifier: Programming Language :: Python :: 3
10
10
  Classifier: Programming Language :: Python :: 3.11
11
11
  Classifier: Programming Language :: Python :: 3.12
12
12
  Classifier: Programming Language :: Python :: 3.13
13
- Requires-Dist: Cartopy (>=0.23.0,<0.24.0)
13
+ Provides-Extra: sphere
14
14
  Requires-Dist: joblib (>=1.5.2,<2.0.0)
15
15
  Requires-Dist: matplotlib (>=3.0.0)
16
16
  Requires-Dist: numpy (>=1.26.0)
17
17
  Requires-Dist: pyqt6 (>=6.0.0)
18
- Requires-Dist: pyshtools (>=4.0.0)
19
18
  Requires-Dist: scipy (>=1.16.1)
20
19
  Description-Content-Type: text/markdown
21
20
 
@@ -47,16 +46,31 @@ The library is built on a few key concepts:
47
46
  * **Optimisation Methods**: Includes Tikhonov-regularized least-squares and minimum-norm solutions.
48
47
  * **Probabilistic Modelling**: Define priors and noise models using `GaussianMeasure` objects on abstract spaces.
49
48
  * **Randomized Algorithms**: Utilizes randomized SVD and Cholesky decompositions for efficient low-rank approximations of large operators.
49
+ * **Specialized Operator Variants**: Efficient implementations for `DiagonalSparseMatrixLinearOperator` and `NormalSumOperator`.
50
50
  * **Application-Specific Spaces**: Provides concrete `HilbertSpace` implementations for functions on a **line**, **circle**, and the **two-sphere**.
51
51
  * **High-Quality Visualisation**: Built-in plotting methods for functions on symmetric spaces, including map projections via `cartopy`.
52
52
 
53
+ ## Advanced Features
54
+
55
+ * **Block Operators**: Construct complex operators from smaller components using `BlockLinearOperator`, `ColumnLinearOperator`, and `RowLinearOperator`. This is ideal for coupled inverse problems.
56
+ * **Parallelisation**: Many expensive operations are parallelized with `joblib`, including dense matrix construction and randomized algorithms.
57
+
53
58
  ## Installation
54
59
 
55
- The package can be installed directly using pip:
60
+ The package can be installed directly using pip. By default, this will perform a minimal installation.
56
61
 
57
62
  ```bash
63
+ # Minimal installation
58
64
  pip install pygeoinf
59
65
  ```
66
+
67
+ To include the functionality for functions on the sphere, you can install the `sphere` extra. This provides support for `pyshtools` and `Cartopy`.
68
+
69
+ ```bash
70
+ # Installation with sphere-related features
71
+ pip install pygeoinf[sphere]
72
+ ```
73
+
60
74
  For development, you can clone the repository and install using Poetry:
61
75
 
62
76
  ```bash
@@ -64,6 +78,7 @@ git clone https://github.com/da380/pygeoinf.git
64
78
  cd pygeoinf
65
79
  poetry install
66
80
  ```
81
+
67
82
  You can install all optional dependencies for development—including tools for running the test suite,
68
83
  building the documentation, and running the Jupyter tutorials—by using the ```--with``` flag and specifying the ```dev``` group.
69
84
 
@@ -233,20 +248,30 @@ The output of the above script will look similar to the following figure:
233
248
  * NumPy
234
249
  * SciPy
235
250
  * Matplotlib
236
- * pyshtools (for `sphere.py`)
237
- * Cartopy (for plotting in `sphere.py`)
251
+ * joblib
238
252
 
239
- ## Future Plans
253
+ ### Optional (`sphere`)
254
+
255
+ * pyshtools
256
+ * Cartopy
257
+
258
+ ## Recent Updates
259
+
260
+ `pygeoinf` is under active development, and recent updates have expanded its capabilities to address a broader range of geophysical problems. Key improvements include:
240
261
 
241
- `pygeoinf` is under active development. Current work is focused on expanding the library's capabilities to address a broader range of geophysical problems. Key areas for development include:
262
+ * **Non-Linear Inverse Problems**: The library now supports non-linear inverse problems through the `NonLinearOperator` and `NonLinearForm` classes. This allows you to define and solve problems where the relationship between model parameters and data is non-linear. The framework includes support for Fréchet derivatives, enabling the use of gradient-based optimisation methods.
242
263
 
243
- * **Generalised Backus-Gilbert Methods**: Implementation of a generalised Backus-Gilbert framework for linear inference problems. The focus will be on constructing direct estimates of specific properties of interest (i.e., linear functionals of the model) from data, without needing to first solve for the full model itself.
264
+ * **Advanced Optimisation Algorithms**: To complement the non-linear framework, `pygeoinf` now includes a suite of optimisation algorithms. You can use the custom `GradientDescent` solver or leverage the power of SciPy's optimization library with methods like 'BFGS', 'L-BFGS-B', and 'Newton-CG'. Derivative-free methods such as 'Powell' and 'Nelder-Mead' are also supported for problems where gradients are unavailable.
265
+
266
+ * **Backus-Gilbert Methods**: The foundations for the Backus-Gilbert method have been implemented. While this feature is still evolving, the core components are in place for you to begin exploring this powerful inference technique.
267
+
268
+ ## Future Plans
244
269
 
245
- * **Non-linear Optimisation**: Extension of the current optimisation framework to handle non-linear inverse problems. This will involve creating a general interface where users can provide their own non-linear forward mapping, a misfit functional, and methods for computing gradients (and optionally Hessians) for use in gradient-based optimisation algorithms.
270
+ Future development will focus on the following areas:
246
271
 
247
- * **Non-linear Bayesian Inference**: Development of methods for non-linear Bayesian problems. Planned approaches include linearizing the problem around the maximum a posteriori (MAP) solution to estimate posterior uncertainty, and using this linearization to construct efficient proposal distributions for Markov chain Monte Carlo (MCMC) sampling methods.
272
+ * **Non-linear Bayesian Inference**: We plan to develop methods for non-linear Bayesian problems, including techniques for linearizing the problem around the maximum a posteriori (MAP) solution to estimate posterior uncertainty. This will also involve constructing efficient proposal distributions for Markov chain Monte Carlo (MCMC) sampling methods.
248
273
 
249
- * **New Geophysical Hilbert Spaces**: Addition of further `HilbertSpace` implementations tailored to specific geophysical applications. A primary focus will be on creating spaces for functions defined within a **spherical annulus** (spherical shell), which is essential for problems in global seismology and mantle tomography.
274
+ * **New Geophysical Hilbert Spaces**: We will be adding more `HilbertSpace` implementations for specific geophysical applications. A key focus will be on creating spaces for functions defined within a **spherical annulus** (spherical shell), which is crucial for problems in global seismology and mantle tomography.
250
275
 
251
276
 
252
277
  ## Contributing
@@ -20,9 +20,9 @@ pygeoinf/parallel.py,sha256=VVFvNHszy4wSa9LuErIsch4NAkLaZezhdN9YpRROBJo,2267
20
20
  pygeoinf/random_matrix.py,sha256=71l6eAXQ2pRMleaz1lXud6O1F78ugKyp3vHcRBXhdwM,17661
21
21
  pygeoinf/symmetric_space/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
22
22
  pygeoinf/symmetric_space/circle.py,sha256=7Bz9BfSkbDnoz5-HFwTsAQE4a09jUapBePwoCK0xYWw,18007
23
- pygeoinf/symmetric_space/sphere.py,sha256=5elw48I8A2i5EuRyYnm4craVp-ZB2_bBy9QQ15GytxE,23144
23
+ pygeoinf/symmetric_space/sphere.py,sha256=8mIny_KNP2MCpVxqIFKEgXc1_EIDesVz65OhUtRVsuQ,23349
24
24
  pygeoinf/symmetric_space/symmetric_space.py,sha256=Q3KtfCtHO0_8LjsdKtH-5WVhRQurt5Bdk4yx1D2F5YY,17977
25
- pygeoinf-1.2.8.dist-info/LICENSE,sha256=GrTQnKJemVi69FSbHprq60KN0OJGsOSR-joQoTq-oD8,1501
26
- pygeoinf-1.2.8.dist-info/METADATA,sha256=BLWdHc9FE8C4X7L0y9xHAdQfY3_pkzljiNPIPZAqfH4,15169
27
- pygeoinf-1.2.8.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
28
- pygeoinf-1.2.8.dist-info/RECORD,,
25
+ pygeoinf-1.2.9.dist-info/LICENSE,sha256=GrTQnKJemVi69FSbHprq60KN0OJGsOSR-joQoTq-oD8,1501
26
+ pygeoinf-1.2.9.dist-info/METADATA,sha256=dBoRWZKHNcr7PIhPki7pU9oIFLy0FQtJOvI6dIp39no,16292
27
+ pygeoinf-1.2.9.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
28
+ pygeoinf-1.2.9.dist-info/RECORD,,