apsg 2.0.5__tar.gz → 2.0.6__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.
- {apsg-2.0.5/src/apsg.egg-info → apsg-2.0.6}/PKG-INFO +1 -1
- {apsg-2.0.5 → apsg-2.0.6}/src/apsg/__init__.py +1 -1
- {apsg-2.0.5 → apsg-2.0.6}/src/apsg/feature/_container.py +3 -3
- {apsg-2.0.5 → apsg-2.0.6}/src/apsg/feature/_tensor3.py +15 -8
- {apsg-2.0.5 → apsg-2.0.6/src/apsg.egg-info}/PKG-INFO +1 -1
- {apsg-2.0.5 → apsg-2.0.6}/tests/test_containers.py +2 -2
- {apsg-2.0.5 → apsg-2.0.6}/tests/test_tensors.py +14 -2
- {apsg-2.0.5 → apsg-2.0.6}/LICENSE +0 -0
- {apsg-2.0.5 → apsg-2.0.6}/README.md +0 -0
- {apsg-2.0.5 → apsg-2.0.6}/pyproject.toml +0 -0
- {apsg-2.0.5 → apsg-2.0.6}/setup.cfg +0 -0
- {apsg-2.0.5 → apsg-2.0.6}/src/apsg/config.py +0 -0
- {apsg-2.0.5 → apsg-2.0.6}/src/apsg/database/__init__.py +0 -0
- {apsg-2.0.5 → apsg-2.0.6}/src/apsg/database/_sdbmodels.py +0 -0
- {apsg-2.0.5 → apsg-2.0.6}/src/apsg/database/_sdbsession.py +0 -0
- {apsg-2.0.5 → apsg-2.0.6}/src/apsg/database/_websdbsession.py +0 -0
- {apsg-2.0.5 → apsg-2.0.6}/src/apsg/database/_webtransport.py +0 -0
- {apsg-2.0.5 → apsg-2.0.6}/src/apsg/feature/__init__.py +0 -0
- {apsg-2.0.5 → apsg-2.0.6}/src/apsg/feature/_geodata.py +0 -0
- {apsg-2.0.5 → apsg-2.0.6}/src/apsg/feature/_paleomag.py +0 -0
- {apsg-2.0.5 → apsg-2.0.6}/src/apsg/feature/_statistics.py +0 -0
- {apsg-2.0.5 → apsg-2.0.6}/src/apsg/feature/_tensor2.py +0 -0
- {apsg-2.0.5 → apsg-2.0.6}/src/apsg/helpers/__init__.py +0 -0
- {apsg-2.0.5 → apsg-2.0.6}/src/apsg/helpers/_helper.py +0 -0
- {apsg-2.0.5 → apsg-2.0.6}/src/apsg/helpers/_math.py +0 -0
- {apsg-2.0.5 → apsg-2.0.6}/src/apsg/helpers/_notation.py +0 -0
- {apsg-2.0.5 → apsg-2.0.6}/src/apsg/math/__init__.py +0 -0
- {apsg-2.0.5 → apsg-2.0.6}/src/apsg/math/_matrix.py +0 -0
- {apsg-2.0.5 → apsg-2.0.6}/src/apsg/math/_vector.py +0 -0
- {apsg-2.0.5 → apsg-2.0.6}/src/apsg/pandas/__init__.py +0 -0
- {apsg-2.0.5 → apsg-2.0.6}/src/apsg/pandas/_accessors.py +0 -0
- {apsg-2.0.5 → apsg-2.0.6}/src/apsg/pandas/_gbfunctions.py +0 -0
- {apsg-2.0.5 → apsg-2.0.6}/src/apsg/pandas/_pandas_api.py +0 -0
- {apsg-2.0.5 → apsg-2.0.6}/src/apsg/plotting/__init__.py +0 -0
- {apsg-2.0.5 → apsg-2.0.6}/src/apsg/plotting/_fabricplot.py +0 -0
- {apsg-2.0.5 → apsg-2.0.6}/src/apsg/plotting/_paleomagplots.py +0 -0
- {apsg-2.0.5 → apsg-2.0.6}/src/apsg/plotting/_plot_artists.py +0 -0
- {apsg-2.0.5 → apsg-2.0.6}/src/apsg/plotting/_roseplot.py +0 -0
- {apsg-2.0.5 → apsg-2.0.6}/src/apsg/plotting/_stereo_engine/__init__.py +0 -0
- {apsg-2.0.5 → apsg-2.0.6}/src/apsg/plotting/_stereo_engine/_axes.py +0 -0
- {apsg-2.0.5 → apsg-2.0.6}/src/apsg/plotting/_stereo_engine/_stereogrid.py +0 -0
- {apsg-2.0.5 → apsg-2.0.6}/src/apsg/plotting/_stereo_engine/_transforms.py +0 -0
- {apsg-2.0.5 → apsg-2.0.6}/src/apsg/plotting/_stereo_engine/_utils.py +0 -0
- {apsg-2.0.5 → apsg-2.0.6}/src/apsg/plotting/_stereogrid.py +0 -0
- {apsg-2.0.5 → apsg-2.0.6}/src/apsg/plotting/_stereonet.py +0 -0
- {apsg-2.0.5 → apsg-2.0.6}/src/apsg/plotting/_styles.py +0 -0
- {apsg-2.0.5 → apsg-2.0.6}/src/apsg/shell.py +0 -0
- {apsg-2.0.5 → apsg-2.0.6}/src/apsg.egg-info/SOURCES.txt +0 -0
- {apsg-2.0.5 → apsg-2.0.6}/src/apsg.egg-info/dependency_links.txt +0 -0
- {apsg-2.0.5 → apsg-2.0.6}/src/apsg.egg-info/entry_points.txt +0 -0
- {apsg-2.0.5 → apsg-2.0.6}/src/apsg.egg-info/requires.txt +0 -0
- {apsg-2.0.5 → apsg-2.0.6}/src/apsg.egg-info/top_level.txt +0 -0
- {apsg-2.0.5 → apsg-2.0.6}/tests/test_apsg.py +0 -0
- {apsg-2.0.5 → apsg-2.0.6}/tests/test_pandas.py +0 -0
- {apsg-2.0.5 → apsg-2.0.6}/tests/test_plotting.py +0 -0
- {apsg-2.0.5 → apsg-2.0.6}/tests/test_websdb.py +0 -0
|
@@ -2731,10 +2731,10 @@ class Stress3Set(FeatureSet):
|
|
|
2731
2731
|
return np.array([e.I3 for e in self])
|
|
2732
2732
|
|
|
2733
2733
|
@property
|
|
2734
|
-
def
|
|
2735
|
-
"""Return the array of
|
|
2734
|
+
def stress_ratio(self) -> np.ndarray:
|
|
2735
|
+
"""Return the array of stress ratios R = (σ2 - σ3) / (σ1 - σ3)."""
|
|
2736
2736
|
|
|
2737
|
-
return np.array([e.
|
|
2737
|
+
return np.array([e.stress_ratio for e in self])
|
|
2738
2738
|
|
|
2739
2739
|
def mean_tensor(self, level=0.95, normalize=False, anisoft=False):
|
|
2740
2740
|
"""Return mean tensor and confidence ellipses of its principal axes.
|
|
@@ -840,10 +840,11 @@ class Stress3(Tensor3):
|
|
|
840
840
|
@classmethod
|
|
841
841
|
def from_ratio(cls, r=0.5, mag=1):
|
|
842
842
|
"""
|
|
843
|
-
Return ``Stress`` tensor with given
|
|
843
|
+
Return ``Stress`` tensor with given stress ratio.
|
|
844
844
|
|
|
845
845
|
Keyword Args:
|
|
846
|
-
r (float):
|
|
846
|
+
r (float): stress ratio R = (σ2 - σ3) / (σ1 - σ3) between 0 and 1.
|
|
847
|
+
Default 0.5
|
|
847
848
|
mag (float): magnitude of differential stress. Default 1.
|
|
848
849
|
|
|
849
850
|
Examples:
|
|
@@ -851,15 +852,16 @@ class Stress3(Tensor3):
|
|
|
851
852
|
>>> S
|
|
852
853
|
Stress3
|
|
853
854
|
[[ 5. 0. 0. ]
|
|
854
|
-
[ 0.
|
|
855
|
+
[ 0. -2.5 0. ]
|
|
855
856
|
[ 0. 0. -5. ]]
|
|
856
857
|
|
|
857
858
|
Returns:
|
|
858
|
-
Stress3: ``Stress`` tensor with given
|
|
859
|
+
Stress3: ``Stress`` tensor with given stress ratio.
|
|
859
860
|
"""
|
|
860
861
|
|
|
861
862
|
xx = mag / 2
|
|
862
|
-
|
|
863
|
+
# sigma2 placed so that (σ2 - σ3) / (σ1 - σ3) == r in either convention
|
|
864
|
+
yy = stress_sign() * (xx - r * mag)
|
|
863
865
|
zz = -mag / 2
|
|
864
866
|
return cls([[xx, 0, 0], [0, yy, 0], [0, 0, zz]])
|
|
865
867
|
|
|
@@ -1092,9 +1094,14 @@ class Stress3(Tensor3):
|
|
|
1092
1094
|
return np.where(np.isclose(denom, 0), np.nan, (Se.sigma1 - sn) / denom)
|
|
1093
1095
|
|
|
1094
1096
|
@property
|
|
1095
|
-
def
|
|
1096
|
-
"""Return
|
|
1097
|
-
|
|
1097
|
+
def stress_ratio(self):
|
|
1098
|
+
"""Return stress ratio R = (σ2 - σ3) / (σ1 - σ3).
|
|
1099
|
+
|
|
1100
|
+
Structural geology definition: R = 0 for σ2 = σ3 (prolate) and
|
|
1101
|
+
R = 1 for σ2 = σ1 (oblate). Note that the seismological definition
|
|
1102
|
+
(σ1 - σ2) / (σ1 - σ3) equals 1 - R.
|
|
1103
|
+
"""
|
|
1104
|
+
return float((self.sigma2 - self.sigma3) / (self.sigma1 - self.sigma3))
|
|
1098
1105
|
|
|
1099
1106
|
|
|
1100
1107
|
class Ellipsoid(Tensor3):
|
|
@@ -1510,14 +1510,14 @@ class TestStress3Set:
|
|
|
1510
1510
|
assert isinstance(s.I3, np.ndarray)
|
|
1511
1511
|
assert len(s.I1) == len(s.I2) == len(s.I3) == 2
|
|
1512
1512
|
|
|
1513
|
-
def
|
|
1513
|
+
def test_stress_ratio_property(self):
|
|
1514
1514
|
s = Stress3Set(
|
|
1515
1515
|
[
|
|
1516
1516
|
Stress3([[10, 2, -3], [2, 5, 1], [-3, 1, -2]]),
|
|
1517
1517
|
Stress3([[8, 0, 0], [0, 5, 0], [0, 0, 1]]),
|
|
1518
1518
|
]
|
|
1519
1519
|
)
|
|
1520
|
-
r = s.
|
|
1520
|
+
r = s.stress_ratio
|
|
1521
1521
|
assert isinstance(r, np.ndarray)
|
|
1522
1522
|
assert len(r) == 2
|
|
1523
1523
|
|
|
@@ -1139,9 +1139,21 @@ class TestStress3:
|
|
|
1139
1139
|
t = S.dilation_tendency(Foliation(160, 30))
|
|
1140
1140
|
assert 0 <= t <= 1
|
|
1141
1141
|
|
|
1142
|
-
def
|
|
1142
|
+
def test_stress_ratio(self):
|
|
1143
1143
|
S = Stress3.from_ratio(r=0.5, mag=1)
|
|
1144
|
-
assert 0 <= S.
|
|
1144
|
+
assert 0 <= S.stress_ratio <= 1
|
|
1145
|
+
|
|
1146
|
+
def test_stress_ratio_structural_definition(self):
|
|
1147
|
+
# R = (s2 - s3) / (s1 - s3)
|
|
1148
|
+
S = Stress3([[8, 0, 0], [0, 5, 0], [0, 0, 1]])
|
|
1149
|
+
assert math.isclose(S.stress_ratio, 4 / 7)
|
|
1150
|
+
|
|
1151
|
+
def test_from_ratio_roundtrip(self):
|
|
1152
|
+
for convention in ("geological", "mechanical"):
|
|
1153
|
+
with apsg_conf_context(stress_convention=convention):
|
|
1154
|
+
for r in (0.0, 0.25, 0.5, 0.8, 1.0):
|
|
1155
|
+
S = Stress3.from_ratio(r=r, mag=10)
|
|
1156
|
+
assert math.isclose(S.stress_ratio, r, abs_tol=1e-12)
|
|
1145
1157
|
|
|
1146
1158
|
def test_eigenlins(self):
|
|
1147
1159
|
S = Stress3.from_comp(xx=5, yy=2, zz=-10, xy=1)
|
|
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
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|