apsg 1.1.4__py2.py3-none-any.whl → 1.1.5__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/__init__.py CHANGED
@@ -98,6 +98,6 @@ __all__ = (
98
98
  "quicknet",
99
99
  )
100
100
 
101
- __version__ = "1.1.4"
101
+ __version__ = "1.1.5"
102
102
  __author__ = "Ondrej Lexa"
103
103
  __email__ = "lexa.ondrej@gmail.com"
@@ -142,18 +142,18 @@ class Vector2Set(FeatureSet):
142
142
  return np.asarray([e.direction for e in self]).T
143
143
 
144
144
  def proj(self, vec):
145
- """Return projections of all features in ``FeatureSet`` onto vector."""
145
+ """Return projections of all features in ``Vector2Set`` onto vector."""
146
146
  return type(self)([e.project() for e in self], name=self.name)
147
147
 
148
148
  def dot(self, vec):
149
- """Return array of dot products of all features in ``FeatureSet`` with vector."""
149
+ """Return array of dot products of all features in ``Vector2Set`` with vector."""
150
150
  return np.array([e.dot(vec) for e in self])
151
151
 
152
152
  def cross(self, other=None):
153
- """Return cross products of all features in ``FeatureSet``
153
+ """Return cross products of all features in ``Vector2Set``
154
154
 
155
155
  Without arguments it returns cross product of all pairs in dataset.
156
- If argument is ``FeatureSet`` of same length or single data object
156
+ If argument is ``Vector2Set`` of same length or single data object
157
157
  element-wise cross-products are calculated.
158
158
  """
159
159
  res = []
@@ -170,10 +170,10 @@ class Vector2Set(FeatureSet):
170
170
  __pow__ = cross
171
171
 
172
172
  def angle(self, other=None):
173
- """Return angles of all data in ``FeatureSet`` object
173
+ """Return angles of all data in ``Vector2Set`` object
174
174
 
175
175
  Without arguments it returns angles of all pairs in dataset.
176
- If argument is ``FeatureSet`` of same length or single data object
176
+ If argument is ``Vector2Set`` of same length or single data object
177
177
  element-wise angles are calculated.
178
178
  """
179
179
  res = []
@@ -188,13 +188,13 @@ class Vector2Set(FeatureSet):
188
188
  return np.asarray(res)
189
189
 
190
190
  def normalized(self):
191
- """Return ``FeatureSet`` object with normalized (unit length) elements."""
191
+ """Return ``Vector2Set`` object with normalized (unit length) elements."""
192
192
  return type(self)([e.normalized() for e in self], name=self.name)
193
193
 
194
194
  uv = normalized
195
195
 
196
196
  def transform(self, F, **kwargs):
197
- """Return affine transformation of all features ``FeatureSet`` by matrix 'F'.
197
+ """Return affine transformation of all features ``Vector2Set`` by matrix 'F'.
198
198
 
199
199
  Args:
200
200
  F: Transformation matrix. Array-like value e.g. ``DeformationGradient3``
@@ -206,12 +206,12 @@ class Vector2Set(FeatureSet):
206
206
  return type(self)([e.transform(F, **kwargs) for e in self], name=self.name)
207
207
 
208
208
  def R(self, mean=False):
209
- """Return resultant of data in ``FeatureSet`` object.
209
+ """Return resultant of data in ``Vector2Set`` object.
210
210
 
211
- Resultant is of same type as features in ``FeatureSet``. Note
212
- that ``Foliation`` and ``Lineation`` are axial in nature so
213
- resultant can give other result than expected. Anyway for axial
214
- data orientation tensor analysis will give you right answer.
211
+ Resultant is of same type as features in ``Vector2Set``. Note
212
+ that ``Axial2`` is axial in nature so resultant can give
213
+ other result than expected. Anyway for axial data orientation
214
+ tensor analysis will give you right answer.
215
215
 
216
216
  Args:
217
217
  mean: if True returns mean resultant. Default False
@@ -254,7 +254,7 @@ class Vector2Set(FeatureSet):
254
254
  return acosd(abs(self.R(mean=True)))
255
255
 
256
256
  def rdegree(self):
257
- """Degree of preffered orientation of vectors in ``FeatureSet``.
257
+ """Degree of preffered orientation of vectors in ``Vector2Set``.
258
258
 
259
259
  D = 100 * (2 * abs(R) - n) / n
260
260
  """
@@ -279,7 +279,7 @@ class Vector2Set(FeatureSet):
279
279
  return self._cache["svd"]
280
280
 
281
281
  def halfspace(self):
282
- """Change orientation of vectors in ``FeatureSet``, so all have angle<=90 with
282
+ """Change orientation of vectors in ``Vector2Set``, so all have angle<=90 with
283
283
  resultant.
284
284
 
285
285
  """
