geolysis 0.4.3__py3-none-any.whl → 0.4.4__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.
@@ -0,0 +1,80 @@
1
+ """validators"""
2
+ import operator
3
+ from typing import Callable, TypeAlias
4
+
5
+ Number: TypeAlias = int | float
6
+
7
+
8
+ def _num_validator(bound: float, /, *,
9
+ compare_symbol: str,
10
+ compare_fn: Callable,
11
+ err_msg: str,
12
+ exc_type: Callable):
13
+ def dec(fn):
14
+ def wrapper(obj, val):
15
+ if not compare_fn(val, bound):
16
+ msg = f"{fn.__name__} must be {compare_symbol} {bound}"
17
+ raise exc_type(err_msg if err_msg else msg)
18
+ fn(obj, val)
19
+
20
+ return wrapper
21
+
22
+ return dec
23
+
24
+
25
+ def _len_validator(bound: float, /, *,
26
+ compare_symbol: str,
27
+ compare_fn: Callable,
28
+ err_msg: str,
29
+ exc_type: Callable):
30
+ def dec(fn):
31
+ def wrapper(obj, val):
32
+ _len = len(val)
33
+ if not compare_fn(_len, bound):
34
+ msg = f"Length of '{fn.__name__}' must be {compare_symbol} {bound}"
35
+ raise exc_type(err_msg if err_msg else msg)
36
+ return fn(obj, val)
37
+
38
+ return wrapper
39
+
40
+ return dec
41
+
42
+
43
+ def min_len(m_len: int, /, *, exc_type=ValueError, err_msg=None):
44
+ return _len_validator(m_len, compare_symbol=">=",
45
+ compare_fn=operator.ge,
46
+ err_msg=err_msg,
47
+ exc_type=exc_type)
48
+
49
+
50
+ # def lt(val: Number, /, *, exc_type=ValueError, err_msg=None):
51
+ # return _NumberValidator(val, "<", operator.lt, exc_type, err_msg)
52
+
53
+
54
+ def le(val: Number, /, *, exc_type=ValueError, err_msg=None):
55
+ return _num_validator(val, compare_symbol="<=",
56
+ compare_fn=operator.le,
57
+ err_msg=err_msg,
58
+ exc_type=exc_type)
59
+
60
+
61
+ # def eq(val: Number, /, *, exc_type=ValueError, err_msg=None):
62
+ # return _NumberValidator(val, "==", operator.eq, exc_type, err_msg)
63
+
64
+
65
+ # def ne(val: Number, /, *, exc_type=ValueError, err_msg=None):
66
+ # return _NumberValidator(val, "!=", operator.ne, exc_type, err_msg)
67
+
68
+
69
+ def ge(val: Number, /, *, exc_type=ValueError, err_msg=None):
70
+ return _num_validator(val, compare_symbol=">=",
71
+ compare_fn=operator.ge,
72
+ err_msg=err_msg,
73
+ exc_type=exc_type)
74
+
75
+
76
+ def gt(val: Number, /, *, exc_type=ValueError, err_msg=None):
77
+ return _num_validator(val, compare_symbol=">",
78
+ compare_fn=operator.gt,
79
+ err_msg=err_msg,
80
+ exc_type=exc_type)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: geolysis
3
- Version: 0.4.3
3
+ Version: 0.4.4
4
4
  Summary: geolysis is an opensource software for geotechnical engineering analysis and modeling.
5
5
  Author-email: Patrick Boateng <boatengpato.pb@gmail.com>
6
6
  License: MIT License
@@ -159,18 +159,45 @@ SoilClf(symbol='A-6(4)', description='Clayey soils')
159
159
 
