geolysis 0.9.0__tar.gz → 0.10.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.
Files changed (49) hide show
  1. geolysis-0.10.1/PKG-INFO +182 -0
  2. geolysis-0.10.1/README.md +149 -0
  3. geolysis-0.10.1/geolysis/__init__.py +5 -0
  4. geolysis-0.10.1/geolysis/bearing_capacity/abc/__init__.py +21 -0
  5. geolysis-0.10.1/geolysis/bearing_capacity/abc/_cohl/__init__.py +109 -0
  6. {geolysis-0.9.0/geolysis/bearing_capacity/abc/cohl → geolysis-0.10.1/geolysis/bearing_capacity/abc/_cohl}/_core.py +25 -8
  7. geolysis-0.10.1/geolysis/bearing_capacity/abc/_cohl/bowles_abc.py +103 -0
  8. geolysis-0.10.1/geolysis/bearing_capacity/abc/_cohl/meyerhof_abc.py +100 -0
  9. geolysis-0.10.1/geolysis/bearing_capacity/abc/_cohl/terzaghi_abc.py +148 -0
  10. geolysis-0.10.1/geolysis/bearing_capacity/ubc/__init__.py +131 -0
  11. {geolysis-0.9.0 → geolysis-0.10.1}/geolysis/bearing_capacity/ubc/_core.py +82 -52
  12. geolysis-0.10.1/geolysis/bearing_capacity/ubc/_hansen_ubc.py +271 -0
  13. geolysis-0.10.1/geolysis/bearing_capacity/ubc/_terzaghi_ubc.py +178 -0
  14. geolysis-0.10.1/geolysis/bearing_capacity/ubc/_vesic_ubc.py +253 -0
  15. {geolysis-0.9.0 → geolysis-0.10.1}/geolysis/foundation.py +146 -136
  16. {geolysis-0.9.0 → geolysis-0.10.1}/geolysis/soil_classifier.py +386 -290
  17. geolysis-0.10.1/geolysis/spt.py +658 -0
  18. geolysis-0.9.0/geolysis/utils/__init__.py → geolysis-0.10.1/geolysis/utils.py +44 -33
  19. geolysis-0.10.1/geolysis.egg-info/PKG-INFO +182 -0
  20. {geolysis-0.9.0 → geolysis-0.10.1}/geolysis.egg-info/SOURCES.txt +10 -11
  21. {geolysis-0.9.0 → geolysis-0.10.1}/geolysis.egg-info/requires.txt +1 -0
  22. {geolysis-0.9.0 → geolysis-0.10.1}/pyproject.toml +4 -4
  23. geolysis-0.10.1/tests/test_docs.py +10 -0
  24. {geolysis-0.9.0 → geolysis-0.10.1}/tests/test_foundation.py +21 -17
  25. geolysis-0.10.1/tests/test_soil_classifier.py +158 -0
  26. {geolysis-0.9.0 → geolysis-0.10.1}/tests/test_spt.py +83 -54
  27. geolysis-0.9.0/PKG-INFO +0 -206
  28. geolysis-0.9.0/README.md +0 -174
  29. geolysis-0.9.0/geolysis/__init__.py +0 -5
  30. geolysis-0.9.0/geolysis/bearing_capacity/abc/__init__.py +0 -0
  31. geolysis-0.9.0/geolysis/bearing_capacity/abc/cohl/__init__.py +0 -137
  32. geolysis-0.9.0/geolysis/bearing_capacity/abc/cohl/bowles_abc.py +0 -96
  33. geolysis-0.9.0/geolysis/bearing_capacity/abc/cohl/meyerhof_abc.py +0 -96
  34. geolysis-0.9.0/geolysis/bearing_capacity/abc/cohl/terzaghi_abc.py +0 -131
  35. geolysis-0.9.0/geolysis/bearing_capacity/ubc/__init__.py +0 -152
  36. geolysis-0.9.0/geolysis/bearing_capacity/ubc/hansen_ubc.py +0 -287
  37. geolysis-0.9.0/geolysis/bearing_capacity/ubc/terzaghi_ubc.py +0 -246
  38. geolysis-0.9.0/geolysis/bearing_capacity/ubc/vesic_ubc.py +0 -293
  39. geolysis-0.9.0/geolysis/spt.py +0 -592
  40. geolysis-0.9.0/geolysis/utils/exceptions.py +0 -65
  41. geolysis-0.9.0/geolysis/utils/validators.py +0 -119
  42. geolysis-0.9.0/geolysis.egg-info/PKG-INFO +0 -206
  43. geolysis-0.9.0/tests/test_soil_classifier.py +0 -176
  44. {geolysis-0.9.0 → geolysis-0.10.1}/LICENSE.txt +0 -0
  45. {geolysis-0.9.0 → geolysis-0.10.1}/geolysis/bearing_capacity/__init__.py +0 -0
  46. {geolysis-0.9.0 → geolysis-0.10.1}/geolysis.egg-info/dependency_links.txt +0 -0
  47. {geolysis-0.9.0 → geolysis-0.10.1}/geolysis.egg-info/top_level.txt +0 -0
  48. {geolysis-0.9.0 → geolysis-0.10.1}/setup.cfg +0 -0
  49. {geolysis-0.9.0 → geolysis-0.10.1}/setup.py +0 -0
