pygeoinf 1.2.9__tar.gz → 1.3.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 (28) hide show
  1. {pygeoinf-1.2.9 → pygeoinf-1.3.0}/PKG-INFO +4 -2
  2. {pygeoinf-1.2.9 → pygeoinf-1.3.0}/pygeoinf/__init__.py +67 -0
  3. {pygeoinf-1.2.9 → pygeoinf-1.3.0}/pygeoinf/backus_gilbert.py +0 -2
  4. {pygeoinf-1.2.9 → pygeoinf-1.3.0}/pygeoinf/checks/nonlinear_operators.py +1 -1
  5. {pygeoinf-1.2.9 → pygeoinf-1.3.0}/pygeoinf/direct_sum.py +0 -2
  6. {pygeoinf-1.2.9 → pygeoinf-1.3.0}/pygeoinf/gaussian_measure.py +7 -1
  7. {pygeoinf-1.2.9 → pygeoinf-1.3.0}/pygeoinf/linear_forms.py +1 -1
  8. {pygeoinf-1.2.9 → pygeoinf-1.3.0}/pygeoinf/linear_operators.py +1 -2
  9. {pygeoinf-1.2.9 → pygeoinf-1.3.0}/pygeoinf/nonlinear_forms.py +0 -1
  10. {pygeoinf-1.2.9 → pygeoinf-1.3.0}/pygeoinf/nonlinear_operators.py +2 -2
  11. {pygeoinf-1.2.9 → pygeoinf-1.3.0}/pygeoinf/symmetric_space/sphere.py +3 -1
  12. {pygeoinf-1.2.9 → pygeoinf-1.3.0}/pygeoinf/symmetric_space/symmetric_space.py +1 -1
  13. {pygeoinf-1.2.9 → pygeoinf-1.3.0}/pyproject.toml +14 -1
  14. {pygeoinf-1.2.9 → pygeoinf-1.3.0}/LICENSE +0 -0
  15. {pygeoinf-1.2.9 → pygeoinf-1.3.0}/README.md +0 -0
  16. {pygeoinf-1.2.9 → pygeoinf-1.3.0}/pygeoinf/checks/hilbert_space.py +0 -0
  17. {pygeoinf-1.2.9 → pygeoinf-1.3.0}/pygeoinf/checks/linear_operators.py +0 -0
  18. {pygeoinf-1.2.9 → pygeoinf-1.3.0}/pygeoinf/forward_problem.py +0 -0
  19. {pygeoinf-1.2.9 → pygeoinf-1.3.0}/pygeoinf/hilbert_space.py +0 -0
  20. {pygeoinf-1.2.9 → pygeoinf-1.3.0}/pygeoinf/inversion.py +0 -0
  21. {pygeoinf-1.2.9 → pygeoinf-1.3.0}/pygeoinf/linear_bayesian.py +0 -0
  22. {pygeoinf-1.2.9 → pygeoinf-1.3.0}/pygeoinf/linear_optimisation.py +0 -0
  23. {pygeoinf-1.2.9 → pygeoinf-1.3.0}/pygeoinf/linear_solvers.py +0 -0
  24. {pygeoinf-1.2.9 → pygeoinf-1.3.0}/pygeoinf/nonlinear_optimisation.py +0 -0
  25. {pygeoinf-1.2.9 → pygeoinf-1.3.0}/pygeoinf/parallel.py +0 -0
  26. {pygeoinf-1.2.9 → pygeoinf-1.3.0}/pygeoinf/random_matrix.py +0 -0
  27. {pygeoinf-1.2.9 → pygeoinf-1.3.0}/pygeoinf/symmetric_space/__init__.py +0 -0
  28. {pygeoinf-1.2.9 → pygeoinf-1.3.0}/pygeoinf/symmetric_space/circle.py +0 -0
@@ -1,8 +1,9 @@
1
- Metadata-Version: 2.3
1
+ Metadata-Version: 2.4
2
2
  Name: pygeoinf
3
- Version: 1.2.9
3
+ Version: 1.3.0
4
4
  Summary: A package for solving geophysical inference and inverse problems
5
5
  License: BSD-3-Clause
6
+ License-File: LICENSE
6
7
  Author: David Al-Attar and Dan Heathcote
7
8
  Requires-Python: >=3.11
8
9
  Classifier: License :: OSI Approved :: BSD License
@@ -10,6 +11,7 @@ Classifier: Programming Language :: Python :: 3
10
11
  Classifier: Programming Language :: Python :: 3.11
11
12
  Classifier: Programming Language :: Python :: 3.12
12
13
  Classifier: Programming Language :: Python :: 3.13
14
+ Classifier: Programming Language :: Python :: 3.14
13
15
  Provides-Extra: sphere
14
16
  Requires-Dist: joblib (>=1.5.2,<2.0.0)
