apsg 1.2.2__tar.gz → 1.2.3__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 (67) hide show
  1. {apsg-1.2.2 → apsg-1.2.3}/HISTORY.md +8 -0
  2. {apsg-1.2.2 → apsg-1.2.3}/PKG-INFO +9 -1
  3. {apsg-1.2.2 → apsg-1.2.3}/docs/conf.py +1 -1
  4. {apsg-1.2.2 → apsg-1.2.3}/setup.cfg +1 -1
  5. {apsg-1.2.2 → apsg-1.2.3}/setup.py +1 -1
  6. {apsg-1.2.2 → apsg-1.2.3}/src/apsg/feature/_container.py +83 -3
  7. {apsg-1.2.2 → apsg-1.2.3}/src/apsg/math/_vector.py +6 -3
  8. {apsg-1.2.2 → apsg-1.2.3}/src/apsg/plotting/_stereonet.py +14 -13
  9. {apsg-1.2.2 → apsg-1.2.3}/src/apsg.egg-info/PKG-INFO +9 -1
  10. {apsg-1.2.2 → apsg-1.2.3}/AUTHORS.md +0 -0
  11. {apsg-1.2.2 → apsg-1.2.3}/CONTRIBUTING.md +0 -0
  12. {apsg-1.2.2 → apsg-1.2.3}/LICENSE +0 -0
  13. {apsg-1.2.2 → apsg-1.2.3}/MANIFEST.in +0 -0
  14. {apsg-1.2.2 → apsg-1.2.3}/README.md +0 -0
  15. {apsg-1.2.2 → apsg-1.2.3}/docs/Makefile +0 -0
  16. {apsg-1.2.2 → apsg-1.2.3}/docs/apsg.database.rst +0 -0
  17. {apsg-1.2.2 → apsg-1.2.3}/docs/apsg.feature.rst +0 -0
  18. {apsg-1.2.2 → apsg-1.2.3}/docs/apsg.helpers.rst +0 -0
  19. {apsg-1.2.2 → apsg-1.2.3}/docs/apsg.math.rst +0 -0
  20. {apsg-1.2.2 → apsg-1.2.3}/docs/apsg.pandas.rst +0 -0
  21. {apsg-1.2.2 → apsg-1.2.3}/docs/apsg.plotting.rst +0 -0
  22. {apsg-1.2.2 → apsg-1.2.3}/docs/authors.rst +0 -0
  23. {apsg-1.2.2 → apsg-1.2.3}/docs/automodules.rst +0 -0
  24. {apsg-1.2.2 → apsg-1.2.3}/docs/contributing.rst +0 -0
  25. {apsg-1.2.2 → apsg-1.2.3}/docs/index.rst +0 -0
  26. {apsg-1.2.2 → apsg-1.2.3}/docs/installation.rst +0 -0
  27. {apsg-1.2.2 → apsg-1.2.3}/docs/make.bat +0 -0
  28. {apsg-1.2.2 → apsg-1.2.3}/docs/tutorials.rst +0 -0
  29. {apsg-1.2.2 → apsg-1.2.3}/pyproject.toml +0 -0
  30. {apsg-1.2.2 → apsg-1.2.3}/src/apsg/__init__.py +0 -0
  31. {apsg-1.2.2 → apsg-1.2.3}/src/apsg/config.py +0 -0
  32. {apsg-1.2.2 → apsg-1.2.3}/src/apsg/database/__init__.py +0 -0
  33. {apsg-1.2.2 → apsg-1.2.3}/src/apsg/database/_alchemy.py +0 -0
  34. {apsg-1.2.2 → apsg-1.2.3}/src/apsg/database/_sdbread.py +0 -0
  35. {apsg-1.2.2 → apsg-1.2.3}/src/apsg/decorator/__init__.py +0 -0
  36. {apsg-1.2.2 → apsg-1.2.3}/src/apsg/decorator/_decorator.py +0 -0
  37. {apsg-1.2.2 → apsg-1.2.3}/src/apsg/feature/__init__.py +0 -0
  38. {apsg-1.2.2 → apsg-1.2.3}/src/apsg/feature/_geodata.py +0 -0
  39. {apsg-1.2.2 → apsg-1.2.3}/src/apsg/feature/_paleomag.py +0 -0
  40. {apsg-1.2.2 → apsg-1.2.3}/src/apsg/feature/_statistics.py +0 -0
  41. {apsg-1.2.2 → apsg-1.2.3}/src/apsg/feature/_tensor2.py +0 -0
  42. {apsg-1.2.2 → apsg-1.2.3}/src/apsg/feature/_tensor3.py +0 -0
  43. {apsg-1.2.2 → apsg-1.2.3}/src/apsg/helpers/__init__.py +0 -0
  44. {apsg-1.2.2 → apsg-1.2.3}/src/apsg/helpers/_helper.py +0 -0
  45. {apsg-1.2.2 → apsg-1.2.3}/src/apsg/helpers/_math.py +0 -0
  46. {apsg-1.2.2 → apsg-1.2.3}/src/apsg/helpers/_notation.py +0 -0
  47. {apsg-1.2.2 → apsg-1.2.3}/src/apsg/math/__init__.py +0 -0
  48. {apsg-1.2.2 → apsg-1.2.3}/src/apsg/math/_matrix.py +0 -0
  49. {apsg-1.2.2 → apsg-1.2.3}/src/apsg/pandas/__init__.py +0 -0
  50. {apsg-1.2.2 → apsg-1.2.3}/src/apsg/pandas/_pandas_api.py +0 -0
  51. {apsg-1.2.2 → apsg-1.2.3}/src/apsg/plotting/__init__.py +0 -0
  52. {apsg-1.2.2 → apsg-1.2.3}/src/apsg/plotting/_fabricplot.py +0 -0
  53. {apsg-1.2.2 → apsg-1.2.3}/src/apsg/plotting/_paleomagplots.py +0 -0
  54. {apsg-1.2.2 → apsg-1.2.3}/src/apsg/plotting/_plot_artists.py +0 -0
  55. {apsg-1.2.2 → apsg-1.2.3}/src/apsg/plotting/_projection.py +0 -0
  56. {apsg-1.2.2 → apsg-1.2.3}/src/apsg/plotting/_roseplot.py +0 -0
  57. {apsg-1.2.2 → apsg-1.2.3}/src/apsg/plotting/_stereogrid.py +0 -0
  58. {apsg-1.2.2 → apsg-1.2.3}/src/apsg/shell.py +0 -0
  59. {apsg-1.2.2 → apsg-1.2.3}/src/apsg.egg-info/SOURCES.txt +0 -0
  60. {apsg-1.2.2 → apsg-1.2.3}/src/apsg.egg-info/dependency_links.txt +0 -0
  61. {apsg-1.2.2 → apsg-1.2.3}/src/apsg.egg-info/entry_points.txt +0 -0
  62. {apsg-1.2.2 → apsg-1.2.3}/src/apsg.egg-info/requires.txt +0 -0
  63. {apsg-1.2.2 → apsg-1.2.3}/src/apsg.egg-info/top_level.txt +0 -0
  64. {apsg-1.2.2 → apsg-1.2.3}/tests/__init__.py +0 -0
  65. {apsg-1.2.2 → apsg-1.2.3}/tests/conftest.py +0 -0
  66. {apsg-1.2.2 → apsg-1.2.3}/tests/test_apsg.py +0 -0
  67. {apsg-1.2.2 → apsg-1.2.3}/tests/test_tensors.py +0 -0
