geolysis 0.8.0__tar.gz → 0.10.0__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 (49) hide show
  1. geolysis-0.10.0/PKG-INFO +181 -0
  2. geolysis-0.10.0/README.md +149 -0
  3. geolysis-0.10.0/geolysis/__init__.py +5 -0
  4. geolysis-0.10.0/geolysis/bearing_capacity/abc/__init__.py +21 -0
  5. geolysis-0.10.0/geolysis/bearing_capacity/abc/_cohl/__init__.py +109 -0
  6. {geolysis-0.8.0/geolysis/bearing_capacity/abc/cohl → geolysis-0.10.0/geolysis/bearing_capacity/abc/_cohl}/_core.py +20 -10
  7. geolysis-0.10.0/geolysis/bearing_capacity/abc/_cohl/bowles_abc.py +103 -0
  8. geolysis-0.10.0/geolysis/bearing_capacity/abc/_cohl/meyerhof_abc.py +100 -0
  9. geolysis-0.10.0/geolysis/bearing_capacity/abc/_cohl/terzaghi_abc.py +143 -0
  10. geolysis-0.10.0/geolysis/bearing_capacity/ubc/__init__.py +131 -0
  11. {geolysis-0.8.0 → geolysis-0.10.0}/geolysis/bearing_capacity/ubc/_core.py +68 -66
  12. geolysis-0.10.0/geolysis/bearing_capacity/ubc/_hansen_ubc.py +271 -0
  13. geolysis-0.10.0/geolysis/bearing_capacity/ubc/_terzaghi_ubc.py +178 -0
  14. geolysis-0.10.0/geolysis/bearing_capacity/ubc/_vesic_ubc.py +253 -0
  15. {geolysis-0.8.0 → geolysis-0.10.0}/geolysis/foundation.py +160 -127
  16. {geolysis-0.8.0 → geolysis-0.10.0}/geolysis/soil_classifier.py +386 -285
  17. geolysis-0.10.0/geolysis/spt.py +658 -0
  18. geolysis-0.8.0/geolysis/utils/__init__.py → geolysis-0.10.0/geolysis/utils.py +48 -36
  19. geolysis-0.10.0/geolysis.egg-info/PKG-INFO +181 -0
  20. {geolysis-0.8.0 → geolysis-0.10.0}/geolysis.egg-info/SOURCES.txt +10 -11
  21. {geolysis-0.8.0 → geolysis-0.10.0}/pyproject.toml +3 -3
  22. geolysis-0.10.0/tests/test_docs.py +10 -0
  23. {geolysis-0.8.0 → geolysis-0.10.0}/tests/test_foundation.py +22 -18
  24. geolysis-0.10.0/tests/test_soil_classifier.py +158 -0
  25. {geolysis-0.8.0 → geolysis-0.10.0}/tests/test_spt.py +83 -54
  26. geolysis-0.8.0/PKG-INFO +0 -206
  27. geolysis-0.8.0/README.md +0 -174
  28. geolysis-0.8.0/geolysis/__init__.py +0 -5
  29. geolysis-0.8.0/geolysis/bearing_capacity/abc/__init__.py +0 -0
  30. geolysis-0.8.0/geolysis/bearing_capacity/abc/cohl/__init__.py +0 -137
  31. geolysis-0.8.0/geolysis/bearing_capacity/abc/cohl/bowles_abc.py +0 -96
  32. geolysis-0.8.0/geolysis/bearing_capacity/abc/cohl/meyerhof_abc.py +0 -96
  33. geolysis-0.8.0/geolysis/bearing_capacity/abc/cohl/terzaghi_abc.py +0 -131
  34. geolysis-0.8.0/geolysis/bearing_capacity/ubc/__init__.py +0 -152
  35. geolysis-0.8.0/geolysis/bearing_capacity/ubc/hansen_ubc.py +0 -287
  36. geolysis-0.8.0/geolysis/bearing_capacity/ubc/terzaghi_ubc.py +0 -246
  37. geolysis-0.8.0/geolysis/bearing_capacity/ubc/vesic_ubc.py +0 -293
  38. geolysis-0.8.0/geolysis/spt.py +0 -592
  39. geolysis-0.8.0/geolysis/utils/exceptions.py +0 -52
  40. geolysis-0.8.0/geolysis/utils/validators.py +0 -129
  41. geolysis-0.8.0/geolysis.egg-info/PKG-INFO +0 -206
  42. geolysis-0.8.0/tests/test_soil_classifier.py +0 -175
  43. {geolysis-0.8.0 → geolysis-0.10.0}/LICENSE.txt +0 -0
  44. {geolysis-0.8.0 → geolysis-0.10.0}/geolysis/bearing_capacity/__init__.py +0 -0
  45. {geolysis-0.8.0 → geolysis-0.10.0}/geolysis.egg-info/dependency_links.txt +0 -0
  46. {geolysis-0.8.0 → geolysis-0.10.0}/geolysis.egg-info/requires.txt +0 -0
  47. {geolysis-0.8.0 → geolysis-0.10.0}/geolysis.egg-info/top_level.txt +0 -0
  48. {geolysis-0.8.0 → geolysis-0.10.0}/setup.cfg +0 -0
  49. {geolysis-0.8.0 → geolysis-0.10.0}/setup.py +0 -0