15
17
  Requires-Dist: matplotlib (>=3.0.0)
@@ -85,3 +85,70 @@ from .backus_gilbert import HyperEllipsoid
85
85
  from .nonlinear_optimisation import (
86
86
  ScipyUnconstrainedOptimiser,
87
87
  )
88
+
89
+
90
+ __all__ = [
91
+ # random_matrix
92
+ "fixed_rank_random_range",
93
+ "variable_rank_random_range",
94
+ "random_range",
95
+ "random_svd",
96
+ "random_eig",
97
+ "random_cholesky",
98
+ "random_diagonal",
99
+ # hilbert_space
100
+ "HilbertSpace",
101
+ "DualHilbertSpace",
102
+ "EuclideanSpace",
103
+ "HilbertModule",
104
+ "MassWeightedHilbertSpace",
105
+ "MassWeightedHilbertModule",
106
+ # nonlinear_forms
107
+ "NonLinearForm",
108
+ # linear_forms
109
+ "LinearForm",
110
+ # nonlinear_operators
111
+ "NonLinearOperator",
112
+ # linear_operators
113
+ "LinearOperator",
114
+ "MatrixLinearOperator",
115
+ "DenseMatrixLinearOperator",
116
+ "SparseMatrixLinearOperator",
117
+ "DiagonalSparseMatrixLinearOperator",
118
+ "NormalSumOperator",
119
+ # gaussian_measure
120
+ "GaussianMeasure",
121
+ # direct_sum
122
+ "HilbertSpaceDirectSum",
123
+ "BlockStructure",
124
+ "BlockLinearOperator",
125
+ "ColumnLinearOperator",
126
+ "RowLinearOperator",
127
+ "BlockDiagonalLinearOperator",
128
+ # linear_solvers
129
+ "LinearSolver",
130
+ "DirectLinearSolver",
131
+ "LUSolver",
132
+ "CholeskySolver",
133
+ "EigenSolver",
134
+ "IterativeLinearSolver",
135
+ "ScipyIterativeSolver",
136
+ "CGMatrixSolver",
137
+ "BICGMatrixSolver",
138
+ "BICGStabMatrixSolver",
139
+ "GMRESMatrixSolver",
140
+ "CGSolver",
141
+ # forward_problem
142
+ "ForwardProblem",
143
+ "LinearForwardProblem",
144
+ # linear_optimisation
145
+ "LinearLeastSquaresInversion",
146
+ "LinearMinimumNormInversion",
147
+ # linear_bayesian
148
+ "LinearBayesianInversion",
149
+ "LinearBayesianInference",
150
+ # backus_gilbert
151
+ "HyperEllipsoid",
152
+ # nonlinear_optimisation
153
+ "ScipyUnconstrainedOptimiser",
154
+ ]
@@ -8,8 +8,6 @@ from .hilbert_space import HilbertSpace, Vector
8
8
  from .linear_operators import LinearOperator
9
9
  from .nonlinear_forms import NonLinearForm
10
10
 
11
- from .forward_problem import LinearForwardProblem
12
- from .inversion import LinearInference
13
11
 
14
12
 
15
13
  class HyperEllipsoid:
@@ -7,7 +7,7 @@ from typing import TYPE_CHECKING
7
7
  import numpy as np
8
8
 
9
9
  if TYPE_CHECKING:
10
- from ..linear_operators import LinearOperator
10
+ pass
11
11
 
12
12
 
13
13
  class NonLinearOperatorAxiomChecks:
@@ -26,12 +26,10 @@ from abc import ABC, abstractmethod
26
26
  from typing import List, Any
27
27
  import numpy as np
28
28
  from scipy.linalg import block_diag
29
- from joblib import Parallel, delayed
30
29
 
31
30
  from .hilbert_space import HilbertSpace
32
31
  from .linear_operators import LinearOperator
33
32
  from .linear_forms import LinearForm
34
- from .parallel import parallel_compute_dense_matrix_from_scipy_op
35
33
 
36
34
 
37
35
  class HilbertSpaceDirectSum(HilbertSpace):
@@ -20,7 +20,7 @@ Key Features
20
20
  """
21
21
 
22
22
  from __future__ import annotations
23
- from typing import Callable, Optional, Any, List, TypeVar, TYPE_CHECKING
23
+ from typing import Callable, Optional, Any, List, TYPE_CHECKING
24
24
 
25
25
  import numpy as np
26
26
  from scipy.linalg import eigh
@@ -40,6 +40,12 @@ from .direct_sum import (
40
40
  )
41
41
 
42
42
 
43
+ # This block is only processed by type checkers, not at runtime.
44
+ if TYPE_CHECKING:
45
+ from .hilbert_space import HilbertSpace
46
+ from .typing import Vector
47
+
48
+
43
49
  class GaussianMeasure:
44
50
  """
45
51
  Represents a Gaussian measure on a Hilbert space.
