apsg 1.3.2__py3-none-any.whl → 1.3.3__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.3.2"
101
+ __version__ = "1.3.3"
102
102
  __author__ = "Ondrej Lexa"
103
103
  __email__ = "lexa.ondrej@gmail.com"
apsg/database/_alchemy.py CHANGED
@@ -35,7 +35,7 @@ class Meta(Base):
35
35
  __tablename__ = "meta"
36
36
 
37
37
  id = Column(Integer, primary_key=True, autoincrement=True)
38
- name = Column(String(16), nullable=False)
38
+ name = Column(String(16), nullable=False, unique=True)
39
39
  value = Column(Text)
40
40
 
41
41
  def __repr__(self):
@@ -47,7 +47,7 @@ class Site(Base):
47
47
 
48
48
  id = Column(Integer, primary_key=True, autoincrement=True)
49
49
  id_units = Column(ForeignKey("units.id"), nullable=False, index=True)
50
- name = Column(String(16), nullable=False)
50
+ name = Column(String(16), nullable=False, unique=True)
51
51
  x_coord = Column(Float, server_default=text("NULL"))
52
52
  y_coord = Column(Float, server_default=text("NULL"))
53
53
  description = Column(Text)
@@ -58,8 +58,6 @@ class Site(Base):
58
58
  "Structdata", back_populates="site", cascade="all, delete-orphan"
59
59
  )
60
60
 
61
- __table_args__ = (UniqueConstraint("name", name="_site_name_uc"),)
62
-
63
61
  def __repr__(self):
64
62
  return "Site:{} ({})".format(self.name, self.unit.name)
65
63
 
@@ -131,7 +129,7 @@ class Structype(Base):
131
129
 
132
130
  id = Column(Integer, primary_key=True, autoincrement=True)
133
131
  pos = Column(Integer, nullable=False, server_default=text("0"))
134
- structure = Column(String(16), nullable=False)
132
+ structure = Column(String(16), nullable=False, unique=True)
135
133
  description = Column(Text)
136
134
  structcode = Column(Integer, server_default=text("0"))
137
135
  groupcode = Column(Integer, server_default=text("0"))
@@ -139,8 +137,6 @@ class Structype(Base):
139
137
 
140
138
  structdata = relationship("Structdata", back_populates="structype")
141
139
 
142
- __table_args__ = (UniqueConstraint("structure", name="_structype_structure_uc"),)
143
-
144
140
  def __repr__(self):
145
141
  return "Type:{}".format(self.structure)
146
142
 
@@ -150,13 +146,11 @@ class Tag(Base):
150
146
 
151
147
  id = Column(Integer, primary_key=True, autoincrement=True)
152
148
  pos = Column(Integer, nullable=False, server_default=text("0"))
153
- name = Column(String(16), nullable=False)
149
+ name = Column(String(16), nullable=False, unique=True)
154
150
  description = Column(Text)
155
151
 
156
152
  structdata = relationship("Structdata", secondary=tagged, back_populates="tags")
157
153
 
158
- __table_args__ = (UniqueConstraint("name", name="_tag_name_uc"),)
159
-
160
154
  def __repr__(self):
161
155
  return "Tag:{}".format(self.name)
162
156
 
@@ -166,13 +160,11 @@ class Unit(Base):
166
160
 
167
161
  id = Column(Integer, primary_key=True, autoincrement=True)
168
162
  pos = Column(Integer, nullable=False, server_default=text("0"))
169
- name = Column(String(60), nullable=False)
163
+ name = Column(String(60), nullable=False, unique=True)
170
164
  description = Column(Text)
171
165
 
172
166
  sites = relationship("Site", back_populates="unit")
173
167
 
174
- __table_args__ = (UniqueConstraint("name", name="_unit_name_uc"),)
175
-
176
168
  def __repr__(self):
177
169
  return "Unit:{}".format(self.name)
178
170
 
apsg/database/_sdbread.py CHANGED
@@ -94,6 +94,13 @@ class SDB(object):
94
94
  raise
95
95
 
96
96
  def info(self, report="basic"):
97
+ """
98
+ PySDB database report
99
+
100
+ Args:
101
+ report (str): type of report. `basic`, `data` or `tags`. Default `basic`
102
+
103
+ """
97
104
  lines = []
98
105
  if report == "basic":
99
106
  lines.append("PySDB database version: {}".format(self.meta("version")))
@@ -111,7 +118,7 @@ class SDB(object):
111
118
  if len(r) > 0:
112
119
  lines.append("Number of {} measurements: {}".format(s, len(r)))
113
120
  elif report == "tags":
114
- for s in self.structures():
121
+ for s in self.tags():
115
122
  r = self.execsql(self._make_select(tags=s))
116
123
  if len(r) > 0:
117
124
  lines.append("{} measurements tagged as {}.".format(len(r), s))
apsg/shell.py CHANGED
@@ -6,8 +6,6 @@
6
6
  Run the interactive shell.