160
160
  ```
161
161
 
162
+ Check out more examples
163
+ [here](https://docs.geolysis.io/en/latest/user_guide/getting_started.html#quick-start)
164
+
162
165
  ## Features
163
166
 
164
- | | |
165
- |----------------------------------------------|---------------------------------------|
166
- | **Soil Classification** | AASHTO Classification System |
167
- | | Unified Soil Classification System |
168
- | **Standard Penetration Test (SPT) Analysis** | SPT Energy Correction |
169
- | | SPT Overburden Pressure Correction |
170
- | | Dilatancy Correction |
171
- | | SPT N-Design Calculation |
172
- | **Bearing Capacity Estimation** | Allowable Bearing Capacity Estimation |
173
- | | Ultimate Bearing Capacity Estimation |
167
+ <table>
168
+ <tr>
169
+ <td><strong>Soil Classification</strong></td>
170
+ <td>AASHTO Classification System</td>
171
+ </tr>
172
+ <tr>
173
+ <td></td>
174
+ <td>Unified Soil Classification System</td>
175
+ </tr>
176
+ <tr>
177
+ <td><strong>Standard Penetration Test (SPT) Analysis</strong></td>
178
+ <td>SPT Energy Correction</td>
179
+ </tr>
180
+ <tr>
181
+ <td></td>
182
+ <td>SPT Overburden Pressure Correction</td>
183
+ </tr>
184
+ <tr>
185
+ <td></td>
186
+ <td>Dilatancy Correction</td>
187
+ </tr>
188
+ <tr>
189
+ <td></td>
190
+ <td>SPT N-Design Calculation</td>
191
+ </tr>
192
+ <tr>
193
+ <td><strong>Bearing Capacity Estimation</strong></td>
194
+ <td>Allowable Bearing Capacity Estimation</td>
195
+ </tr>
196
+ <tr>
197
+ <td></td>
198
+ <td>Ultimate Bearing Capacity Estimation</td>
199
+ </tr>
200
+ </table>
174
201
 
175
202
  ## Documentation
176
203
 
@@ -0,0 +1,21 @@
1
+ geolysis/__init__.py,sha256=MyIge95T6RDI2zo-8gn3ewgjx3Bs986rvy55fek6UV4,122
2
+ geolysis/foundation.py,sha256=M6m8Pb7Bn7jdfD_77_RSXpAzZVpAiyQoWu1jJi_LVDE,10149
3
+ geolysis/soil_classifier.py,sha256=vvO4OrxcXAqLe3a3c8jhkfIZWV375BnyefCXHNhQAaU,26760
4
+ geolysis/spt.py,sha256=WI2KhaljsZ17qNhi99pFLswgZ167N1rR1udTcs_Czvc,14232
5
+ geolysis/bearing_capacity/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
+ geolysis/bearing_capacity/abc/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
7
+ geolysis/bearing_capacity/abc/cohl/__init__.py,sha256=fqG8lxcFUWUpaP3kAk4zFLmFdSWfKuZsU1H6QM5z5nQ,6922
8
+ geolysis/bearing_capacity/abc/cohl/bowles_abc.py,sha256=2S0EFRW-C2s5e3MF8wz-9JWov7NzNuWqJ4HlSuqMrS4,4231
9
+ geolysis/bearing_capacity/abc/cohl/meyerhof_abc.py,sha256=wdWYn58NG7sYc-8ML-Yf7kS4PZnpOqghu6gwaH7UFsg,4197
10
+ geolysis/bearing_capacity/abc/cohl/terzaghi_abc.py,sha256=SRawtG8M0jGGMmzEqOvu_nV1tJ-8wJCJQo4GepDREd8,5448
11
+ geolysis/bearing_capacity/ubc/__init__.py,sha256=BgByVUK3t_EH5MXnEkd0IQOxqJqabYJZ02EoJq3zIac,11126
12
+ geolysis/bearing_capacity/ubc/hansen_ubc.py,sha256=DM3gnF6OueUDbQq4L82bR7i2vFusr2x1uh3vmYfAKk4,7222
13
+ geolysis/bearing_capacity/ubc/terzaghi_ubc.py,sha256=-mgSgqhceKaEzR0_zOQ2-wJTDPNpi-VQ3gg_lTxcqm0,6710
14
+ geolysis/bearing_capacity/ubc/vesic_ubc.py,sha256=41TKVQf_5wsHTEuR08u4FS-Rtdc2WomV1JC9fBubKVY,7482
15
+ geolysis/utils/__init__.py,sha256=Q3eBBOi_JKnydu6su-TswdI2bIT4PZ7V43NIIGaTj2w,2616
16
+ geolysis/utils/validators.py,sha256=ETvqwXtBFE17keDE5plYcSOztFNbSuJVqB6M6SmxBaQ,2556
17
+ geolysis-0.4.4.dist-info/LICENSE.txt,sha256=ap6sMs3lT7ICbEXBhgihwH1BTCVcjmCQkIkwVnil1Ak,1065
18
+ geolysis-0.4.4.dist-info/METADATA,sha256=8X06eJ1edfSgMt4htbXtylGUrsdtvIoLmTYYVRYFffY,7444
19
+ geolysis-0.4.4.dist-info/WHEEL,sha256=52BFRY2Up02UkjOa29eZOS2VxUrpPORXg1pkohGGUS8,91
20
+ geolysis-0.4.4.dist-info/top_level.txt,sha256=9mnQgOaCRr11dtXff8X-q3FfXjRONd6kHseSy5q2y8g,9
21
+ geolysis-0.4.4.dist-info/RECORD,,
@@ -1,9 +0,0 @@
1
- geolysis/__init__.py,sha256=Nyg0pmk5ea9-SLCAFEIF96ByFx4-TJFtrqYPN-Zn6g4,22
2
- geolysis/foundation.py,sha256=KIZewS9-l_tSDtgy9Ym5ADHETTuho3GJPBguh3Y28fw,10149
3
- geolysis/soil_classifier.py,sha256=GsT7qNwfXjZh0zo1O2e7iTN35ywdvzEs4vgaaqYA7Lo,26786
4
- geolysis/spt.py,sha256=E8rg6wKL4jbX8Xz-p9KdyfGxcQr8TdoZR4ZA9eUU4aI,14246
5
- geolysis-0.4.3.dist-info/LICENSE.txt,sha256=ap6sMs3lT7ICbEXBhgihwH1BTCVcjmCQkIkwVnil1Ak,1065
6
- geolysis-0.4.3.dist-info/METADATA,sha256=-hGWQ3izaFfDhQ44lc7ZSM83WmllA-RbbQYuKqWKWUQ,7394
7
- geolysis-0.4.3.dist-info/WHEEL,sha256=52BFRY2Up02UkjOa29eZOS2VxUrpPORXg1pkohGGUS8,91
8
- geolysis-0.4.3.dist-info/top_level.txt,sha256=9mnQgOaCRr11dtXff8X-q3FfXjRONd6kHseSy5q2y8g,9
9
- geolysis-0.4.3.dist-info/RECORD,,