@@ -18,7 +18,7 @@ from .nonlinear_forms import NonLinearForm
18
18
 
19
19
  # This block only runs for type checkers, not at runtime
20
20
  if TYPE_CHECKING:
21
- from .hilbert_space import HilbertSpace, EuclideanSpace, Vector
21
+ from .hilbert_space import HilbertSpace, Vector
22
22
  from .linear_operators import LinearOperator
23
23
 
24
24
 
@@ -25,7 +25,6 @@ from collections import defaultdict
25
25
  import numpy as np
26
26
  import scipy.sparse as sp
27
27
  from scipy.sparse.linalg import LinearOperator as ScipyLinOp
28
- from scipy.sparse import diags
29
28
 
30
29
 
31
30
  from joblib import Parallel, delayed
@@ -46,7 +45,7 @@ from .checks.linear_operators import LinearOperatorAxiomChecks
46
45
 
47
46
  # This block only runs for type checkers, not at runtime
48
47
  if TYPE_CHECKING:
49
- from .hilbert_space import HilbertSpace, EuclideanSpace
48
+ from .hilbert_space import HilbertSpace
50
49
  from .linear_forms import LinearForm
51
50
 
52
51
 
@@ -16,7 +16,6 @@ if TYPE_CHECKING:
16
16
  from .hilbert_space import HilbertSpace, Vector
17
17
  from .linear_forms import LinearForm
18
18
  from .linear_operators import LinearOperator
19
- from .nonlinear_operators import NonLinearOperator
20
19
 
21
20
 
22
21
  class NonLinearForm:
@@ -8,7 +8,7 @@ algebraic operations and an interface for the Frécher derivative.
8
8
  """
9
9
 
10
10
  from __future__ import annotations
11
- from typing import Callable, Optional, Any, TYPE_CHECKING
11
+ from typing import Callable, Any, TYPE_CHECKING
12
12
 
13
13
 
14
14
  from .checks.nonlinear_operators import NonLinearOperatorAxiomChecks
@@ -16,7 +16,7 @@ from .checks.nonlinear_operators import NonLinearOperatorAxiomChecks
16
16
 
17
17
  # This block only runs for type checkers, not at runtime
18
18
  if TYPE_CHECKING:
19
- from .hilbert_space import HilbertSpace, EuclideanSpace, Vector
19
+ from .hilbert_space import HilbertSpace, Vector
20
20
  from .linear_operators import LinearOperator
21
21
 
22
22
 
@@ -605,7 +605,9 @@ class Sobolev(SphereHelper, MassWeightedHilbertModule, AbstractInvariantSobolevS
605
605
  summation = 1.0
606
606
  l = 0
607
607
  err = 1.0
608
- sobolev_func = lambda deg: (1.0 + scale**2 * deg * (deg + 1)) ** order
608
+
609
+ def sobolev_func(deg):
610
+ return (1.0 + scale**2 * deg * (deg + 1)) ** order
609
611
 
610
612
  while err > rtol:
611
613
  l += 1
@@ -35,7 +35,7 @@ from typing import Callable, Any, List
35
35
  import numpy as np
36
36
  from scipy.sparse import diags
37
37
 
38
- from pygeoinf.hilbert_space import EuclideanSpace, HilbertSpace
38
+ from pygeoinf.hilbert_space import EuclideanSpace
39
39
  from pygeoinf.linear_operators import LinearOperator
40
40
  from pygeoinf.linear_forms import LinearForm
41
41
  from pygeoinf.gaussian_measure import GaussianMeasure
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "pygeoinf"
3
- version = "1.2.9"
3
+ version = "1.3.0"
4
4
  description = "A package for solving geophysical inference and inverse problems"
5
5
  authors = ["David Al-Attar and Dan Heathcote"]
6
6
  readme = "README.md"
@@ -30,7 +30,20 @@ sphinx = "<8.2"
30
30
  nbsphinx = "^0.9.7"
31
31
  pyshtools = ">=4.0.0"
32
32
  Cartopy = "^0.23.0"
33
+ ruff = "^0.5.5"
33
34
 
34
35
  [build-system]
35
36
  requires = ["poetry-core"]
36
37
  build-backend = "poetry.core.masonry.api"
38
+
39
+
40
+ # --- Added Ruff Configuration ---
41
+ [tool.ruff]
42
+
43
+ [tool.ruff.lint.per-file-ignores]
44
+ # For any file in the "tests/" directory, ignore the lambda assignment warning (E731).
45
+ "tests/*" = ["E731", "E741"]
46
+
47
+ # For the sphere.py file, where 'l' is a common variable name for spherical
48
+ # harmonic degree, ignore the ambiguous variable name warning (E741).
49
+ "pygeoinf/symmetric_space/sphere.py" = ["E741"]
File without changes
File without changes
File without changes
File without changes