@@ -298,13 +298,13 @@ class Vector2Set(FeatureSet):
298
298
 
299
299
  @classmethod
300
300
  def from_direction(cls, angles, name="Default"):
301
- """Create ``FeatureSet`` object from arrays of direction angles
301
+ """Create ``Vector2Set`` object from arrays of direction angles
302
302
 
303
303
  Args:
304
304
  angles: list or angles
305
305
 
306
306
  Keyword Args:
307
- name: name of ``FeatureSet`` object. Default is 'Default'
307
+ name: name of ``Vector2Set`` object. Default is 'Default'
308
308
 
309
309
  Example:
310
310
  >>> f = vec2set.from_angles([120,130,140,125, 132. 131])
@@ -314,14 +314,14 @@ class Vector2Set(FeatureSet):
314
314
 
315
315
  @classmethod
316
316
  def from_xy(cls, x, y, name="Default"):
317
- """Create ``FeatureSet`` object from arrays of x and y components
317
+ """Create ``Vector2Set`` object from arrays of x and y components
318
318
 
319
319
  Args:
320
320
  x: list or array of x components
321
321
  y: list or array of y components
322
322
 
323
323
  Keyword Args:
324
- name: name of ``FeatureSet`` object. Default is 'Default'
324
+ name: name of ``Vector2Set`` object. Default is 'Default'
325
325
 
326
326
  Example:
327
327
  >>> v = vec2set.from_xy([-0.4330127, -0.4330127, -0.66793414],
@@ -332,7 +332,7 @@ class Vector2Set(FeatureSet):
332
332
 
333
333
  @classmethod
334
334
  def random(cls, n=100, name="Default"):
335
- """Method to create ``FeatureSet`` of features with uniformly distributed
335
+ """Method to create ``Vector2Set`` of features with uniformly distributed
336
336
  random orientation.
337
337
 
338
338
  Keyword Args:
@@ -349,7 +349,7 @@ class Vector2Set(FeatureSet):
349
349
 
350
350
  @classmethod
351
351
  def random_vonmises(cls, n=100, position=0, kappa=5, name="Default"):
352
- """Return ``FeatureSet`` of random vectors sampled from von Mises distribution
352
+ """Return ``Vector2Set`` of random vectors sampled from von Mises distribution
353
353
  around center position with concentration kappa.
354
354
 
355
355
  Args:
apsg/feature/_paleomag.py CHANGED
@@ -156,10 +156,10 @@ class Core(object):
156
156
  infoln = "{:<8} a={:5.1f} b={:5.1f} s={:5.1f} d={:5.1f} v={}m3 {}"
157
157
  ln0 = infoln.format(
158
158
  ff,
159
- self.gref.lin.dd[0],
160
- self.gref.lin.dd[1],
161
- self.bedding.dd[0],
162
- self.bedding.dd[1],
159
+ self.gref.lin.geo[0],
160
+ self.gref.lin.geo[1],
161
+ self.bedding.geo[0],
162
+ self.bedding.geo[1],
163
163
  eformat(self.volume, 2),
164
164
  dt,
165
165
  )
@@ -274,7 +274,7 @@ class Core(object):
274
274
  data["a95"] = body[ix]["Prec"].to_list()
275
275
  data["vectors"] = []
276
276
  for n, r in body[ix].iterrows():
277
- data["vectors"].append(r[2] * Vector3(r["Dsp"], r["Isp"]))
277
+ data["vectors"].append(r.iloc[2] * Vector3(r["Dsp"], r["Isp"]))
278
278
  return cls(**data)
279
279
 
280
280
  def write_rs3(self, filename=None):
@@ -295,14 +295,14 @@ class Core(object):
295
295
  latitude = self.latitude if self.latitude is not None else ""
296
296
  longitude = self.longitude if self.longitude is not None else ""
297
297
  height = self.height if self.height is not None else ""
298
- sdec, sinc = (round(self.gref.fol.dd[0]), round(self.gref.fol.dd[1]))
298
+ sdec, sinc = (round(self.gref.fol.geo[0]), round(self.gref.fol.geo[1]))
299
299
  bdec, binc = (
300
- (round(self.bedding.dd[0]), round(self.bedding.dd[1]))
300
+ (round(self.bedding.geo[0]), round(self.bedding.geo[1]))
301
301
  if self.bedding is not None
302
302
  else ("", "")
303
303
  )
304
304
  fdec, finc = (
305
- (round(self.foldaxis.dd[0]), round(self.foldaxis.dd[1]))
305
+ (round(self.foldaxis.geo[0]), round(self.foldaxis.geo[1]))
306
306
  if self.foldaxis is not None
307
307
  else ("", "")
308
308
  )
@@ -324,7 +324,7 @@ class Core(object):
324
324
  self.a95,
325
325
  self.comments,
326
326
  ):