@@ -0,0 +1,182 @@
1
+ Metadata-Version: 2.4
2
+ Name: geolysis
3
+ Version: 0.10.1
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
+ Requires-Dist: func-validator
28
+ Provides-Extra: dev
29
+ Requires-Dist: pytest; extra == "dev"
30
+ Requires-Dist: pytest-cov; extra == "dev"
31
+ Requires-Dist: coverage; extra == "dev"
32
+ Dynamic: license-file
33
+
34
+ <div align="center">
35
+ <img src="https://raw.githubusercontent.com/patrickboateng/geolysis/main/docs/assets/pkg-logo.svg"
36
+ alt="logo" width="30%" height="30%" />
37
+ </div><br>
38
+
39
+ <div align="center">
40
+
41
+ [![PyPI Latest Release](https://img.shields.io/pypi/v/geolysis?style=flat&logo=pypi)](https://pypi.org/project/geolysis/)
42
+ [![PyPI Downloads](https://static.pepy.tech/badge/geolysis)](https://pepy.tech/projects/geolysis)
43
+ [![PyPI pyversions](https://img.shields.io/pypi/pyversions/geolysis.svg?logo=python&style=flat)](https://pypi.python.org/pypi/geolysis/)
44
+ [![license](https://img.shields.io/pypi/l/geolysis?style=flat&logo=opensourceinitiative)](https://opensource.org/license/mit/)
45
+
46
+ ![Coveralls Status](https://img.shields.io/coverallsCoverage/github/patrickboateng/geolysis?logo=coveralls)
47
+ [![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)
48
+ [![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)
49
+ [![Documentation Status](https://readthedocs.org/projects/geolysis/badge/?version=latest)](https://geolysis.readthedocs.io/en/latest/?badge=latest)
50
+
51
+ </div>
52
+
53
+ `geolysis` is an open-source python package (library) for geotechnical analysis
54
+ and modeling.
55
+
56
+ The `geolysis` python package is among three other projects, `geolysis.excel`,
57
+ `geolysis.gui`, and `geolysis.ai`. More details about these projects are
58
+ provided [here](https://github.com/geolysis-dev).
59
+
60
+ The rest of this **README** provides an overview of the `geolysis` python
61
+ package.
62
+
63
+ ## Table of Contents
64
+
65
+ - [Installation](#installation)
66
+ - [API Reference](#api-reference)
67
+ - [Imports](#imports)
68
+ - [Project Structure](#project-structure)
69
+ - [Usage](#usage)
70
+ - [Documentation](#documentation)
71
+ - [Contributing](#contributing)
72
+ - [License](#license)
73
+ - [Contact](#contact)
74
+
75
+ ## Installation
76
+
77
+ ```shell
78
+ $ pip install geolysis
79
+ ```
80
+
81
+ ## API Reference
82
+
83
+ - [Python API](https://docs.geolysis.io/en/latest/reference/)
84
+ - [geolysis.bearing_capacity.abc](https://docs.geolysis.io/en/latest/reference/allowable_bearing_capacity/) - _Allowable bearing capacity
85
+ estimation_
86
+ - [geolysis.bearing_capacity.ubc](https://docs.geolysis.io/en/latest/reference/ultimate_bearing_capacity/) - _Ultimate bearing capacity
87
+ estimation_
88
+ - [geolysis.foundation](https://docs.geolysis.io/en/latest/reference/foundation/) - _Foundation Representation_
89
+ - [geolysis.soil_classifier](https://docs.geolysis.io/en/latest/reference/soil_classifier/) - _Soil classification_
90
+ - [geolysis.spt](https://docs.geolysis.io/en/latest/reference/spt/) - _Standard Penetration Test (SPT) Analysis_
91
+ - [geolysis.utils](https://docs.geolysis.io/en/latest/reference/utils/) - _Utilities_
92
+
93
+
94
+ ## Imports
95
+
96
+ - **Bearing Capacity**
97
+
98
+ - **Allowable Bearing Capacity (ABC)**
99
+
100
+ ```python
101
+ from geolysis.bearing_capacity.abc import create_abc_4_cohesionless_soils
102
+ ```
103
+
104
+ - **Ultimate Bearing Capacity (UBC)**
105
+
106
+ ```python
107
+ from geolysis.bearing_capacity.ubc import create_ubc_4_all_soil_types
108
+ ```
109
+
110
+ - **Foundation**
111
+
112
+ ```python
113
+ from geolysis.foundation import create_foundation
114
+ ```
115
+
116
+
117
+ - **Soil Classification**
118
+
119
+ ```python
120
+ from geolysis.soil_classifier import create_uscs_classifier
121
+ from geolysis.soil_classifier import create_aashto_classifier
122
+ ```
123
+
124
+ - **Standard Penetration Test (SPT) Analysis**
125
+
126
+ ```python
127
+ from geolysis.spt import DilatancyCorrection
128
+ from geolysis.spt import EnergyCorrection
129
+ from geolysis.spt import SPT
130
+ from geolysis.spt import create_overburden_pressure_correction
131
+ ```
132
+
133
+ ## Project Structure
134
+
135
+ .
136
+ ├── .github # GitHub Actions
137
+ ├── docs # Documentation files
138
+ ├── geolysis # Source files
139
+ ├── tests # Automated tests
140
+ ├── pyproject.toml # Project configuration file
141
+ └── README.md # Project README file
142
+
143
+ ## Usage
144
+
145
+ ```python
146
+
147
+ >>> from geolysis.soil_classifier import create_aashto_classifier
148
+ >>> aashto_clf = create_aashto_classifier(liquid_limit=34.1,
149
+ ... plastic_limit=21.1,
150
+ ... fines=47.88, )
151
+ >>> clf = aashto_clf.classify()
152
+ >>> clf.symbol
153
+ 'A-6(4)'
154
+ >>> clf.symbol_no_grp_idx
155
+ 'A-6'
156
+ >>> clf.group_index
157
+ '4'
158
+ >>> clf.description
159
+ 'Clayey soils'
160
+
161
+ ```
162
+
163
+ Check out more [examples](https://docs.geolysis.io/en/latest/usage/)
164
+
165
+ ## Documentation
166
+
167
+ Check out the full [documentation](https://docs.geolysis.io/en/latest/).
168
+
169
+ ## Contributing
170
+
171
+ Check out the [contribution guidelines](https://docs.geolysis.io/en/latest/dev_guide/)
172
+
173
+ ## License
174
+
175
+ This project is licensed under the MIT License - see the
176
+ [LICENSE](https://github.com/patrickboateng/geolysis/blob/main/LICENSE.txt)
177
+ file for more details.
178
+
179
+ ## Contact
180
+
181
+ For questions or feedback, please
182
+ 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.1"
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,16 +1,25 @@
1
1
  from abc import ABC, abstractmethod
2
+ from typing import Annotated
3
+
4
+ from func_validator import (
5
+ validate_func_args,
6
+ MustBeNonNegative,
7
+ MustBeLessThanOrEqual,
8
+ )
2
9
 
3
10
  from geolysis.foundation import Foundation
4
- from geolysis.utils import validators
5
11
 
6
12
 
7
13
  class AllowableBearingCapacity(ABC):
8
14
  #: Maximum tolerable foundation settlement (mm).
9
15
  MAX_TOL_SETTLEMENT = 25.4
10
16
 
11
- def __init__(self, corrected_spt_n_value: float,
12
- tol_settlement: float,
13
- foundation_size: Foundation) -> None:
17
+ def __init__(
18
+ self,
19
+ corrected_spt_n_value: float,
20
+ tol_settlement: float,
21
+ foundation_size: Foundation,
22
+ ) -> None:
14
23
  self.corrected_spt_n_value = corrected_spt_n_value
15
24
  self.tol_settlement = tol_settlement
16
25
  self.foundation_size = foundation_size
@@ -21,8 +30,8 @@ class AllowableBearingCapacity(ABC):
21
30
  return self._corrected_spt_n_value
22
31
 
23
32
  @corrected_spt_n_value.setter
24
- @validators.ge(0.0)
25
- def corrected_spt_n_value(self, val: float) -> None:
33
+ @validate_func_args
34
+ def corrected_spt_n_value(self, val: Annotated[float, MustBeNonNegative]):
26
35
  self._corrected_spt_n_value = val
27
36
 
28
37
  @property
@@ -31,8 +40,10 @@ class AllowableBearingCapacity(ABC):
31
40
  return self._tol_settlement
32
41
 
33
42
  @tol_settlement.setter
34
- @validators.le(25.4)
35
- 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
+ ):
36
47
  self._tol_settlement = tol_settlement
37
48
 
38
49
  def _sr(self) -> float:
@@ -45,5 +56,11 @@ class AllowableBearingCapacity(ABC):
45
56
  width = self.foundation_size.width
46
57
  return min(1.0 + 0.33 * depth / width, 1.33)
47
58
 
59
+ def bearing_capacity_results(self) -> dict:
60
+ return {
61
+ "bearing_capacity": self.bearing_capacity(),
62
+ "depth_factor": self._fd(),
63
+ }
64
+
48
65
  @abstractmethod
49
66
  def bearing_capacity(self): ...
@@ -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()