Skip to content

Commit ff3563a

Browse files
version 0.12.0
1 parent c4bcca0 commit ff3563a

File tree

6 files changed

+87
-93
lines changed

6 files changed

+87
-93
lines changed

geolysis/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from . import bearing_capacity, foundation, soil_classifier, spt
22

3-
__version__ = "0.11.0"
3+
__version__ = "0.12.0"
44

55
__all__ = ["foundation", "soil_classifier", "spt", "bearing_capacity"]

geolysis/bearing_capacity/ubc/_core.py

Lines changed: 21 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,14 @@ class UltimateBearingCapacityResult:
3333

3434
class UltimateBearingCapacity(ABC):
3535
def __init__(
36-
self,
37-
friction_angle: float,
38-
cohesion: float,
39-
moist_unit_wgt: float,
40-
foundation_size: Foundation,
41-
saturated_unit_wgt: float = 20.5,
42-
apply_local_shear: bool = False,
43-
factor_of_safety: float = 3.0,
36+
self,
37+
friction_angle: float,
38+
cohesion: float,
39+
moist_unit_wgt: float,
40+
foundation_size: Foundation,
41+
saturated_unit_wgt: float = 20.5,
42+
apply_local_shear: bool = False,
43+
factor_of_safety: float = 3.0,
4444
) -> None:
4545
r"""
4646
:param friction_angle: Internal angle of friction for general
@@ -197,20 +197,20 @@ def _embedment_term(self, coef: float = 0.5) -> float:
197197
unit_wgt = wgt + (d / width) * (self.moist_unit_wgt - wgt)
198198

199199
return (
200-
coef
201-
* unit_wgt
202-
* width
203-
* self.n_gamma
204-
* self.s_gamma
205-
* self.d_gamma
206-
* self.i_gamma
200+
coef
201+
* unit_wgt
202+
* width
203+
* self.n_gamma
204+
* self.s_gamma
205+
* self.d_gamma
206+
* self.i_gamma
207207
)
208208

209209
def _bearing_capacity(self) -> float:
210210
return (
211-
self._cohesion_term(1.0)
212-
+ self._surcharge_term()
213-
+ self._embedment_term(0.5)
211+
self._cohesion_term(1.0)
212+
+ self._surcharge_term()
213+
+ self._embedment_term(0.5)
214214
)
215215

216216
def bearing_capacity_results(self) -> UltimateBearingCapacityResult:
@@ -265,15 +265,12 @@ def allowable_applied_load(self) -> float:
265265

266266
@property
267267
@abstractmethod
268-
def n_c(self) -> float:
269-
...
268+
def n_c(self) -> float: ...
270269

271270
@property
272271
@abstractmethod
273-
def n_q(self) -> float:
274-
...
272+
def n_q(self) -> float: ...
275273

276274
@property
277275
@abstractmethod
278-
def n_gamma(self) -> float:
279-
...
276+
def n_gamma(self) -> float: ...

geolysis/bearing_capacity/ubc/_hansen_ubc.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def n_c(friction_angle: float) -> float:
2424
if isclose(friction_angle, 0.0):
2525
return 5.14
2626
return cotdeg(friction_angle) * (
27-
HansenBearingCapacityFactors.n_q(friction_angle) - 1.0
27+
HansenBearingCapacityFactors.n_q(friction_angle) - 1.0
2828
)
2929

3030
@staticmethod
@@ -38,9 +38,9 @@ def n_q(friction_angle: float) -> float:
3838
@round_(ndigits=2)
3939
def n_gamma(friction_angle: float) -> float:
4040
return (
41-
1.8
42-
* (HansenBearingCapacityFactors.n_q(friction_angle) - 1.0)
43-
* tandeg(friction_angle)
41+
1.8
42+
* (HansenBearingCapacityFactors.n_q(friction_angle) - 1.0)
43+
* tandeg(friction_angle)
4444
)
4545

4646

@@ -102,10 +102,10 @@ class HansenInclinationFactors:
102102
@staticmethod
103103
@round_(ndigits=2)
104104
def i_c(
105-
cohesion: float,
106-
load_angle: float,
107-
f_width: float,
108-
f_length: float,
105+
cohesion: float,
106+
load_angle: float,
107+
f_width: float,
108+
f_length: float,
109109
) -> float:
110110
return 1.0 - sindeg(load_angle) / (2.0 * cohesion * f_width * f_length)
111111

geolysis/bearing_capacity/ubc/_terzaghi_ubc.py

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def n_c(friction_angle: float) -> float:
2727
if isclose(friction_angle, 0.0):
2828
return 5.7
2929
return cotdeg(friction_angle) * (
30-
TerzaghiBearingCapacityFactors.n_q(friction_angle) - 1.0
30+
TerzaghiBearingCapacityFactors.n_q(friction_angle) - 1.0
3131
)
3232

3333
@staticmethod
@@ -40,8 +40,7 @@ def n_q(friction_angle: float) -> float:
4040
@staticmethod
4141
@round_(ndigits=2)
4242
def n_gamma(friction_angle: float) -> float:
43-
return (TerzaghiBearingCapacityFactors.n_q(
44-
friction_angle) - 1.0) * tandeg(
43+
return (TerzaghiBearingCapacityFactors.n_q(friction_angle) - 1.0) * tandeg(
4544
1.4 * friction_angle
4645
)
4746

@@ -77,9 +76,9 @@ class TerzaghiUBC4StripFooting(TerzaghiUltimateBearingCapacity):
7776
def _bearing_capacity(self) -> float:
7877
"""Calculates ultimate bearing capacity for strip footing."""
7978
return (
80-
self._cohesion_term(1.0)
81-
+ self._surcharge_term()
82-
+ self._embedment_term(0.5)
79+
self._cohesion_term(1.0)
80+
+ self._surcharge_term()
81+
+ self._embedment_term(0.5)
8382
)
8483

8584

@@ -95,9 +94,9 @@ class TerzaghiUBC4CircularFooting(TerzaghiUltimateBearingCapacity):
9594
def _bearing_capacity(self) -> float:
9695
"""Calculates ultimate bearing capacity for circular footing."""
9796
return (
98-
self._cohesion_term(1.3)
99-
+ self._surcharge_term()
100-
+ self._embedment_term(0.3)
97+
self._cohesion_term(1.3)
98+
+ self._surcharge_term()
99+
+ self._embedment_term(0.3)
101100
)
102101

103102

@@ -118,9 +117,9 @@ def _bearing_capacity(self) -> float:
118117
emb_coef = (1.0 - 0.2 * (width / length)) / 2.0
119118

120119
return (
121-
self._cohesion_term(coh_coef)
122-
+ self._surcharge_term()
123-
+ self._embedment_term(emb_coef)
120+
self._cohesion_term(coh_coef)
121+
+ self._surcharge_term()
122+
+ self._embedment_term(emb_coef)
124123
)
125124

126125

geolysis/bearing_capacity/ubc/_vesic_ubc.py

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -22,20 +22,20 @@ def n_q(friction_angle: float) -> float:
2222
@round_(ndigits=2)
2323
def n_gamma(friction_angle: float) -> float:
2424
return (
25-
2.0
26-
* (VesicBearingCapacityFactors.n_q(friction_angle) + 1.0)
27-
* tandeg(friction_angle)
25+
2.0
26+
* (VesicBearingCapacityFactors.n_q(friction_angle) + 1.0)
27+
* tandeg(friction_angle)
2828
)
2929

3030

3131
class VesicShapeFactors:
3232
@staticmethod
3333
@round_(ndigits=3)
3434
def s_c(
35-
friction_angle: float,
36-
f_width: float,
37-
f_length: float,
38-
f_shape: Shape,
35+
friction_angle: float,
36+
f_width: float,
37+
f_length: float,
38+
f_shape: Shape,
3939
) -> float:
4040
n_q = VesicBearingCapacityFactors.n_q(friction_angle)
4141
n_c = VesicBearingCapacityFactors.n_c(friction_angle)
@@ -48,10 +48,10 @@ def s_c(
4848
@staticmethod
4949
@round_(ndigits=3)
5050
def s_q(
51-
friction_angle: float,
52-
f_width: float,
53-
f_length: float,
54-
f_shape: Shape,
51+
friction_angle: float,
52+
f_width: float,
53+
f_length: float,
54+
f_shape: Shape,
5555
) -> float:
5656
if f_shape == Shape.STRIP:
5757
return 1.0
@@ -103,19 +103,18 @@ def d_q(friction_angle: float, f_depth: float, f_width: float) -> float:
103103
_d_q = 1.0
104104
else:
105105
_d_q = (
106-
1.0
107-
+ 2
108-
* tandeg(friction_angle)
109-
* (1 - sindeg(friction_angle)) ** 2
110-
* d2w
106+
1.0
107+
+ 2
108+
* tandeg(friction_angle)
109+
* (1 - sindeg(friction_angle)) ** 2
110+
* d2w
111111
)
112112
else:
113113
if isclose(friction_angle, 0.0):
114114
_d_q = 1.0
115115
else:
116116
_d_q = 1.0 + (
117-
2.0 * tandeg(friction_angle) * (
118-
1 - sindeg(friction_angle)) ** 2
117+
2.0 * tandeg(friction_angle) * (1 - sindeg(friction_angle)) ** 2
119118
) * atan(d2w)
120119
return _d_q
121120

@@ -215,5 +214,4 @@ def i_q(self) -> float:
215214
@property
216215
def i_gamma(self) -> float:
217216
r"""Inclination factor $I_{\gamma}$."""
218-
return VesicInclinationFactors.i_gamma(self.friction_angle,
219-
self.load_angle)
217+
return VesicInclinationFactors.i_gamma(self.friction_angle, self.load_angle)

tests/test_bearing_capacity/test_ubc_4_soils/test_terzaghi_ubc.py

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -61,15 +61,15 @@ class TestTerzaghiUBC4SquareFooting:
6161
[(25.0, 15.0, 18.0, 1.0, 2.0, inf, True, 323.01)],
6262
)
6363
def test_bearing_capacity(
64-
self,
65-
friction_angle,
66-
cohesion,
67-
moist_unit_wgt,
68-
depth,
69-
width,
70-
water_level,
71-
apply_loc_shear,
72-
expected,
64+
self,
65+
friction_angle,
66+
cohesion,
67+
moist_unit_wgt,
68+
depth,
69+
width,
70+
water_level,
71+
apply_loc_shear,
72+
expected,
7373
):
7474
ubc = create_ubc_4_all_soil_types(
7575
friction_angle=friction_angle,
@@ -102,15 +102,15 @@ class TestTerzaghiUBC4CircFooting:
102102
[(25.0, 15.0, 18.0, 1.0, 2.3, None, True, 318.9)],
103103
)
104104
def test_bearing_capacity(
105-
self,
106-
friction_angle,
107-
cohesion,
108-
moist_unit_wgt,
109-
depth,
110-
width,
111-
water_level,
112-
apply_loc_shear,
113-
expected,
105+
self,
106+
friction_angle,
107+
cohesion,
108+
moist_unit_wgt,
109+
depth,
110+
width,
111+
water_level,
112+
apply_loc_shear,
113+
expected,
114114
):
115115
ubc = create_ubc_4_all_soil_types(
116116
friction_angle=friction_angle,
@@ -144,16 +144,16 @@ class TestTerzaghiUBC4RectFooting:
144144
[(25.0, 15.0, 18.0, 1.0, 1.5, 2.5, None, True, 300.03)],
145145
)
146146
def test_bearing_capacity(
147-
self,
148-
friction_angle,
149-
cohesion,
150-
moist_unit_wgt,
151-
depth,
152-
width,
153-
length,
154-
water_level,
155-
apply_loc_shear,
156-
expected,
147+
self,
148+
friction_angle,
149+
cohesion,
150+
moist_unit_wgt,
151+
depth,
152+
width,
153+
length,
154+
water_level,
155+
apply_loc_shear,
156+
expected,
157157
):
158158
ubc = create_ubc_4_all_soil_types(
159159
friction_angle=friction_angle,

0 commit comments

Comments
 (0)