327
- ln = f"{id:2} {step:<10} {MAG:>13g} {V.dd[0]:>5.1f} {V.dd[1]:> 5.1f} {geo.dd[0]:>5.1f} {geo.dd[1]:> 5.1f} {tilt.dd[0]:>5.1f} {tilt.dd[1]:> 5.1f} {a95:>5.1f} {comment:10}"
327
+ ln = f"{id:2} {step:<10} {MAG:>13g} {V.geo[0]:>5.1f} {V.geo[1]:> 5.1f} {geo.geo[0]:>5.1f} {geo.geo[1]:> 5.1f} {tilt.geo[0]:>5.1f} {tilt.geo[1]:> 5.1f} {a95:>5.1f} {comment:10}"
328
328
  print(ln, file=res3file, end="\r\n")
329
329
 
330
330
  @property
@@ -342,14 +342,14 @@ class Core(object):
342
342
  ):
343
343
  ln = "{:<4} {: 9.2E} {: 9.2E} {: 9.2E} {: 9.2E} {:5.1f} {:5.1f} {:5.1f} {:5.1f} {:4.1f} {}".format(
344
344
  step,
345
- V[0],
346
- V[1],
347
- V[2],
345
+ V.x,
346
+ V.y,
347
+ V.z,
348
348
  MAG,
349
- geo.dd[0],
350
- geo.dd[1],
351
- tilt.dd[0],
352
- tilt.dd[1],
349
+ geo.geo[0],
350
+ geo.geo[1],
351
+ tilt.geo[0],
352
+ tilt.geo[1],
353
353
  a95,
354
354
  comment,
355
355
  )
@@ -399,7 +399,7 @@ class Core(object):
399
399
  def tilt(self):
400
400
  """Returns ``Vector3Set`` of vectors in tilt‐corrected coordinates system"""
401
401
  return self.geo.rotate(
402
- Lineation(self.bedding.dd[0] - 90, 0), -self.bedding.dd[1]
402
+ Lineation(self.bedding.geo[0] - 90, 0), -self.bedding.geo[1]
403
403
  )
404
404
 
405
405
  def pca(self, kind="geo", origin=False):
apsg/helpers/_math.py CHANGED
@@ -22,12 +22,12 @@ def tand(x):
22
22
 
23
23
  def asind(x):
24
24
  """Calculate arc sine in degrees"""
25
- return math.degrees(math.asin(x))
25
+ return math.degrees(math.asin(max(min(x, 1), -1)))
26
26
 
27
27
 
28
28
  def acosd(x):
29
29
  """Calculate arc cosine in degrees"""
30
- return math.degrees(math.acos(x))
30
+ return math.degrees(math.acos(max(min(x, 1), -1)))
31
31
 
32
32
 
33
33
  def atand(x):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: apsg
3
- Version: 1.1.4
3
+ Version: 1.1.5
4
4
  Summary: APSG - The package for structural geologists
5
5
  Home-page: https://github.com/ondrolexa/apsg
6
6
  Author: Ondrej Lexa
@@ -139,6 +139,10 @@ APSG is free software: you can redistribute it and/or modify it under the terms
139
139
 
140
140
  # Changes
141
141
 
142
+ ### 1.1.5 (May 15 2024)
143
+ * paleomag Core .dd bug fixed
144
+ * fix round-off domain math error for acosd and asind
145
+
142
146
  ### 1.1.4 (Dec 13 2023)
143
147
  * Ellipsoid repr bugfix
144
148
 
@@ -1,4 +1,4 @@
1
- apsg/__init__.py,sha256=qgM9ZH_wFZWRlZ9J-NUmYnT6ZnIFDdtW1rj0XyI7J3Q,1966
1
+ apsg/__init__.py,sha256=6Iaw3uD3tBDYuGkMgEO7DQgCKgti9Jm5JMDACeay844,1966
2
2
  apsg/config.py,sha256=X3_yXT96xXlVxFA94EfYFKJbrcGIHT0PvB9s8EKmYOg,4569
3
3
  apsg/shell.py,sha256=UFIOy01KckLsOlqfB0UomyWZ1ITL36-lBUFhlxWdZLE,718
4
4
  apsg/database/__init__.py,sha256=7Rvcf1KBBBNhoM28ZlvQ01CkScQTroFkoS4d1kD55Ws,315
@@ -7,15 +7,15 @@ 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=H2U_ZkVz6gRJUrQO81-f10z9HnuIDgYuVeYqbvb7gjU,56081
10
+ apsg/feature/_container.py,sha256=KxVO9nwvzlCI3GJOKCpk0P2_uV1WP7c7JOm_26EvbKY,56059
11
11
  apsg/feature/_geodata.py,sha256=rI2i9ecBLw5icsJ_NEjxRQEuBrfsFbMn7E22TmvNosk,21462
