pygeoinf 1.3.3__tar.gz → 1.3.4__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 (30) hide show
  1. {pygeoinf-1.3.3 → pygeoinf-1.3.4}/PKG-INFO +1 -1
  2. {pygeoinf-1.3.3 → pygeoinf-1.3.4}/pygeoinf/checks/hilbert_space.py +1 -1
  3. {pygeoinf-1.3.3 → pygeoinf-1.3.4}/pygeoinf/checks/linear_operators.py +1 -1
  4. {pygeoinf-1.3.3 → pygeoinf-1.3.4}/pygeoinf/checks/nonlinear_operators.py +1 -1
  5. {pygeoinf-1.3.3 → pygeoinf-1.3.4}/pygeoinf/hilbert_space.py +45 -0
  6. {pygeoinf-1.3.3 → pygeoinf-1.3.4}/pygeoinf/plot.py +5 -5
  7. {pygeoinf-1.3.3 → pygeoinf-1.3.4}/pyproject.toml +1 -1
  8. {pygeoinf-1.3.3 → pygeoinf-1.3.4}/LICENSE +0 -0
  9. {pygeoinf-1.3.3 → pygeoinf-1.3.4}/README.md +0 -0
  10. {pygeoinf-1.3.3 → pygeoinf-1.3.4}/pygeoinf/__init__.py +0 -0
  11. {pygeoinf-1.3.3 → pygeoinf-1.3.4}/pygeoinf/auxiliary.py +0 -0
  12. {pygeoinf-1.3.3 → pygeoinf-1.3.4}/pygeoinf/backus_gilbert.py +0 -0
  13. {pygeoinf-1.3.3 → pygeoinf-1.3.4}/pygeoinf/direct_sum.py +0 -0
  14. {pygeoinf-1.3.3 → pygeoinf-1.3.4}/pygeoinf/forward_problem.py +0 -0
  15. {pygeoinf-1.3.3 → pygeoinf-1.3.4}/pygeoinf/gaussian_measure.py +0 -0
  16. {pygeoinf-1.3.3 → pygeoinf-1.3.4}/pygeoinf/inversion.py +0 -0
  17. {pygeoinf-1.3.3 → pygeoinf-1.3.4}/pygeoinf/linear_bayesian.py +0 -0
  18. {pygeoinf-1.3.3 → pygeoinf-1.3.4}/pygeoinf/linear_forms.py +0 -0
  19. {pygeoinf-1.3.3 → pygeoinf-1.3.4}/pygeoinf/linear_operators.py +0 -0
  20. {pygeoinf-1.3.3 → pygeoinf-1.3.4}/pygeoinf/linear_optimisation.py +0 -0
  21. {pygeoinf-1.3.3 → pygeoinf-1.3.4}/pygeoinf/linear_solvers.py +0 -0
  22. {pygeoinf-1.3.3 → pygeoinf-1.3.4}/pygeoinf/nonlinear_forms.py +0 -0
  23. {pygeoinf-1.3.3 → pygeoinf-1.3.4}/pygeoinf/nonlinear_operators.py +0 -0
  24. {pygeoinf-1.3.3 → pygeoinf-1.3.4}/pygeoinf/nonlinear_optimisation.py +0 -0
  25. {pygeoinf-1.3.3 → pygeoinf-1.3.4}/pygeoinf/parallel.py +0 -0
  26. {pygeoinf-1.3.3 → pygeoinf-1.3.4}/pygeoinf/random_matrix.py +0 -0
  27. {pygeoinf-1.3.3 → pygeoinf-1.3.4}/pygeoinf/symmetric_space/__init__.py +0 -0
  28. {pygeoinf-1.3.3 → pygeoinf-1.3.4}/pygeoinf/symmetric_space/circle.py +0 -0
  29. {pygeoinf-1.3.3 → pygeoinf-1.3.4}/pygeoinf/symmetric_space/sphere.py +0 -0
  30. {pygeoinf-1.3.3 → pygeoinf-1.3.4}/pygeoinf/symmetric_space/symmetric_space.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pygeoinf
3
- Version: 1.3.3
3
+ Version: 1.3.4
4
4
  Summary: A package for solving geophysical inference and inverse problems
5
5
  License: BSD-3-Clause
6
6
  License-File: LICENSE
@@ -198,4 +198,4 @@ class HilbertSpaceAxiomChecks:
198
198
  self._check_inplace_operations(x, y, a)
199
199
  self._check_copy(x)
200
200
 