7
7
  """
8
8
 
9
-
10
- import pkg_resources
11
9
  import code
12
10
 
13
11
  try:
@@ -15,14 +13,16 @@ try:
15
13
  except ImportError:
16
14
  pass
17
15
 
18
- from pylab import * # NOQA
16
+ import numpy as np
17
+ import matplotlib.pyplot as plt
18
+ import apsg
19
19
  from apsg import * # NOQA
20
20
 
21
21
 
22
22
  def main():
23
23
  banner = "+----------------------------------------------------------+\n"
24
24
  banner += " APSG toolbox "
25
- banner += pkg_resources.require("apsg")[0].version
25
+ banner += apsg.__version__
26
26
  banner += " - http://ondrolexa.github.io/apsg\n"
27
27
  banner += "+----------------------------------------------------------+"
28
28
  vars = globals().copy()
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.2
1
+ Metadata-Version: 2.4
2
2
  Name: apsg
3
- Version: 1.3.2
3
+ Version: 1.3.3
4
4
  Summary: APSG - The package for structural geologists
5
5
  Author-email: Ondrej Lexa <lexa.ondrej@gmail.com>
6
6
  Maintainer-email: Ondrej Lexa <lexa.ondrej@gmail.com>
@@ -67,6 +67,7 @@ Requires-Dist: readthedocs-sphinx-search; extra == "dev"
67
67
  Requires-Dist: ipykernel; extra == "dev"
68
68
  Requires-Dist: nbsphinx; extra == "dev"
69
69
  Requires-Dist: autodocsumm; extra == "dev"
70
+ Dynamic: license-file
70
71
 
71
72
  <img src="https://ondrolexa.github.io/apsg/apsg_banner.svg" alt="APSG logo" width="300px"/>
72
73
 
@@ -1,9 +1,9 @@
1
- apsg/__init__.py,sha256=0HF522QDBElQju1ab_cwS3U0p00ZRfvzITYnTBRNDa4,1966
1
+ apsg/__init__.py,sha256=TSryR0LIs4EdoYtd6YEhLdoh2CfQnMgNKc6v25SH6Vw,1966
2
2
  apsg/config.py,sha256=X3_yXT96xXlVxFA94EfYFKJbrcGIHT0PvB9s8EKmYOg,4569
3
- apsg/shell.py,sha256=UFIOy01KckLsOlqfB0UomyWZ1ITL36-lBUFhlxWdZLE,718
3
+ apsg/shell.py,sha256=1D0PeB7qXzlpiOf2QYGo6OJlEVN1KJPYld1GEREBiFg,707
4
4
  apsg/database/__init__.py,sha256=7Rvcf1KBBBNhoM28ZlvQ01CkScQTroFkoS4d1kD55Ws,315
5
- apsg/database/_alchemy.py,sha256=cs8un4RJwUoE62GOberiTIQ2akFXYM0FoR-f1h4_DW8,19726
6
- apsg/database/_sdbread.py,sha256=Gzj0bpp0vnMvCfxIuX6Ktf01LoQWDCOcXST7HZp_XTY,10868
5
+ apsg/database/_alchemy.py,sha256=fBcLJBwcqxeImu7y_I6rDGFX3_i9w67VN1-T1lULsi4,19489
6
+ apsg/database/_sdbread.py,sha256=EP0hSp6_4-DZZptkMNDgKnQ3GD58mpr_SAgFohKu6xQ,11017
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
@@ -30,9 +30,9 @@ apsg/plotting/_projection.py,sha256=qnJgTQaFW0v2Pu9ySAEPADHhLgpXmfJ6QIrydry8rXQ,
30
30
  apsg/plotting/_roseplot.py,sha256=jbaUXSb3DIcXs0pWAQUTZfdlA2XcbquT0yHLYDjLirQ,12808
31
31
  apsg/plotting/_stereogrid.py,sha256=awh7MwN1WgszhOlr6UgR20wHQJ8u778-Tf_w1uflrV4,11869
32
32
  apsg/plotting/_stereonet.py,sha256=-BFM9RCInI-RYs1DKz-ymNFkMFJLTWuw3JcyUs7YiGM,36596
33
- apsg-1.3.2.dist-info/LICENSE,sha256=lY0kfpVRrzcgVZq7pI6rLK5WYiUMWe0bdKpDelN6hk8,1120
34
- apsg-1.3.2.dist-info/METADATA,sha256=RtbuiUnWF0ArtuePgaLRg3Ve7kMPT3e6RJFHzZZKKhI,8276
35
- apsg-1.3.2.dist-info/WHEEL,sha256=jB7zZ3N9hIM9adW7qlTAyycLYW9npaWKLRzaoVcLKcM,91
36
- apsg-1.3.2.dist-info/entry_points.txt,sha256=SowP7_uRI0NJuzznKBXyM9BJcSwBxbXo6Iz5LUo9mEQ,42
37
- apsg-1.3.2.dist-info/top_level.txt,sha256=xWxwi0nqqOyKdmpsszfR-bmqnNpgVbhnLRuIKGJnaUM,5
38
- apsg-1.3.2.dist-info/RECORD,,
33
+ apsg-1.3.3.dist-info/licenses/LICENSE,sha256=lY0kfpVRrzcgVZq7pI6rLK5WYiUMWe0bdKpDelN6hk8,1120
34
+ apsg-1.3.3.dist-info/METADATA,sha256=h1WqeVtnjWG8vo8gi4zZynpXCsGxIaGYwlata_jwAMU,8298
35
+ apsg-1.3.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
36
+ apsg-1.3.3.dist-info/entry_points.txt,sha256=SowP7_uRI0NJuzznKBXyM9BJcSwBxbXo6Iz5LUo9mEQ,42
37
+ apsg-1.3.3.dist-info/top_level.txt,sha256=xWxwi0nqqOyKdmpsszfR-bmqnNpgVbhnLRuIKGJnaUM,5
38
+ apsg-1.3.3.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (75.8.2)
2
+ Generator: setuptools (80.9.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5