12
- apsg/feature/_paleomag.py,sha256=7PrFIpZzbYas02QPKQLgxCbmw_LGvu19bSRpru3-uko,14887
12
+ apsg/feature/_paleomag.py,sha256=WIICUOEJGGFHbCDF0gbW7lMt10jI0el0UVhkbMH7XAs,14911
13
13
  apsg/feature/_statistics.py,sha256=WwBU2D7SyIHMpWnO7WFqbIpSkz6KUCT9xkG8oVzgskQ,13916
14
14
  apsg/feature/_tensor2.py,sha256=-S-fI7_97UmJG78Q2gnXVUD_Qu7k0J9BXJ_AcoEKkOo,12397
15
15
  apsg/feature/_tensor3.py,sha256=Js4wRgMUClEQQpRnJZ5NiYRnBC1W3k0UC4ohRcNH16Y,27973
16
16
  apsg/helpers/__init__.py,sha256=6SF_Srq6fS-uomvpwdW0JSQs-tmWnzUoTk4a1K_J1aE,532
17
17
  apsg/helpers/_helper.py,sha256=1Xf1yiNYIEoUJqXH4C0390osGWk6AERr_LrCSTnsRVw,146
18
- apsg/helpers/_math.py,sha256=OqY8W2YBfmMuTiuixzqJFqL5HWUUserZZ9KYL2dQwwk,862
18
+ 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
@@ -30,10 +30,10 @@ apsg/plotting/_projection.py,sha256=qnJgTQaFW0v2Pu9ySAEPADHhLgpXmfJ6QIrydry8rXQ,
30
30
  apsg/plotting/_roseplot.py,sha256=wqXo6b0k7lEvMrnByJYuoR_cuK1QIYZyZkObvigUx-g,12809
31
31
  apsg/plotting/_stereogrid.py,sha256=Buj0kp5P4cvTPowN6Jyt8wzvRMu3h5If1pwVWaal53M,11981
32
32
  apsg/plotting/_stereonet.py,sha256=LgAuKDSTRl1eCuCbhFJcKEdYr-ScfJmeqO-msbwOIC4,36506
33
- apsg-1.1.4.dist-info/AUTHORS.md,sha256=OEu_2jVMx1fm5EOj4vBlI04uvX4P2sqjPYP12VjPIcI,130
34
- apsg-1.1.4.dist-info/LICENSE,sha256=NhDqn8b2aOSNn4U4tCfJTOQ6jeggFpLIBgJrAkzdiH0,1117
35
- apsg-1.1.4.dist-info/METADATA,sha256=LpCf9nXbo7BKTeXR01C3Si0Q5eG7I-leby6P0vMbodo,15049
36
- apsg-1.1.4.dist-info/WHEEL,sha256=-G_t0oGuE7UD0DrSpVZnq1hHMBV9DD2XkS5v7XpmTnk,110
37
- apsg-1.1.4.dist-info/entry_points.txt,sha256=SowP7_uRI0NJuzznKBXyM9BJcSwBxbXo6Iz5LUo9mEQ,42
38
- apsg-1.1.4.dist-info/top_level.txt,sha256=xWxwi0nqqOyKdmpsszfR-bmqnNpgVbhnLRuIKGJnaUM,5
39
- apsg-1.1.4.dist-info/RECORD,,
33
+ apsg-1.1.5.dist-info/AUTHORS.md,sha256=OEu_2jVMx1fm5EOj4vBlI04uvX4P2sqjPYP12VjPIcI,130
34
+ apsg-1.1.5.dist-info/LICENSE,sha256=NhDqn8b2aOSNn4U4tCfJTOQ6jeggFpLIBgJrAkzdiH0,1117
35
+ apsg-1.1.5.dist-info/METADATA,sha256=fONgSyncfVwVzTXpaax-PbZakRKvnBV1SfSiL5TAElA,15160
36
+ apsg-1.1.5.dist-info/WHEEL,sha256=DZajD4pwLWue70CAfc7YaxT1wLUciNBvN_TTcvXpltE,110
37
+ apsg-1.1.5.dist-info/entry_points.txt,sha256=SowP7_uRI0NJuzznKBXyM9BJcSwBxbXo6Iz5LUo9mEQ,42
38
+ apsg-1.1.5.dist-info/top_level.txt,sha256=xWxwi0nqqOyKdmpsszfR-bmqnNpgVbhnLRuIKGJnaUM,5
39
+ apsg-1.1.5.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.42.0)
2
+ Generator: bdist_wheel (0.43.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py2-none-any
5
5
  Tag: py3-none-any
File without changes