@@ -1,5 +1,13 @@
1
1
  # Changes
2
2
 
3
+ ### 1.2.3 (Nov 18 2024)
4
+ * ClusterSet accepts PairSet and FaultSet
5
+ * quicknet label option added
6
+ * vector pow bug fix
7
+
8
+ ### 1.2.2 (Oct 21 2024)
9
+ * Fault sense could be defined by str, one of 's', 'd', 'n' and 'r'
10
+
3
11
  ### 1.2.1 (Sep 23 2024)
4
12
  * Fault sense could be defined by str, one of 's', 'd', 'n' and 'r'
5
13
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: apsg
3
- Version: 1.2.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
 
@@ -71,7 +71,7 @@ copyright = "2024, Ondrej Lexa"
71
71
  # The short X.Y version.
72
72
  version = "1.2"
73
73
  # The full version, including alpha/beta/rc tags.
74
- release = "1.2.2"
74
+ release = "1.2.3"
75
75
 
76
76
  # The language for content autogenerated by Sphinx. Refer to documentation
77
77
  # for a list of supported languages.
@@ -1,5 +1,5 @@
1
1
  [bumpversion]
2
- current_version = 1.2.2
2
+ current_version = 1.2.3
3
3
  commit = False
4
4
  tag = False
5
5
 
@@ -17,7 +17,7 @@ with open(path.join(CURRENT_PATH, "HISTORY.md")) as file:
17
17
 
18
18
  setup(
19
19
  name="apsg",
20
- version="1.2.2",
20
+ version="1.2.3",
21
21
  description="APSG - The package for structural geologists",
22
22
  long_description=readme + "\n\n" + history,
23
23
  long_description_content_type="text/markdown",
@@ -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 isinstance(d, Vector2Set) or isinstance(
1582
- d, Vector3Set
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)
@@ -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
  """
@@ -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.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
 
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