apsg 1.2.2__py2.py3-none-any.whl → 1.2.3__py2.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.
- apsg/feature/_container.py +83 -3
- apsg/math/_vector.py +6 -3
- apsg/plotting/_stereonet.py +14 -13
- {apsg-1.2.2.dist-info → apsg-1.2.3.dist-info}/METADATA +9 -1
- {apsg-1.2.2.dist-info → apsg-1.2.3.dist-info}/RECORD +10 -10
- {apsg-1.2.2.dist-info → apsg-1.2.3.dist-info}/WHEEL +1 -1
- {apsg-1.2.2.dist-info → apsg-1.2.3.dist-info}/AUTHORS.md +0 -0
- {apsg-1.2.2.dist-info → apsg-1.2.3.dist-info}/LICENSE +0 -0
- {apsg-1.2.2.dist-info → apsg-1.2.3.dist-info}/entry_points.txt +0 -0
- {apsg-1.2.2.dist-info → apsg-1.2.3.dist-info}/top_level.txt +0 -0
apsg/feature/_container.py
CHANGED
|
@@ -9,7 +9,7 @@ from apsg.config import apsg_conf
|
|
|
9
9
|
from apsg.math._vector import Vector2, Vector3
|
|
10
10
|
from apsg.helpers._math import acosd
|
|
11
11
|
from apsg.feature._geodata import Lineation, Foliation, Pair, Fault, Cone
|
|
12
|
-
from apsg.feature._tensor3 import OrientationTensor3, Ellipsoid
|
|
12
|
+
from apsg.feature._tensor3 import OrientationTensor3, Ellipsoid, DeformationGradient3
|
|
13
13
|
from apsg.feature._tensor2 import OrientationTensor2, Ellipse
|
|
14
14
|
from apsg.feature._statistics import KentDistribution, vonMisesFisher
|
|
15
15
|
|
|
@@ -938,6 +938,45 @@ class PairSet(FeatureSet):
|
|
|
938
938
|
"""
|
|
939
939
|
return Vector3Set([e.rax for e in self], name=self.name)
|
|
940
940
|
|
|
941
|
+
def angle(self, other=None):
|
|
942
|
+
"""Return angles of all data in ``PairSet`` object
|
|
943
|
+
|
|
944
|
+
Without arguments it returns angles of all pairs in dataset.
|
|
945
|
+
If argument is ``PairSet`` of same length or single data object
|
|
946
|
+
element-wise angles are calculated.
|
|
947
|
+
"""
|
|
948
|
+
res = []
|
|
949
|
+
if other is None:
|
|
950
|
+
res = [
|
|
951
|
+
abs(
|
|
952
|
+
DeformationGradient3.from_two_pairs(
|
|
953
|
+
e, f, symmetry=True
|
|
954
|
+
).axisangle()[1]
|
|
955
|
+
)
|
|
956
|
+
for e, f in combinations(self.data, 2)
|
|
957
|
+
]
|
|
958
|
+
elif issubclass(type(other), PairSet):
|
|
959
|
+
res = [
|
|
960
|
+
abs(
|
|
961
|
+
DeformationGradient3.from_two_pairs(
|
|
962
|
+
e, f, symmetry=True
|
|
963
|
+
).axisangle()[1]
|
|
964
|
+
)
|
|
965
|
+
for e, f in zip(self, other)
|
|
966
|
+
]
|
|
967
|
+
elif issubclass(type(other), Pair):
|
|
968
|
+
res = [
|
|
969
|
+
abs(
|
|
970
|
+
DeformationGradient3.from_two_pairs(
|
|
971
|
+
e, other, symmetry=True
|
|
972
|
+
).axisangle()[1]
|
|
973
|
+
)
|
|
974
|
+
for e in self
|
|
975
|
+
]
|
|
976
|
+
else:
|
|
977
|
+
raise TypeError("Wrong argument type!")
|
|
978
|
+
return np.asarray(res)
|
|
979
|
+
|
|
941
980
|
@property
|
|
942
981
|
def ortensor(self):
|
|
943
982
|
"""Return Lisle (1989) orientation tensor ``OrientationTensor3`` of orientations
|
|
@@ -1111,6 +1150,45 @@ class FaultSet(PairSet):
|
|
|
1111
1150
|
"""Return dihedra planes of FaultSet as FoliationSet"""
|
|
1112
1151
|
return FoliationSet([e.d for e in self], name=self.name + "-D")
|
|
1113
1152
|
|
|
1153
|
+
def angle(self, other=None):
|
|
1154
|
+
"""Return angles of all data in ``FaultSet`` object
|
|
1155
|
+
|
|
1156
|
+
Without arguments it returns angles of all pairs in dataset.
|
|
1157
|
+
If argument is ``FaultSet`` of same length or single data object
|
|
1158
|
+
element-wise angles are calculated.
|
|
1159
|
+
"""
|
|
1160
|
+
res = []
|
|
1161
|
+
if other is None:
|
|
1162
|
+
res = [
|
|
1163
|
+
abs(
|
|
1164
|
+
DeformationGradient3.from_two_pairs(
|
|
1165
|
+
e, f, symmetry=False
|
|
1166
|
+
).axisangle()[1]
|
|
1167
|
+
)
|
|
1168
|
+
for e, f in combinations(self.data, 2)
|
|
1169
|
+
]
|
|
1170
|
+
elif issubclass(type(other), FaultSet):
|
|
1171
|
+
res = [
|
|
1172
|
+
abs(
|
|
1173
|
+
DeformationGradient3.from_two_pairs(
|
|
1174
|
+
e, f, symmetry=False
|
|
1175
|
+
).axisangle()[1]
|
|
1176
|
+
)
|
|
1177
|
+
for e, f in zip(self, other)
|
|
1178
|
+
]
|
|
1179
|
+
elif issubclass(type(other), Fault):
|
|
1180
|
+
res = [
|
|
1181
|
+
abs(
|
|
1182
|
+
DeformationGradient3.from_two_pairs(
|
|
1183
|
+
e, other, symmetry=False
|
|
1184
|
+
).axisangle()[1]
|
|
1185
|
+
)
|
|
1186
|
+
for e in self
|
|
1187
|
+
]
|
|
1188
|
+
else:
|
|
1189
|
+
raise TypeError("Wrong argument type!")
|
|
1190
|
+
return np.asarray(res)
|
|
1191
|
+
|
|
1114
1192
|
@classmethod
|
|
1115
1193
|
def random(cls, n=25):
|
|
1116
1194
|
"""Create PairSet of random pairs"""
|
|
@@ -1578,8 +1656,10 @@ class ClusterSet(object):
|
|
|
1578
1656
|
"""
|
|
1579
1657
|
|
|
1580
1658
|
def __init__(self, d, **kwargs):
|
|
1581
|
-
assert
|
|
1582
|
-
d,
|
|
1659
|
+
assert (
|
|
1660
|
+
isinstance(d, Vector2Set)
|
|
1661
|
+
or isinstance(d, Vector3Set)
|
|
1662
|
+
or isinstance(d, PairSet)
|
|
1583
1663
|
), "Only vec2set or vecset could be clustered"
|
|
1584
1664
|
self.data = d.copy()
|
|
1585
1665
|
self.maxclust = kwargs.get("maxclust", 2)
|
apsg/math/_vector.py
CHANGED
|
@@ -84,9 +84,6 @@ class Vector:
|
|
|
84
84
|
|
|
85
85
|
__pos__ = __copy__
|
|
86
86
|
|
|
87
|
-
def __pow__(self, other):
|
|
88
|
-
return type(self)(np.power(self, other))
|
|
89
|
-
|
|
90
87
|
def __abs__(self):
|
|
91
88
|
return math.sqrt(sum(map(lambda x: x * x, self._coords)))
|
|
92
89
|
|
|
@@ -452,6 +449,12 @@ class Vector3(Vector):
|
|
|
452
449
|
else:
|
|
453
450
|
return float(r)
|
|
454
451
|
|
|
452
|
+
def __pow__(self, other):
|
|
453
|
+
if issubclass(type(other), Vector3):
|
|
454
|
+
return self.cross(other)
|
|
455
|
+
else:
|
|
456
|
+
return type(self)(np.power(self, other))
|
|
457
|
+
|
|
455
458
|
@ensure_first_arg_same
|
|
456
459
|
def cross(self, other):
|
|
457
460
|
"""
|
apsg/plotting/_stereonet.py
CHANGED
|
@@ -951,38 +951,39 @@ def quicknet(*args, **kwargs):
|
|
|
951
951
|
filename = kwargs.get("filename", "stereonet.png")
|
|
952
952
|
savefig_kwargs = kwargs.get("savefig_kwargs", {})
|
|
953
953
|
fol_as_pole = kwargs.get("fol_as_pole", False)
|
|
954
|
+
label = kwargs.get("label", "_nolegend_")
|
|
954
955
|
s = StereoNet(**kwargs)
|
|
955
956
|
for arg in args:
|
|
956
957
|
if isinstance(arg, Vector3):
|
|
957
958
|
if isinstance(arg, Foliation):
|
|
958
959
|
if fol_as_pole:
|
|
959
|
-
s.pole(arg)
|
|
960
|
+
s.pole(arg, label=label)
|
|
960
961
|
else:
|
|
961
|
-
s.great_circle(arg)
|
|
962
|
+
s.great_circle(arg, label=label)
|
|
962
963
|
elif isinstance(arg, Lineation):
|
|
963
|
-
s.line(arg)
|
|
964
|
+
s.line(arg, label=label)
|
|
964
965
|
else:
|
|
965
|
-
s.vector(arg)
|
|
966
|
+
s.vector(arg, label=label)
|
|
966
967
|
elif isinstance(arg, Fault):
|
|
967
|
-
s.fault(arg)
|
|
968
|
+
s.fault(arg, label=label)
|
|
968
969
|
elif isinstance(arg, Pair):
|
|
969
|
-
s.pair(arg)
|
|
970
|
+
s.pair(arg, label=label)
|
|
970
971
|
elif isinstance(arg, Cone):
|
|
971
|
-
s.cone(arg)
|
|
972
|
+
s.cone(arg, label=label)
|
|
972
973
|
elif isinstance(arg, Vector3Set):
|
|
973
974
|
if isinstance(arg, FoliationSet):
|
|
974
975
|
if fol_as_pole:
|
|
975
|
-
s.pole(arg)
|
|
976
|
+
s.pole(arg, label=label)
|
|
976
977
|
else:
|
|
977
|
-
s.great_circle(arg)
|
|
978
|
+
s.great_circle(arg, label=label)
|
|
978
979
|
elif isinstance(arg, LineationSet):
|
|
979
|
-
s.line(arg)
|
|
980
|
+
s.line(arg, label=label)
|
|
980
981
|
else:
|
|
981
|
-
s.vector(arg)
|
|
982
|
+
s.vector(arg, label=label)
|
|
982
983
|
elif isinstance(arg, FaultSet):
|
|
983
|
-
s.fault(arg)
|
|
984
|
+
s.fault(arg, label=label)
|
|
984
985
|
elif isinstance(arg, PairSet):
|
|
985
|
-
s.pair(arg)
|
|
986
|
+
s.pair(arg, label=label)
|
|
986
987
|
else:
|
|
987
988
|
print(f"{type(arg)} not supported.")
|
|
988
989
|
if savefig:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: apsg
|
|
3
|
-
Version: 1.2.
|
|
3
|
+
Version: 1.2.3
|
|
4
4
|
Summary: APSG - The package for structural geologists
|
|
5
5
|
Home-page: https://github.com/ondrolexa/apsg
|
|
6
6
|
Author: Ondrej Lexa
|
|
@@ -140,6 +140,14 @@ APSG is free software: you can redistribute it and/or modify it under the terms
|
|
|
140
140
|
|
|
141
141
|
# Changes
|
|
142
142
|
|
|
143
|
+
### 1.2.3 (Nov 18 2024)
|
|
144
|
+
* ClusterSet accepts PairSet and FaultSet
|
|
145
|
+
* quicknet label option added
|
|
146
|
+
* vector pow bug fix
|
|
147
|
+
|
|
148
|
+
### 1.2.2 (Oct 21 2024)
|
|
149
|
+
* Fault sense could be defined by str, one of 's', 'd', 'n' and 'r'
|
|
150
|
+
|
|
143
151
|
### 1.2.1 (Sep 23 2024)
|
|
144
152
|
* Fault sense could be defined by str, one of 's', 'd', 'n' and 'r'
|
|
145
153
|
|
|
@@ -7,7 +7,7 @@ apsg/database/_sdbread.py,sha256=Gzj0bpp0vnMvCfxIuX6Ktf01LoQWDCOcXST7HZp_XTY,108
|
|
|
7
7
|
apsg/decorator/__init__.py,sha256=fZ-dxpldQIk6-2JhVnCj-Tsl8bz2nvoGOyG7uXKvBfg,160
|
|
8
8
|
apsg/decorator/_decorator.py,sha256=8TMSrcVvhU5UCbNMrnyrW3-65qo20_6N2ShtXd3bP-k,1194
|
|
9
9
|
apsg/feature/__init__.py,sha256=XGLq3GXpiWtzX6ROtuSc0kCPJEPTVRoIUtr8VpRZOWI,1664
|
|
10
|
-
apsg/feature/_container.py,sha256=
|
|
10
|
+
apsg/feature/_container.py,sha256=2hQtc6a5Z6puwfHcia4AAXsFoD8OuXO-Iqfbq6zRmnw,59283
|
|
11
11
|
apsg/feature/_geodata.py,sha256=NJ6jZJbq_-DX2ZLADEf5AMsPzz0T17RLizIq3uH_i7U,22553
|
|
12
12
|
apsg/feature/_paleomag.py,sha256=WIICUOEJGGFHbCDF0gbW7lMt10jI0el0UVhkbMH7XAs,14911
|
|
13
13
|
apsg/feature/_statistics.py,sha256=WwBU2D7SyIHMpWnO7WFqbIpSkz6KUCT9xkG8oVzgskQ,13916
|
|
@@ -19,7 +19,7 @@ apsg/helpers/_math.py,sha256=NLHw9UGiSlNggwZB-o0ORpG2sY00qIcbMbDJftRWFE8,896
|
|
|
19
19
|
apsg/helpers/_notation.py,sha256=oSxvZdv06eJ5GotS2IwbAJ-8UTZ49z8slqdhUDQJ9e8,2486
|
|
20
20
|
apsg/math/__init__.py,sha256=qJa4JP79nXn-6Xb7aaZUPWmz0qadmC4F0tGORTOZDVI,211
|
|
21
21
|
apsg/math/_matrix.py,sha256=iXeBoTepWsPCNX4zPGQj9NM4TT6aNACVESDFSP9BQPE,10398
|
|
22
|
-
apsg/math/_vector.py,sha256=
|
|
22
|
+
apsg/math/_vector.py,sha256=mD8kYggfGys-XWtnE90X2ZcTGBtDN49wEAUXQYXj3dI,16587
|
|
23
23
|
apsg/pandas/__init__.py,sha256=jmlsulHmH9IbErJgSWlJx1J33-v--O5zxSE4kdt6fUI,456
|
|
24
24
|
apsg/pandas/_pandas_api.py,sha256=_WpY5QJYAYZv9116xjWS0hOX2sgYcsGMPoSab7MWUFc,13875
|
|
25
25
|
apsg/plotting/__init__.py,sha256=immav5OfKhYlOGZWUsFjuBp7k71vr2xLYygQkO6Oimc,627
|
|
@@ -29,11 +29,11 @@ apsg/plotting/_plot_artists.py,sha256=6S0EKCqYU6rlBxcxcXALTk9PaUK6QL-BgUKmZH8tkM
|
|
|
29
29
|
apsg/plotting/_projection.py,sha256=qnJgTQaFW0v2Pu9ySAEPADHhLgpXmfJ6QIrydry8rXQ,11473
|
|
30
30
|
apsg/plotting/_roseplot.py,sha256=wqXo6b0k7lEvMrnByJYuoR_cuK1QIYZyZkObvigUx-g,12809
|
|
31
31
|
apsg/plotting/_stereogrid.py,sha256=Buj0kp5P4cvTPowN6Jyt8wzvRMu3h5If1pwVWaal53M,11981
|
|
32
|
-
apsg/plotting/_stereonet.py,sha256=
|
|
33
|
-
apsg-1.2.
|
|
34
|
-
apsg-1.2.
|
|
35
|
-
apsg-1.2.
|
|
36
|
-
apsg-1.2.
|
|
37
|
-
apsg-1.2.
|
|
38
|
-
apsg-1.2.
|
|
39
|
-
apsg-1.2.
|
|
32
|
+
apsg/plotting/_stereonet.py,sha256=EMklIw7aWwzDUI2xTRHIBTya-yKiWuPUkPDB8Zz2KNA,36704
|
|
33
|
+
apsg-1.2.3.dist-info/AUTHORS.md,sha256=OEu_2jVMx1fm5EOj4vBlI04uvX4P2sqjPYP12VjPIcI,130
|
|
34
|
+
apsg-1.2.3.dist-info/LICENSE,sha256=NhDqn8b2aOSNn4U4tCfJTOQ6jeggFpLIBgJrAkzdiH0,1117
|
|
35
|
+
apsg-1.2.3.dist-info/METADATA,sha256=O1_PeJhALpIYZNRI9j4M4BarkxOjl2z16YzbkPkSMs4,15570
|
|
36
|
+
apsg-1.2.3.dist-info/WHEEL,sha256=0VNUDWQJzfRahYI3neAhz2UVbRCtztpN5dPHAGvmGXc,109
|
|
37
|
+
apsg-1.2.3.dist-info/entry_points.txt,sha256=SowP7_uRI0NJuzznKBXyM9BJcSwBxbXo6Iz5LUo9mEQ,42
|
|
38
|
+
apsg-1.2.3.dist-info/top_level.txt,sha256=xWxwi0nqqOyKdmpsszfR-bmqnNpgVbhnLRuIKGJnaUM,5
|
|
39
|
+
apsg-1.2.3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|