apsg 1.2.0__tar.gz → 1.2.1__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-1.2.0 → apsg-1.2.1}/HISTORY.md +4 -1
- {apsg-1.2.0 → apsg-1.2.1}/PKG-INFO +5 -2
- {apsg-1.2.0 → apsg-1.2.1}/docs/conf.py +1 -1
- {apsg-1.2.0 → apsg-1.2.1}/setup.cfg +1 -1
- {apsg-1.2.0 → apsg-1.2.1}/setup.py +1 -1
- {apsg-1.2.0 → apsg-1.2.1}/src/apsg/__init__.py +1 -1
- {apsg-1.2.0 → apsg-1.2.1}/src/apsg/feature/_container.py +16 -4
- {apsg-1.2.0 → apsg-1.2.1}/src/apsg/feature/_geodata.py +40 -11
- {apsg-1.2.0 → apsg-1.2.1}/src/apsg.egg-info/PKG-INFO +5 -2
- {apsg-1.2.0 → apsg-1.2.1}/AUTHORS.md +0 -0
- {apsg-1.2.0 → apsg-1.2.1}/CONTRIBUTING.md +0 -0
- {apsg-1.2.0 → apsg-1.2.1}/LICENSE +0 -0
- {apsg-1.2.0 → apsg-1.2.1}/MANIFEST.in +0 -0
- {apsg-1.2.0 → apsg-1.2.1}/README.md +0 -0
- {apsg-1.2.0 → apsg-1.2.1}/docs/Makefile +0 -0
- {apsg-1.2.0 → apsg-1.2.1}/docs/apsg.database.rst +0 -0
- {apsg-1.2.0 → apsg-1.2.1}/docs/apsg.feature.rst +0 -0
- {apsg-1.2.0 → apsg-1.2.1}/docs/apsg.helpers.rst +0 -0
- {apsg-1.2.0 → apsg-1.2.1}/docs/apsg.math.rst +0 -0
- {apsg-1.2.0 → apsg-1.2.1}/docs/apsg.pandas.rst +0 -0
- {apsg-1.2.0 → apsg-1.2.1}/docs/apsg.plotting.rst +0 -0
- {apsg-1.2.0 → apsg-1.2.1}/docs/authors.rst +0 -0
- {apsg-1.2.0 → apsg-1.2.1}/docs/automodules.rst +0 -0
- {apsg-1.2.0 → apsg-1.2.1}/docs/contributing.rst +0 -0
- {apsg-1.2.0 → apsg-1.2.1}/docs/index.rst +0 -0
- {apsg-1.2.0 → apsg-1.2.1}/docs/installation.rst +0 -0
- {apsg-1.2.0 → apsg-1.2.1}/docs/make.bat +0 -0
- {apsg-1.2.0 → apsg-1.2.1}/docs/tutorials.rst +0 -0
- {apsg-1.2.0 → apsg-1.2.1}/pyproject.toml +0 -0
- {apsg-1.2.0 → apsg-1.2.1}/src/apsg/config.py +0 -0
- {apsg-1.2.0 → apsg-1.2.1}/src/apsg/database/__init__.py +0 -0
- {apsg-1.2.0 → apsg-1.2.1}/src/apsg/database/_alchemy.py +0 -0
- {apsg-1.2.0 → apsg-1.2.1}/src/apsg/database/_sdbread.py +0 -0
- {apsg-1.2.0 → apsg-1.2.1}/src/apsg/decorator/__init__.py +0 -0
- {apsg-1.2.0 → apsg-1.2.1}/src/apsg/decorator/_decorator.py +0 -0
- {apsg-1.2.0 → apsg-1.2.1}/src/apsg/feature/__init__.py +0 -0
- {apsg-1.2.0 → apsg-1.2.1}/src/apsg/feature/_paleomag.py +0 -0
- {apsg-1.2.0 → apsg-1.2.1}/src/apsg/feature/_statistics.py +0 -0
- {apsg-1.2.0 → apsg-1.2.1}/src/apsg/feature/_tensor2.py +0 -0
- {apsg-1.2.0 → apsg-1.2.1}/src/apsg/feature/_tensor3.py +0 -0
- {apsg-1.2.0 → apsg-1.2.1}/src/apsg/helpers/__init__.py +0 -0
- {apsg-1.2.0 → apsg-1.2.1}/src/apsg/helpers/_helper.py +0 -0
- {apsg-1.2.0 → apsg-1.2.1}/src/apsg/helpers/_math.py +0 -0
- {apsg-1.2.0 → apsg-1.2.1}/src/apsg/helpers/_notation.py +0 -0
- {apsg-1.2.0 → apsg-1.2.1}/src/apsg/math/__init__.py +0 -0
- {apsg-1.2.0 → apsg-1.2.1}/src/apsg/math/_matrix.py +0 -0
- {apsg-1.2.0 → apsg-1.2.1}/src/apsg/math/_vector.py +0 -0
- {apsg-1.2.0 → apsg-1.2.1}/src/apsg/pandas/__init__.py +0 -0
- {apsg-1.2.0 → apsg-1.2.1}/src/apsg/pandas/_pandas_api.py +0 -0
- {apsg-1.2.0 → apsg-1.2.1}/src/apsg/plotting/__init__.py +0 -0
- {apsg-1.2.0 → apsg-1.2.1}/src/apsg/plotting/_fabricplot.py +0 -0
- {apsg-1.2.0 → apsg-1.2.1}/src/apsg/plotting/_paleomagplots.py +0 -0
- {apsg-1.2.0 → apsg-1.2.1}/src/apsg/plotting/_plot_artists.py +0 -0
- {apsg-1.2.0 → apsg-1.2.1}/src/apsg/plotting/_projection.py +0 -0
- {apsg-1.2.0 → apsg-1.2.1}/src/apsg/plotting/_roseplot.py +0 -0
- {apsg-1.2.0 → apsg-1.2.1}/src/apsg/plotting/_stereogrid.py +0 -0
- {apsg-1.2.0 → apsg-1.2.1}/src/apsg/plotting/_stereonet.py +0 -0
- {apsg-1.2.0 → apsg-1.2.1}/src/apsg/shell.py +0 -0
- {apsg-1.2.0 → apsg-1.2.1}/src/apsg.egg-info/SOURCES.txt +0 -0
- {apsg-1.2.0 → apsg-1.2.1}/src/apsg.egg-info/dependency_links.txt +0 -0
- {apsg-1.2.0 → apsg-1.2.1}/src/apsg.egg-info/entry_points.txt +0 -0
- {apsg-1.2.0 → apsg-1.2.1}/src/apsg.egg-info/requires.txt +0 -0
- {apsg-1.2.0 → apsg-1.2.1}/src/apsg.egg-info/top_level.txt +0 -0
- {apsg-1.2.0 → apsg-1.2.1}/tests/__init__.py +0 -0
- {apsg-1.2.0 → apsg-1.2.1}/tests/conftest.py +0 -0
- {apsg-1.2.0 → apsg-1.2.1}/tests/test_apsg.py +0 -0
- {apsg-1.2.0 → apsg-1.2.1}/tests/test_tensors.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: apsg
|
|
3
|
-
Version: 1.2.
|
|
3
|
+
Version: 1.2.1
|
|
4
4
|
Summary: APSG - The package for structural geologists
|
|
5
5
|
Home-page: https://github.com/ondrolexa/apsg
|
|
6
6
|
Author: Ondrej Lexa
|
|
@@ -140,7 +140,10 @@ 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.
|
|
143
|
+
### 1.2.1 (Sep 23 2024)
|
|
144
|
+
* Fault sense could be defined by str, one of 's', 'd', 'n' and 'r'
|
|
145
|
+
|
|
146
|
+
### 1.2.0 (May 24 2024)
|
|
144
147
|
* sqlalchemy and pandas added to requirements
|
|
145
148
|
* quicknet fault bug fixed
|
|
146
149
|
|
|
@@ -71,7 +71,7 @@ copyright = "2023, 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.
|
|
74
|
+
release = "1.2.1"
|
|
75
75
|
|
|
76
76
|
# The language for content autogenerated by Sphinx. Refer to documentation
|
|
77
77
|
# for a list of supported languages.
|
|
@@ -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.
|
|
20
|
+
version="1.2.1",
|
|
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",
|
|
@@ -1563,6 +1563,18 @@ class ClusterSet(object):
|
|
|
1563
1563
|
Provides a hierarchical clustering using `scipy.cluster` routines.
|
|
1564
1564
|
The distance matrix is calculated as an angle between features, where ``Foliation``
|
|
1565
1565
|
and ``Lineation`` use axial angles while ``Vector3`` uses direction angles.
|
|
1566
|
+
|
|
1567
|
+
Args:
|
|
1568
|
+
azi (float): plunge direction of linear feature in degrees
|
|
1569
|
+
inc (float): plunge of linear feature in degrees
|
|
1570
|
+
|
|
1571
|
+
Keyword Args:
|
|
1572
|
+
maxclust (int): Desired number of clusters. Default 2
|
|
1573
|
+
angle (float): Forms flat clusters so that the original observations in each
|
|
1574
|
+
cluster have no greater angle. Default is None to use maxclust criterion.
|
|
1575
|
+
method (str): Method for calculating the distance between the newly formed
|
|
1576
|
+
cluster and observations. Default is 'average' for UPGMA algorithm
|
|
1577
|
+
|
|
1566
1578
|
"""
|
|
1567
1579
|
|
|
1568
1580
|
def __init__(self, d, **kwargs):
|
|
@@ -1580,13 +1592,13 @@ class ClusterSet(object):
|
|
|
1580
1592
|
def __repr__(self):
|
|
1581
1593
|
info = f"Already {len(self.groups)} clusters created."
|
|
1582
1594
|
if self.angle is not None:
|
|
1583
|
-
crit = "Criterion: Angle\nSettings: distance
|
|
1595
|
+
crit = f"Criterion: Angle\nSettings: distance={self.angle:.4g}\n"
|
|
1584
1596
|
else:
|
|
1585
|
-
crit = "Criterion: Maxclust\nSettings:
|
|
1597
|
+
crit = f"Criterion: Maxclust\nSettings: maxclust={self.maxclust:.4g}\n"
|
|
1586
1598
|
return (
|
|
1587
1599
|
"ClusterSet\n"
|
|
1588
|
-
+ "Number of data:
|
|
1589
|
-
+ "Linkage method:
|
|
1600
|
+
+ f"Number of data: {len(self.data)}\n"
|
|
1601
|
+
+ f"Linkage method: {self.method}\n"
|
|
1590
1602
|
+ crit
|
|
1591
1603
|
+ info
|
|
1592
1604
|
)
|
|
@@ -367,8 +367,9 @@ class Fault(Pair):
|
|
|
367
367
|
- `p` could be Fault
|
|
368
368
|
- `p` could be tuple of (fazi, finc, lazi, linc, sense)
|
|
369
369
|
- `p` could be tuple of (fx, fy ,fz, lx, ly, lz)
|
|
370
|
-
- with 2 arguments
|
|
371
|
-
|
|
370
|
+
- with 2 arguments p (Pair object) and sense
|
|
371
|
+
- with 3 arguments f, l (Vector3 like objects), e.g. ``Foliation``
|
|
372
|
+
and ``Lineation`` and sense
|
|
372
373
|
- with 5 numerical arguments defining `fol(fazi, finc)`, `lin(lazi, linc)` and sense
|
|
373
374
|
|
|
374
375
|
Args:
|
|
@@ -376,7 +377,9 @@ class Fault(Pair):
|
|
|
376
377
|
finc (float): dip of planar feature in degrees
|
|
377
378
|
lazi (float): plunge direction of linear feature in degrees
|
|
378
379
|
linc (float): plunge of linear feature in degrees
|
|
379
|
-
sense (float): sense of movement
|
|
380
|
+
sense (float or str): sense of movement +/11 hanging-wall down/up. When str,
|
|
381
|
+
,ust be one of 's', 'd', 'n', 'r'.
|
|
382
|
+
|
|
380
383
|
|
|
381
384
|
Attributes:
|
|
382
385
|
fvec (Vector3): corrected vector normal to plane
|
|
@@ -384,11 +387,11 @@ class Fault(Pair):
|
|
|
384
387
|
sense (int): sense of movement (+/-1)
|
|
385
388
|
|
|
386
389
|
Example:
|
|
387
|
-
>>> fault()
|
|
388
|
-
>>> fault(p)
|
|
389
|
-
>>> fault(f, l)
|
|
390
|
-
>>> fault(fazi, finc, lazi, linc, sense)
|
|
391
390
|
>>> f = fault(140, 30, 110, 26, -1)
|
|
391
|
+
>>> f = fault(140, 30, 110, 26, 'r')
|
|
392
|
+
>>> p = pair(140, 30, 110, 26)
|
|
393
|
+
>>> f = fault(p, 'n')
|
|
394
|
+
>>> f = fault(fol(120, 80), lin(32, 10), 's')
|
|
392
395
|
|
|
393
396
|
"""
|
|
394
397
|
|
|
@@ -396,18 +399,20 @@ class Fault(Pair):
|
|
|
396
399
|
|
|
397
400
|
def __init__(self, *args):
|
|
398
401
|
if len(args) == 0:
|
|
399
|
-
fvec, lvec
|
|
402
|
+
fvec, lvec = Vector3(0, 0, 1), Vector3(1, 0, 0)
|
|
400
403
|
elif len(args) == 1 and np.asarray(args[0]).shape == (5,):
|
|
401
404
|
fazi, finc, lazi, linc, sense = (float(v) for v in args[0])
|
|
402
405
|
fvec, lvec = Foliation(fazi, finc), Lineation(lazi, linc)
|
|
406
|
+
sense = self.calc_sense(fvec, lvec, sense)
|
|
403
407
|
if sense < 0:
|
|
404
408
|
lvec = -lvec
|
|
405
409
|
elif len(args) == 1 and issubclass(type(args[0]), Pair):
|
|
406
410
|
fvec, lvec = args[0].fvec, args[0].lvec
|
|
407
411
|
elif len(args) == 2 and issubclass(type(args[0]), Pair):
|
|
408
412
|
fvec, lvec = args[0].fvec, args[0].lvec
|
|
413
|
+
sense = self.calc_sense(fvec, lvec, args[1])
|
|
409
414
|
georax = lvec.lower().cross(fvec.lower())
|
|
410
|
-
if args[0].rax == georax and
|
|
415
|
+
if args[0].rax == georax and sense < 0:
|
|
411
416
|
lvec = -lvec
|
|
412
417
|
elif len(args) == 2:
|
|
413
418
|
if issubclass(type(args[0]), Vector3) and issubclass(
|
|
@@ -419,19 +424,43 @@ class Fault(Pair):
|
|
|
419
424
|
type(args[1]), Vector3
|
|
420
425
|
):
|
|
421
426
|
fvec, lvec = args[0], args[1]
|
|
427
|
+
sense = self.calc_sense(fvec, lvec, args[2])
|
|
422
428
|
rax = lvec.cross(fvec)
|
|
423
429
|
georax = lvec.lower().cross(fvec.lower())
|
|
424
|
-
if rax == georax and
|
|
430
|
+
if rax == georax and sense < 0:
|
|
425
431
|
lvec = -lvec
|
|
426
432
|
elif len(args) == 5:
|
|
427
433
|
fvec = Foliation(args[0], args[1])
|
|
428
434
|
lvec = Lineation(args[2], args[3])
|
|
429
|
-
|
|
435
|
+
sense = self.calc_sense(fvec, lvec, args[4])
|
|
436
|
+
if sense < 0:
|
|
430
437
|
lvec = -lvec
|
|
431
438
|
else:
|
|
432
439
|
raise TypeError("Not valid arguments for Fault")
|
|
433
440
|
super().__init__(fvec, lvec)
|
|
434
441
|
|
|
442
|
+
@classmethod
|
|
443
|
+
def calc_sense(cls, fvec, lvec, sense):
|
|
444
|
+
if isinstance(sense, int) or isinstance(sense, float):
|
|
445
|
+
return sense
|
|
446
|
+
elif isinstance(sense, str):
|
|
447
|
+
p = Pair(fvec, lvec)
|
|
448
|
+
if sense.lower() == "s":
|
|
449
|
+
if p.rax == p.rax.lower():
|
|
450
|
+
res = -1
|
|
451
|
+
else:
|
|
452
|
+
res = 1
|
|
453
|
+
elif sense.lower() == "d":
|
|
454
|
+
if p.rax == p.rax.lower():
|
|
455
|
+
res = 1
|
|
456
|
+
else:
|
|
457
|
+
res = -1
|
|
458
|
+
elif sense.lower() == "n":
|
|
459
|
+
res = 1
|
|
460
|
+
elif sense.lower() == "r":
|
|
461
|
+
res = -1
|
|
462
|
+
return res
|
|
463
|
+
|
|
435
464
|
def __repr__(self):
|
|
436
465
|
fazi, finc = self.fol.geo
|
|
437
466
|
lazi, linc = self.lin.geo
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: apsg
|
|
3
|
-
Version: 1.2.
|
|
3
|
+
Version: 1.2.1
|
|
4
4
|
Summary: APSG - The package for structural geologists
|
|
5
5
|
Home-page: https://github.com/ondrolexa/apsg
|
|
6
6
|
Author: Ondrej Lexa
|
|
@@ -140,7 +140,10 @@ 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.
|
|
143
|
+
### 1.2.1 (Sep 23 2024)
|
|
144
|
+
* Fault sense could be defined by str, one of 's', 'd', 'n' and 'r'
|
|
145
|
+
|
|
146
|
+
### 1.2.0 (May 24 2024)
|
|
144
147
|
* sqlalchemy and pandas added to requirements
|
|
145
148
|
* quicknet fault bug fixed
|
|
146
149
|
|
|
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
|
|
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
|