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.
- {pygeoinf-1.3.3 → pygeoinf-1.3.4}/PKG-INFO +1 -1
- {pygeoinf-1.3.3 → pygeoinf-1.3.4}/pygeoinf/checks/hilbert_space.py +1 -1
- {pygeoinf-1.3.3 → pygeoinf-1.3.4}/pygeoinf/checks/linear_operators.py +1 -1
- {pygeoinf-1.3.3 → pygeoinf-1.3.4}/pygeoinf/checks/nonlinear_operators.py +1 -1
- {pygeoinf-1.3.3 → pygeoinf-1.3.4}/pygeoinf/hilbert_space.py +45 -0
- {pygeoinf-1.3.3 → pygeoinf-1.3.4}/pygeoinf/plot.py +5 -5
- {pygeoinf-1.3.3 → pygeoinf-1.3.4}/pyproject.toml +1 -1
- {pygeoinf-1.3.3 → pygeoinf-1.3.4}/LICENSE +0 -0
- {pygeoinf-1.3.3 → pygeoinf-1.3.4}/README.md +0 -0
- {pygeoinf-1.3.3 → pygeoinf-1.3.4}/pygeoinf/__init__.py +0 -0
- {pygeoinf-1.3.3 → pygeoinf-1.3.4}/pygeoinf/auxiliary.py +0 -0
- {pygeoinf-1.3.3 → pygeoinf-1.3.4}/pygeoinf/backus_gilbert.py +0 -0
- {pygeoinf-1.3.3 → pygeoinf-1.3.4}/pygeoinf/direct_sum.py +0 -0
- {pygeoinf-1.3.3 → pygeoinf-1.3.4}/pygeoinf/forward_problem.py +0 -0
- {pygeoinf-1.3.3 → pygeoinf-1.3.4}/pygeoinf/gaussian_measure.py +0 -0
- {pygeoinf-1.3.3 → pygeoinf-1.3.4}/pygeoinf/inversion.py +0 -0
- {pygeoinf-1.3.3 → pygeoinf-1.3.4}/pygeoinf/linear_bayesian.py +0 -0
- {pygeoinf-1.3.3 → pygeoinf-1.3.4}/pygeoinf/linear_forms.py +0 -0
- {pygeoinf-1.3.3 → pygeoinf-1.3.4}/pygeoinf/linear_operators.py +0 -0
- {pygeoinf-1.3.3 → pygeoinf-1.3.4}/pygeoinf/linear_optimisation.py +0 -0
- {pygeoinf-1.3.3 → pygeoinf-1.3.4}/pygeoinf/linear_solvers.py +0 -0
- {pygeoinf-1.3.3 → pygeoinf-1.3.4}/pygeoinf/nonlinear_forms.py +0 -0
- {pygeoinf-1.3.3 → pygeoinf-1.3.4}/pygeoinf/nonlinear_operators.py +0 -0
- {pygeoinf-1.3.3 → pygeoinf-1.3.4}/pygeoinf/nonlinear_optimisation.py +0 -0
- {pygeoinf-1.3.3 → pygeoinf-1.3.4}/pygeoinf/parallel.py +0 -0
- {pygeoinf-1.3.3 → pygeoinf-1.3.4}/pygeoinf/random_matrix.py +0 -0
- {pygeoinf-1.3.3 → pygeoinf-1.3.4}/pygeoinf/symmetric_space/__init__.py +0 -0
- {pygeoinf-1.3.3 → pygeoinf-1.3.4}/pygeoinf/symmetric_space/circle.py +0 -0
- {pygeoinf-1.3.3 → pygeoinf-1.3.4}/pygeoinf/symmetric_space/sphere.py +0 -0
- {pygeoinf-1.3.3 → pygeoinf-1.3.4}/pygeoinf/symmetric_space/symmetric_space.py +0 -0
|
@@ -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"
|
|
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"
|
|
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 -
|
|
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.
|
|
280
|
-
mean_2d[0] + 3.
|
|
281
|
-
y_range = np.linspace(mean_2d[1] - 3.
|
|
282
|
-
mean_2d[1] + 3.
|
|
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))
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|