@@ -0,0 +1,181 @@
1
+ Metadata-Version: 2.4
2
+ Name: geolysis
3
+ Version: 0.10.0
4
+ Summary: geolysis is an opensource software for geotechnical engineering analysis and modeling.
5
+ Author-email: Patrick Boateng <boatengpato.pb@gmail.com>
6
+ License: MIT License
7
+ Project-URL: Homepage, https://docs.geolysis.io
8
+ Project-URL: Documentation, https://docs.geolysis.io
9
+ Project-URL: Repository, https://github.com/patrickboateng/geolysis
10
+ Project-URL: Discussions, https://github.com/patrickboateng/geolysis/discussions
11
+ Project-URL: Issue Tracker, https://github.com/patrickboateng/geolysis/issues
12
+ Keywords: geotechnical-engineering,soil-classification,bearing-capacity-analysis,standard-penetration-test-analysis
13
+ Classifier: Development Status :: 4 - Beta
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: Intended Audience :: Education
16
+ Classifier: Intended Audience :: Science/Research
17
+ Classifier: License :: OSI Approved :: MIT License
18
+ Classifier: Natural Language :: English
19
+ Classifier: Operating System :: OS Independent
20
+ Classifier: Programming Language :: Python :: 3.11
21
+ Classifier: Programming Language :: Python :: 3.12
22
+ Classifier: Programming Language :: Python :: Implementation :: CPython
23
+ Classifier: Topic :: Scientific/Engineering
24
+ Requires-Python: >=3.11
25
+ Description-Content-Type: text/markdown
26
+ License-File: LICENSE.txt
27
+ Provides-Extra: dev
28
+ Requires-Dist: pytest; extra == "dev"
29
+ Requires-Dist: pytest-cov; extra == "dev"
30
+ Requires-Dist: coverage; extra == "dev"
31
+ Dynamic: license-file
32
+
33
+ <div align="center">
34
+ <img src="https://raw.githubusercontent.com/patrickboateng/geolysis/main/docs/assets/pkg-logo.svg"
35
+ alt="logo" width="30%" height="30%" />
36
+ </div><br>
37
+
38
+ <div align="center">
39
+
40
+ [![PyPI Latest Release](https://img.shields.io/pypi/v/geolysis?style=flat&logo=pypi)](https://pypi.org/project/geolysis/)
41
+ [![PyPI Downloads](https://static.pepy.tech/badge/geolysis)](https://pepy.tech/projects/geolysis)
42
+ [![PyPI pyversions](https://img.shields.io/pypi/pyversions/geolysis.svg?logo=python&style=flat)](https://pypi.python.org/pypi/geolysis/)
43
+ [![license](https://img.shields.io/pypi/l/geolysis?style=flat&logo=opensourceinitiative)](https://opensource.org/license/mit/)
44
+
45
+ ![Coveralls Status](https://img.shields.io/coverallsCoverage/github/patrickboateng/geolysis?logo=coveralls)
46
+ [![Codacy Badge](https://app.codacy.com/project/badge/Grade/17f88084c6a84a08a20f9d8da1438107)](https://app.codacy.com/gh/patrickboateng/geolysis/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade)
47
+ [![Unit-Tests](https://github.com/patrickboateng/geolysis/actions/workflows/geolysis-unit-tests.yml/badge.svg)](https://github.com/patrickboateng/geolysis/actions/workflows/geolysis-unit-tests.yml)
48
+ [![Documentation Status](https://readthedocs.org/projects/geolysis/badge/?version=latest)](https://geolysis.readthedocs.io/en/latest/?badge=latest)
49
+
50
+ </div>
51
+
52
+ `geolysis` is an open-source python package (library) for geotechnical analysis
53
+ and modeling.
54
+
55
+ The `geolysis` python package is among three other projects, `geolysis.excel`,
56
+ `geolysis.gui`, and `geolysis.ai`. More details about these projects are
57
+ provided [here](https://github.com/geolysis-dev).
58
+
59
+ The rest of this **README** provides an overview of the `geolysis` python
60
+ package.
61
+
62
+ ## Table of Contents
63
+
64
+ - [Installation](#installation)
65
+ - [API Reference](#api-reference)
66
+ - [Imports](#imports)
67
+ - [Project Structure](#project-structure)
68
+ - [Usage](#usage)
69
+ - [Documentation](#documentation)
70
+ - [Contributing](#contributing)
71
+ - [License](#license)
72
+ - [Contact](#contact)
73
+
74
+ ## Installation
75
+
76
+ ```shell
77
+ $ pip install geolysis
78
+ ```
79
+
80
+ ## API Reference
81
+
82
+ - [Python API](https://docs.geolysis.io/en/latest/reference/)
83
+ - [geolysis.bearing_capacity.abc](https://docs.geolysis.io/en/latest/reference/allowable_bearing_capacity/) - _Allowable bearing capacity
84
+ estimation_
85
+ - [geolysis.bearing_capacity.ubc](https://docs.geolysis.io/en/latest/reference/ultimate_bearing_capacity/) - _Ultimate bearing capacity
86
+ estimation_
87
+ - [geolysis.foundation](https://docs.geolysis.io/en/latest/reference/foundation/) - _Foundation Representation_
88
+ - [geolysis.soil_classifier](https://docs.geolysis.io/en/latest/reference/soil_classifier/) - _Soil classification_
89
+ - [geolysis.spt](https://docs.geolysis.io/en/latest/reference/spt/) - _Standard Penetration Test (SPT) Analysis_
90
+ - [geolysis.utils](https://docs.geolysis.io/en/latest/reference/utils/) - _Utilities_
91
+
92
+
93
+ ## Imports
94
+
95
+ - **Bearing Capacity**
96
+
97
+ - **Allowable Bearing Capacity (ABC)**
98
+
99
+ ```python
100
+ from geolysis.bearing_capacity.abc import create_abc_4_cohesionless_soils
101
+ ```
102
+
103
+ - **Ultimate Bearing Capacity (UBC)**
104
+
105
+ ```python
106
+ from geolysis.bearing_capacity.ubc import create_ubc_4_all_soil_types
107
+ ```
108
+
109
+ - **Foundation**
110
+
111
+ ```python
112
+ from geolysis.foundation import create_foundation
113
+ ```
114
+
115
+
116
+ - **Soil Classification**
117
+
118
+ ```python
119
+ from geolysis.soil_classifier import create_uscs_classifier
120
+ from geolysis.soil_classifier import create_aashto_classifier
121
+ ```
122
+
123
+ - **Standard Penetration Test (SPT) Analysis**
124
+
125
+ ```python
126
+ from geolysis.spt import DilatancyCorrection
127
+ from geolysis.spt import EnergyCorrection
128
+ from geolysis.spt import SPT
129
+ from geolysis.spt import create_overburden_pressure_correction
130
+ ```
131
+
132
+ ## Project Structure
133
+
134
+ .
135
+ ├── .github # GitHub Actions
136
+ ├── docs # Documentation files
137
+ ├── geolysis # Source files
138
+ ├── tests # Automated tests
139
+ ├── pyproject.toml # Project configuration file
140
+ └── README.md # Project README file
141
+
142
+ ## Usage
143
+
144
+ ```python
145
+
146
+ >>> from geolysis.soil_classifier import create_aashto_classifier
147
+ >>> aashto_clf = create_aashto_classifier(liquid_limit=34.1,
148
+ ... plastic_limit=21.1,
149
+ ... fines=47.88, )
150
+ >>> clf = aashto_clf.classify()
151
+ >>> clf.symbol
152
+ 'A-6(4)'
153
+ >>> clf.symbol_no_grp_idx
154
+ 'A-6'
155
+ >>> clf.group_index
156
+ '4'
157
+ >>> clf.description
158
+ 'Clayey soils'
159
+
160
+ ```
161
+
162
+ Check out more [examples](https://docs.geolysis.io/en/latest/usage/)
163
+
164
+ ## Documentation
165
+
166
+ Check out the full [documentation](https://docs.geolysis.io/en/latest/).
167
+
168
+ ## Contributing
169
+
170
+ Check out the [contribution guidelines](https://docs.geolysis.io/en/latest/dev_guide/)
171
+
172
+ ## License
173
+
174
+ This project is licensed under the MIT License - see the
175
+ [LICENSE](https://github.com/patrickboateng/geolysis/blob/main/LICENSE.txt)
176
+ file for more details.
177
+
178
+ ## Contact
179
+
180
+ For questions or feedback, please
181
+ contact [patrickboateng at patrickboateng dot tech](mailto:patrickboateng@patrickboateng.tech)
@@ -0,0 +1,149 @@
1
+ <div align="center">
2
+ <img src="https://raw.githubusercontent.com/patrickboateng/geolysis/main/docs/assets/pkg-logo.svg"
3
+ alt="logo" width="30%" height="30%" />
4
+ </div><br>
5
+
6
+ <div align="center">
7
+
8
+ [![PyPI Latest Release](https://img.shields.io/pypi/v/geolysis?style=flat&logo=pypi)](https://pypi.org/project/geolysis/)
9
+ [![PyPI Downloads](https://static.pepy.tech/badge/geolysis)](https://pepy.tech/projects/geolysis)
10
+ [![PyPI pyversions](https://img.shields.io/pypi/pyversions/geolysis.svg?logo=python&style=flat)](https://pypi.python.org/pypi/geolysis/)
11
+ [![license](https://img.shields.io/pypi/l/geolysis?style=flat&logo=opensourceinitiative)](https://opensource.org/license/mit/)
12
+
13
+ ![Coveralls Status](https://img.shields.io/coverallsCoverage/github/patrickboateng/geolysis?logo=coveralls)
14
+ [![Codacy Badge](https://app.codacy.com/project/badge/Grade/17f88084c6a84a08a20f9d8da1438107)](https://app.codacy.com/gh/patrickboateng/geolysis/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade)
15
+ [![Unit-Tests](https://github.com/patrickboateng/geolysis/actions/workflows/geolysis-unit-tests.yml/badge.svg)](https://github.com/patrickboateng/geolysis/actions/workflows/geolysis-unit-tests.yml)
16
+ [![Documentation Status](https://readthedocs.org/projects/geolysis/badge/?version=latest)](https://geolysis.readthedocs.io/en/latest/?badge=latest)
17
+
18
+ </div>
19
+
20
+ `geolysis` is an open-source python package (library) for geotechnical analysis
21
+ and modeling.
22
+
23
+ The `geolysis` python package is among three other projects, `geolysis.excel`,
24
+ `geolysis.gui`, and `geolysis.ai`. More details about these projects are
25
+ provided [here](https://github.com/geolysis-dev).
26
+
27
+ The rest of this **README** provides an overview of the `geolysis` python
28
+ package.
29
+
30
+ ## Table of Contents
31
+
32
+ - [Installation](#installation)
33
+ - [API Reference](#api-reference)
34
+ - [Imports](#imports)
35
+ - [Project Structure](#project-structure)
36
+ - [Usage](#usage)
37
+ - [Documentation](#documentation)
38
+ - [Contributing](#contributing)
39
+ - [License](#license)
40
+ - [Contact](#contact)
41
+
42
+ ## Installation
43
+
44
+ ```shell
45
+ $ pip install geolysis
46
+ ```
47
+
48
+ ## API Reference
49
+
50
+ - [Python API](https://docs.geolysis.io/en/latest/reference/)
51
+ - [geolysis.bearing_capacity.abc](https://docs.geolysis.io/en/latest/reference/allowable_bearing_capacity/) - _Allowable bearing capacity
52
+ estimation_
53
+ - [geolysis.bearing_capacity.ubc](https://docs.geolysis.io/en/latest/reference/ultimate_bearing_capacity/) - _Ultimate bearing capacity
54
+ estimation_
55
+ - [geolysis.foundation](https://docs.geolysis.io/en/latest/reference/foundation/) - _Foundation Representation_
56
+ - [geolysis.soil_classifier](https://docs.geolysis.io/en/latest/reference/soil_classifier/) - _Soil classification_
57
+ - [geolysis.spt](https://docs.geolysis.io/en/latest/reference/spt/) - _Standard Penetration Test (SPT) Analysis_
58
+ - [geolysis.utils](https://docs.geolysis.io/en/latest/reference/utils/) - _Utilities_
59
+
60
+
61
+ ## Imports
62
+
63
+ - **Bearing Capacity**
64
+
65
+ - **Allowable Bearing Capacity (ABC)**
66
+
67
+ ```python
68
+ from geolysis.bearing_capacity.abc import create_abc_4_cohesionless_soils
69
+ ```
70
+
71
+ - **Ultimate Bearing Capacity (UBC)**
72
+
73
+ ```python
74
+ from geolysis.bearing_capacity.ubc import create_ubc_4_all_soil_types
75
+ ```
76
+
77
+ - **Foundation**
78
+
79
+ ```python
80
+ from geolysis.foundation import create_foundation
81
+ ```
82
+
83
+
84
+ - **Soil Classification**
85
+
86
+ ```python
87
+ from geolysis.soil_classifier import create_uscs_classifier
88
+ from geolysis.soil_classifier import create_aashto_classifier
89
+ ```
90
+
91
+ - **Standard Penetration Test (SPT) Analysis**
92
+
93
+ ```python
94
+ from geolysis.spt import DilatancyCorrection
95
+ from geolysis.spt import EnergyCorrection
96
+ from geolysis.spt import SPT
97
+ from geolysis.spt import create_overburden_pressure_correction
98
+ ```
99
+
100
+ ## Project Structure
101
+
102
+ .
103
+ ├── .github # GitHub Actions
104
+ ├── docs # Documentation files
105
+ ├── geolysis # Source files
106
+ ├── tests # Automated tests
107
+ ├── pyproject.toml # Project configuration file
108
+ └── README.md # Project README file
109
+
110
+ ## Usage
111
+
112
+ ```python
113
+
114
+ >>> from geolysis.soil_classifier import create_aashto_classifier
115
+ >>> aashto_clf = create_aashto_classifier(liquid_limit=34.1,
116
+ ... plastic_limit=21.1,
117
+ ... fines=47.88, )
118
+ >>> clf = aashto_clf.classify()
119
+ >>> clf.symbol
120
+ 'A-6(4)'
121
+ >>> clf.symbol_no_grp_idx
122
+ 'A-6'
123
+ >>> clf.group_index
124
+ '4'
125
+ >>> clf.description
126
+ 'Clayey soils'
127
+
128
+ ```
129
+
130
+ Check out more [examples](https://docs.geolysis.io/en/latest/usage/)
131
+
132
+ ## Documentation
133
+
134
+ Check out the full [documentation](https://docs.geolysis.io/en/latest/).
135
+
136
+ ## Contributing
137
+
138
+ Check out the [contribution guidelines](https://docs.geolysis.io/en/latest/dev_guide/)
139
+
140
+ ## License
141
+
142
+ This project is licensed under the MIT License - see the
143
+ [LICENSE](https://github.com/patrickboateng/geolysis/blob/main/LICENSE.txt)
144
+ file for more details.
145
+
146
+ ## Contact
147
+
148
+ For questions or feedback, please
149
+ contact [patrickboateng at patrickboateng dot tech](mailto:patrickboateng@patrickboateng.tech)
@@ -0,0 +1,5 @@
1
+ from . import bearing_capacity, foundation, soil_classifier, spt
2
+
3
+ __version__ = "0.10.0"
4
+
5
+ __all__ = ["foundation", "soil_classifier", "spt", "bearing_capacity"]
@@ -0,0 +1,21 @@
1
+ from ._cohl import (
2
+ ABCType,
3
+ create_abc_4_cohesionless_soils,
4
+ BowlesABC4PadFoundation,
5
+ BowlesABC4MatFoundation,
6
+ MeyerhofABC4MatFoundation,
7
+ MeyerhofABC4PadFoundation,
8
+ TerzaghiABC4MatFoundation,
9
+ TerzaghiABC4PadFoundation,
10
+ )
11
+
12
+ __all__ = [
13
+ "create_abc_4_cohesionless_soils",
14
+ "ABCType",
15
+ "BowlesABC4PadFoundation",
16
+ "BowlesABC4MatFoundation",
17
+ "MeyerhofABC4PadFoundation",
18
+ "MeyerhofABC4MatFoundation",
19
+ "TerzaghiABC4PadFoundation",
20
+ "TerzaghiABC4MatFoundation",
21
+ ]
@@ -0,0 +1,109 @@
1
+ import enum
2
+ from typing import Optional, Annotated
3
+
4
+ from func_validator import MustBeMemberOf, validate_func_args
5
+
6
+ from geolysis.foundation import FoundationType, Shape, create_foundation
7
+ from geolysis.utils import AbstractStrEnum, inf
8
+ from ._core import AllowableBearingCapacity
9
+ from .bowles_abc import BowlesABC4MatFoundation, BowlesABC4PadFoundation
10
+ from .meyerhof_abc import MeyerhofABC4MatFoundation, MeyerhofABC4PadFoundation
11
+ from .terzaghi_abc import TerzaghiABC4MatFoundation, TerzaghiABC4PadFoundation
12
+
13
+
14
+ class ABCType(AbstractStrEnum):
15
+ """Enumeration of allowable bearing capacity calculation methods.
16
+
17
+ Each member represents a different method for determining
18
+ the allowable bearing capacity of soil.
19
+ """
20
+
21
+ BOWLES = enum.auto()
22
+ """Bowles's method for calculating allowable bearing capacity"""
23
+
24
+ MEYERHOF = enum.auto()
25
+ """Meyerhof's method for calculating allowable bearing capacity"""
26
+
27
+ TERZAGHI = enum.auto()
28
+ """Terzaghi's method for calculating allowable bearing capacity"""
29
+
30
+
31
+ @validate_func_args
32
+ def create_abc_4_cohesionless_soils(
33
+ corrected_spt_n_value: float,
34
+ tol_settlement: float,
35
+ depth: float,
36
+ width: float,
37
+ length: Optional[float] = None,
38
+ eccentricity: float = 0.0,
39
+ ground_water_level: float = inf,
40
+ shape: Shape | str = "square",
41
+ foundation_type: Annotated[
42
+ FoundationType | str, MustBeMemberOf(FoundationType)
43
+ ] = "pad",
44
+ abc_type: Annotated[ABCType | str, MustBeMemberOf(ABCType)] = "bowles",
45
+ ) -> AllowableBearingCapacity:
46
+ r"""A factory function that encapsulate the creation of allowable
47
+ bearing capacities.
48
+
49
+ :param corrected_spt_n_value: The corrected SPT N-value.
50
+ :param tol_settlement: Tolerable settlement of foundation (mm).
51
+ :param depth: Depth of foundation (m).
52
+ :param width: Width of foundation footing (m).
53
+ :param length: Length of foundation footing (m).
54
+ :param eccentricity: The deviation of the foundation load from the
55
+ center of gravity of the foundation footing (m).
56
+ :param ground_water_level: Depth of water below ground level (m).
57
+ :param shape: Shape of foundation footing
58
+ :param foundation_type: Type of foundation.
59
+ :param abc_type: Type of allowable bearing capacity calculation to
60
+ apply.
61
+
62
+ :raises ValidationError: Raised if `abc_type` or `foundation_type`
63
+ is not supported.
64
+ :raises ValidationError: Raised if an invalid footing `shape` is
65
+ provided.
66
+ :raises ValueError: Raised when `length` is not provided for a
67
+ rectangular footing.
68
+ """
69
+ abc_type = ABCType(abc_type)
70
+ foundation_type = FoundationType(foundation_type)
71
+
72
+ # exception from create_foundation will automaatically propagate
73
+ # no need to catch and handle it.
74
+ fnd_size = create_foundation(
75
+ depth=depth,
76
+ width=width,
77
+ length=length,
78
+ eccentricity=eccentricity,
79
+ ground_water_level=ground_water_level,
80
+ foundation_type=foundation_type,
81
+ shape=shape,
82
+ )
83
+
84
+ abc_class = _get_allowable_bearing_capacity(abc_type,
85
+ fnd_size.foundation_type)
86
+ return abc_class(
87
+ corrected_spt_n_value=corrected_spt_n_value,
88
+ tol_settlement=tol_settlement,
89
+ foundation_size=fnd_size,
90
+ )
91
+
92
+
93
+ def _get_allowable_bearing_capacity(abc_type: ABCType,
94
+ foundation_type: FoundationType):
95
+ abc_classes = {
96
+ ABCType.BOWLES: {
97
+ FoundationType.PAD: BowlesABC4PadFoundation,
98
+ FoundationType.MAT: BowlesABC4MatFoundation,
99
+ },
100
+ ABCType.MEYERHOF: {
101
+ FoundationType.PAD: MeyerhofABC4PadFoundation,
102
+ FoundationType.MAT: MeyerhofABC4MatFoundation,
103
+ },
104
+ ABCType.TERZAGHI: {
105
+ FoundationType.PAD: TerzaghiABC4PadFoundation,
106
+ FoundationType.MAT: TerzaghiABC4MatFoundation,
107
+ },
108
+ }
109
+ return abc_classes[abc_type][foundation_type]
@@ -1,17 +1,25 @@
1
1
  from abc import ABC, abstractmethod
2
+ from typing import Annotated
2
3
 
3
- from geolysis.foundation import FoundationSize
4
- from geolysis.utils import exceptions as exc
5
- from geolysis.utils import validators
4
+ from func_validator import (
5
+ validate_func_args,
6
+ MustBeNonNegative,
7
+ MustBeLessThanOrEqual,
8
+ )
9
+
10
+ from geolysis.foundation import Foundation
6
11
 
7
12
 
8
13
  class AllowableBearingCapacity(ABC):
9
14
  #: Maximum tolerable foundation settlement (mm).
10
15
  MAX_TOL_SETTLEMENT = 25.4
11
16
 
12
- def __init__(self, corrected_spt_n_value: float,
13
- tol_settlement: float,
14
- foundation_size: FoundationSize) -> None:
17
+ def __init__(
18
+ self,
19
+ corrected_spt_n_value: float,
20
+ tol_settlement: float,
21
+ foundation_size: Foundation,
22
+ ) -> None:
15
23
  self.corrected_spt_n_value = corrected_spt_n_value
16
24
  self.tol_settlement = tol_settlement
17
25
  self.foundation_size = foundation_size
@@ -22,8 +30,8 @@ class AllowableBearingCapacity(ABC):
22
30
  return self._corrected_spt_n_value
23
31
 
24
32
  @corrected_spt_n_value.setter
25
- @validators.ge(0.0)
26
- def corrected_spt_n_value(self, val: float) -> None:
33
+ @validate_func_args
34
+ def corrected_spt_n_value(self, val: Annotated[float, MustBeNonNegative]):
27
35
  self._corrected_spt_n_value = val
28
36
 
29
37
  @property
@@ -32,8 +40,10 @@ class AllowableBearingCapacity(ABC):
32
40
  return self._tol_settlement
33
41
 
34
42
  @tol_settlement.setter
35
- @validators.le(25.4, exc_type=exc.SettlementError)
36
- def tol_settlement(self, tol_settlement: float) -> None:
43
+ @validate_func_args
44
+ def tol_settlement(
45
+ self, tol_settlement: Annotated[float, MustBeLessThanOrEqual(25.4)]
46
+ ):
37
47
  self._tol_settlement = tol_settlement
38
48
 
39
49
  def _sr(self) -> float:
@@ -0,0 +1,103 @@
1
+ from geolysis.foundation import Foundation
2
+ from geolysis.utils import round_
3
+
4
+ from ._core import AllowableBearingCapacity
5
+
6
+
7
+ class BowlesABC4PadFoundation(AllowableBearingCapacity):
8
+ r"""Allowable bearing capacity for pad foundation on cohesionless
9
+ soils according to `Bowles (1997)`.
10
+
11
+ $$
12
+ q_a(kPa) = 19.16(N_1)_{55} f_d\left(\dfrac{S}{25.4}\right),
13
+ \ B \ \le \ 1.2m
14
+ $$
15
+
16
+ $$
17
+ q_a(kPa) = 11.98(N_1)_{55}\left(\dfrac{3.28B + 1}{3.28B} \right)^2
18
+ f_d \left(\dfrac{S}{25.4}\right), \ B \ \gt 1.2m
19
+ $$
20
+
21
+ $$
22
+ f_d = 1 + 0.33 \cdot \frac{D_f}{B} \le 1.33
23
+ $$
24
+
25
+ - $q_a$ (kPa): Allowable bearing capacity
26
+ - $N$: Corrected SPT N-value
27
+ - $f_d$: Depth factor
28
+ - $S$ (mm): Tolerable settlement
29
+ - $B$ (m): Width of foundation footing
30
+ - $D_f$ (m): Depth of foundation footing
31
+ - $D_w$ (m): Depth of water below ground level
32
+
33
+ """
34
+
35
+ def __init__(
36
+ self,
37
+ corrected_spt_n_value: float,
38
+ tol_settlement: float,
39
+ foundation_size: Foundation,
40
+ ) -> None:
41
+ """
42
+ :param corrected_spt_n_value: Statistical average of corrected
43
+ SPT N-value (55% energy with
44
+ overburden pressure correction)
45
+ within the foundation influence
46
+ zone i.e `0.5B` to `2B`.
47
+ :param tol_settlement: Tolerable settlement of foundation (mm).
48
+ :param foundation_size: Size of the foundation.
49
+ """
50
+ super().__init__(
51
+ corrected_spt_n_value=corrected_spt_n_value,
52
+ tol_settlement=tol_settlement,
53
+ foundation_size=foundation_size,
54
+ )
55
+
56
+ @round_(ndigits=2)
57
+ def bearing_capacity(self) -> float:
58
+ """
59
+ Calculate the allowable bearing capacity of the pad foundation.
60
+ """
61
+ n_corr = self.corrected_spt_n_value
62
+ width = self.foundation_size.width
63
+
64
+ if width <= 1.2:
65
+ return 19.16 * n_corr * self._fd() * self._sr()
66
+
67
+ return (
68
+ 11.98
69
+ * n_corr
70
+ * ((3.28 * width + 1) / (3.28 * width)) ** 2
71
+ * self._fd()
72
+ * self._sr()
73
+ )
74
+
75
+
76
+ class BowlesABC4MatFoundation(BowlesABC4PadFoundation):
77
+ r"""Allowable bearing capacity for mat foundation on cohesionless
78
+ soils according to `Bowles (1997)`.
79
+
80
+ $$
81
+ q_a(kPa) = 11.98(N_1)_{55}f_d\left(\dfrac{S}{25.4}\right)
82
+ $$
83
+
84
+ $$
85
+ f_d = 1 + 0.33 \cdot \frac{D_f}{B} \le 1.33
86
+ $$
87
+
88
+ - $q_a$ (kPa): Allowable bearing capacity
89
+ - $N$: Corrected SPT N-value
90
+ - $f_d$: Depth factor
91
+ - $S$ (mm): Tolerable settlement
92
+ - $B$ (m): Width of foundation footing
93
+ - $D_f$ (m): Depth of foundation footing
94
+ - $D_w$ (m): Depth of water below ground level
95
+ """
96
+
97
+ @round_(ndigits=2)
98
+ def bearing_capacity(self) -> float:
99
+ """
100
+ Calculate the allowable bearing capacity of the mat foundation.
101
+ """
102
+ n_corr = self.corrected_spt_n_value
103
+ return 11.98 * n_corr * self._fd() * self._sr()