201
- print(f" All {n_checks} Hilbert space axiom checks passed successfully.")
201
+ print(f"[✓] All {n_checks} Hilbert space axiom checks passed successfully.")
@@ -194,4 +194,4 @@ class LinearOperatorAxiomChecks(NonLinearOperatorAxiomChecks):
194
194
  self, op2, x1, y, a, check_rtol=check_rtol, check_atol=check_atol
195
195
  )
196
196
 
197
- print(f" All {n_checks} linear operator checks passed successfully.")
197
+ print(f"[✓] All {n_checks} linear operator checks passed successfully.")
@@ -195,4 +195,4 @@ class NonLinearOperatorAxiomChecks:
195
195
  self, op2, x, v, check_rtol=check_rtol, check_atol=check_atol
196
196
  )
197
197
 
198
- print(f" All {n_checks} non-linear operator checks passed successfully.")
198
+ print(f"[✓] All {n_checks} non-linear operator checks passed successfully.")
@@ -28,6 +28,7 @@ from abc import ABC, abstractmethod
28
28
  from typing import (
29
29
  TypeVar,
30
30
  List,
31
+ Union,
31
32
  Optional,
32
33
  Any,
33
34
  TYPE_CHECKING,
@@ -607,6 +608,50 @@ class EuclideanSpace(HilbertSpace):
607
608
  """
608
609
  return isinstance(x, np.ndarray) and x.shape == (self.dim,)
609
610
 
611
+ def subspace_projection(self, indices: Union[int, List[int]]) -> "LinearOperator":
612
+ """
613
+ Returns a projection operator onto specified coordinates.
614
+
615
+ This creates a linear operator that extracts the components at the given
616
+ indices, projecting from this space to a lower-dimensional Euclidean space.
617
+
618
+ Args:
619
+ indices: Single index or list of indices to project onto (0-indexed).
620
+
621
+ Returns:
622
+ LinearOperator from this space to EuclideanSpace(len(indices)).
623
+
624
+ Raises:
625
+ IndexError: If any index is out of range for this space's dimension.
626
+ """
627
+ from .linear_operators import LinearOperator
628
+
629
+ if isinstance(indices, int):
630
+ indices = [indices]
631
+
632
+ indices_array = np.array(indices)
633
+ if np.any(indices_array < 0) or np.any(indices_array >= self.dim):
634
+ raise IndexError(
635
+ f"Indices {indices_array} out of range for dimension {self.dim}"
636
+ )
637
+
638
+ target_space = EuclideanSpace(len(indices))
639
+
640
+ def forward(x: np.ndarray) -> np.ndarray:
641
+ return x[indices_array]
642
+
643
+ def adjoint_mapping(y: np.ndarray) -> np.ndarray:
644
+ result = np.zeros(self.dim)
645
+ result[indices_array] = y
646
+ return result
647
+
648
+ return LinearOperator(
649
+ self,
650
+ target_space,
651
+ forward,
652
+ adjoint_mapping=adjoint_mapping,
653
+ )
654
+
610
655
 
611
656
  class MassWeightedHilbertSpace(HilbertSpace):
612
657
  """
@@ -247,7 +247,7 @@ def plot_corner_distributions(
247
247
  sigma = np.sqrt(cov_posterior[i, i])
248
248
 
249
249
  # Create x-axis range
250
- x = np.linspace(mu - 4 * sigma, mu + 4 * sigma, 200)
250
+ x = np.linspace(mu - 3.75 * sigma, mu + 3.75 * sigma, 200)
251
251
  pdf = stats.norm.pdf(x, mu, sigma)
252
252
 
253
253
  # Plot the PDF
@@ -276,10 +276,10 @@ def plot_corner_distributions(
276
276
  sigma_j = np.sqrt(cov_posterior[j, j])
277
277
  sigma_i = np.sqrt(cov_posterior[i, i])
278
278
 
279
- x_range = np.linspace(mean_2d[0] - 3.5 * sigma_j,
280
- mean_2d[0] + 3.5 * sigma_j, 100)
281
- y_range = np.linspace(mean_2d[1] - 3.5 * sigma_i,
282
- mean_2d[1] + 3.5 * sigma_i, 100)
279
+ x_range = np.linspace(mean_2d[0] - 3.75 * sigma_j,
280
+ mean_2d[0] + 3.75 * sigma_j, 100)
281
+ y_range = np.linspace(mean_2d[1] - 3.75 * sigma_i,
282
+ mean_2d[1] + 3.75 * sigma_i, 100)
283
283
 
284
284
  X, Y = np.meshgrid(x_range, y_range)
285
285
  pos = np.dstack((X, Y))
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "pygeoinf"
3
- version = "1.3.3"
3
+ version = "1.3.4"
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"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes