Skip to content

Commit a727fb6

Browse files
modified names of some classes to make them more intuitive
1 parent 989c403 commit a727fb6

File tree

12 files changed

+35
-35
lines changed

12 files changed

+35
-35
lines changed

docs/user_guide/allowable-bearing-capacity.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Calculating the allowable bearing capacity of soil for pad foundations using
1212
... width=1.2,
1313
... shape="square",
1414
... foundation_type="pad",
15-
... abc_type="bowles")
15+
... abc_method="bowles")
1616
>>> bowles_abc.allowable_bearing_capacity()
1717
341.1
1818

docs/user_guide/ultimate-bearing-capacity.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ correlation:
1212
... depth=1.5,
1313
... width=2.0,
1414
... shape="square",
15-
... ubc_type="vesic")
15+
... ubc_method="vesic")
1616
>>> hansen_ubc.ultimate_bearing_capacity()
1717
893.2
1818

geolysis/bearing_capacity/abc/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from ._cohl import (
2-
ABCType,
2+
ABCMethod,
33
BowlesABC4MatFoundation,
44
BowlesABC4PadFoundation,
55
MeyerhofABC4MatFoundation,
@@ -16,6 +16,6 @@
1616
"MeyerhofABC4MatFoundation",
1717
"TerzaghiABC4PadFoundation",
1818
"TerzaghiABC4MatFoundation",
19-
"ABCType",
19+
"ABCMethod",
2020
"create_abc_4_cohesionless_soils",
2121
]

geolysis/bearing_capacity/abc/_cohl/__init__.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
from .terzaghi_abc import TerzaghiABC4MatFoundation, TerzaghiABC4PadFoundation
1313

1414

15-
class ABCType(AbstractStrEnum):
15+
class ABCMethod(AbstractStrEnum):
1616
"""Enumeration of allowable bearing capacity calculation methods.
1717
1818
Each member represents a different method for determining
@@ -30,15 +30,15 @@ class ABCType(AbstractStrEnum):
3030

3131

3232
abc_classes = {
33-
ABCType.BOWLES: {
33+
ABCMethod.BOWLES: {
3434
FoundationType.PAD: BowlesABC4PadFoundation,
3535
FoundationType.MAT: BowlesABC4MatFoundation,
3636
},
37-
ABCType.MEYERHOF: {
37+
ABCMethod.MEYERHOF: {
3838
FoundationType.PAD: MeyerhofABC4PadFoundation,
3939
FoundationType.MAT: MeyerhofABC4MatFoundation,
4040
},
41-
ABCType.TERZAGHI: {
41+
ABCMethod.TERZAGHI: {
4242
FoundationType.PAD: TerzaghiABC4PadFoundation,
4343
FoundationType.MAT: TerzaghiABC4MatFoundation,
4444
},
@@ -56,7 +56,7 @@ def create_abc_4_cohesionless_soils(
5656
ground_water_level: float = inf,
5757
shape: Shape | str = "square",
5858
foundation_type: FoundationType | str = "pad",
59-
abc_type: Annotated[ABCType | str, MustBeMemberOf(ABCType)] = "bowles",
59+
abc_method: Annotated[ABCMethod | str, MustBeMemberOf(ABCMethod)] = "bowles",
6060
) -> AllowableBearingCapacity:
6161
r"""A factory function that encapsulate the creation of allowable
6262
bearing capacities.
@@ -71,10 +71,10 @@ def create_abc_4_cohesionless_soils(
7171
:param ground_water_level: Depth of water below ground level (m).
7272
:param shape: Shape of foundation footing
7373
:param foundation_type: Type of foundation.
74-
:param abc_type: Type of allowable bearing capacity calculation to
74+
:param abc_method: Type of allowable bearing capacity calculation to
7575
apply.
7676
"""
77-
abc_type = ABCType(abc_type)
77+
abc_method = ABCMethod(abc_method)
7878
foundation_type = FoundationType(foundation_type)
7979

8080
# exception from create_foundation will automaatically propagate
@@ -88,7 +88,7 @@ def create_abc_4_cohesionless_soils(
8888
foundation_type=foundation_type,
8989
shape=shape,
9090
)
91-
abc_class = abc_classes[abc_type][foundation_type]
91+
abc_class = abc_classes[abc_method][foundation_type]
9292

9393
return abc_class(
9494
corrected_spt_n_value=corrected_spt_n_value,

geolysis/bearing_capacity/ubc/__init__.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@
2121
"TerzaghiUBC4RectangularFooting",
2222
"TerzaghiUBC4SquareFooting",
2323
"VesicUltimateBearingCapacity",
24-
"UBCType",
24+
"UBCMethod",
2525
"create_ubc_4_all_soils",
2626
]
2727

2828

29-
class UBCType(AbstractStrEnum):
29+
class UBCMethod(AbstractStrEnum):
3030
"""Enumeration of available ultimate bearing capacity methods.
3131
3232
Each member represents a different method for determining
@@ -41,13 +41,13 @@ class UBCType(AbstractStrEnum):
4141

4242

4343
ubc_classes = {
44-
UBCType.TERZAGHI: {
44+
UBCMethod.TERZAGHI: {
4545
Shape.STRIP: TerzaghiUBC4StripFooting,
4646
Shape.CIRCLE: TerzaghiUBC4CircularFooting,
4747
Shape.SQUARE: TerzaghiUBC4SquareFooting,
4848
Shape.RECTANGLE: TerzaghiUBC4RectangularFooting,
4949
},
50-
UBCType.VESIC: VesicUltimateBearingCapacity,
50+
UBCMethod.VESIC: VesicUltimateBearingCapacity,
5151
}
5252

5353

@@ -66,7 +66,7 @@ def create_ubc_4_all_soils(
6666
load_angle: float = 0.0,
6767
apply_local_shear: bool = False,
6868
shape: Shape | str = "square",
69-
ubc_type: Annotated[UBCType | str, MustBeMemberOf(UBCType)] = "vesic",
69+
ubc_method: Annotated[UBCMethod | str, MustBeMemberOf(UBCMethod)] = "vesic",
7070
) -> UltimateBearingCapacity:
7171
r"""A factory function that encapsulate the creation of ultimate
7272
bearing capacity.
@@ -89,7 +89,7 @@ def create_ubc_4_all_soils(
8989
:param apply_local_shear: Indicate whether bearing capacity failure
9090
is general or local shear failure.
9191
:param shape: Shape of foundation footing.
92-
:param ubc_type: Type of allowable bearing capacity calculation to
92+
:param ubc_method: Type of allowable bearing capacity calculation to
9393
apply.
9494
9595
:raises ValidationError: Raised if ubc_type is not supported.
@@ -99,7 +99,7 @@ def create_ubc_4_all_soils(
9999
rectangular footing.
100100
"""
101101

102-
ubc_type = UBCType(ubc_type)
102+
ubc_method = UBCMethod(ubc_method)
103103

104104
# exception from create_foundation will automatically propagate
105105
# no need to catch and handle it.
@@ -112,10 +112,10 @@ def create_ubc_4_all_soils(
112112
ground_water_level=ground_water_level,
113113
shape=shape,
114114
)
115-
ubc_class = ubc_classes[ubc_type]
115+
ubc_class = ubc_classes[ubc_method]
116116

117-
if ubc_type == UBCType.TERZAGHI:
118-
ubc_class = ubc_classes[ubc_type][fnd_size.footing_shape]
117+
if ubc_method == UBCMethod.TERZAGHI:
118+
ubc_class = ubc_classes[ubc_method][fnd_size.footing_shape]
119119

120120
return ubc_class(
121121
friction_angle=friction_angle,

tests/test_bearing_capacity/test_abc_4_soils/test_abc.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ def test_create_allowable_bearing_capacity_errors():
1212
tol_settlement=20,
1313
depth=1.5,
1414
width=1.2,
15-
abc_type="HANSEN",
15+
abc_method="HANSEN",
1616
)
1717

1818
# Invalid foundation_type provided
@@ -22,6 +22,6 @@ def test_create_allowable_bearing_capacity_errors():
2222
tol_settlement=20,
2323
depth=1.5,
2424
width=1.2,
25-
abc_type="BOWLES",
25+
abc_method="BOWLES",
2626
foundation_type="COMBINED",
2727
)

tests/test_bearing_capacity/test_abc_4_soils/test_bowles_abc.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def test_bowles_abc_4_pad_foundation(
3636
width=width,
3737
shape=footing_shape,
3838
foundation_type=foundation_type,
39-
abc_type="bowles",
39+
abc_method="bowles",
4040
)
4141
exp_abc, exp_load = expected
4242
assert bowles.allowable_bearing_capacity() == pytest.approx(exp_abc,
@@ -73,7 +73,7 @@ def test_bowles_abc_4_mat_foundation(
7373
width=width,
7474
shape=footing_shape,
7575
foundation_type=foundation_type,
76-
abc_type="bowles",
76+
abc_method="bowles",
7777
)
7878
assert bowles.allowable_bearing_capacity() == pytest.approx(
7979
expected=expected, rel=0.01

tests/test_bearing_capacity/test_abc_4_soils/test_meyerhof_abc.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def test_meyerhof_abc_4_pad_foundation(
3636
width=width,
3737
shape=footing_shape,
3838
foundation_type=foundation_type,
39-
abc_type="meyerhof",
39+
abc_method="meyerhof",
4040
)
4141
assert meyerhof.allowable_bearing_capacity() == pytest.approx(
4242
expected=expected, rel=0.01
@@ -71,7 +71,7 @@ def test_meyerhof_abc_4_mat_foundation(
7171
width=width,
7272
shape=footing_shape,
7373
foundation_type=foundation_type,
74-
abc_type="meyerhof",
74+
abc_method="meyerhof",
7575
)
7676
assert meyerhof.allowable_bearing_capacity() == pytest.approx(
7777
expected=expected, rel=0.01

tests/test_bearing_capacity/test_abc_4_soils/test_terzaghi_abc.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def test_terzaghi_abc_4_pad_foundation(
4242
ground_water_level=ground_water_level,
4343
shape=footing_shape,
4444
foundation_type=foundation_type,
45-
abc_type="terzaghi",
45+
abc_method="terzaghi",
4646
)
4747

4848
assert terzaghi.allowable_bearing_capacity() == pytest.approx(
@@ -81,7 +81,7 @@ def test_terzaghi_abc_4_mat_foundation(
8181
ground_water_level=ground_water_level,
8282
shape=footing_shape,
8383
foundation_type=foundation_type,
84-
abc_type="terzaghi",
84+
abc_method="terzaghi",
8585
)
8686

8787
assert terzaghi.allowable_bearing_capacity() == pytest.approx(

tests/test_bearing_capacity/test_ubc_4_soils/test_terzaghi_ubc.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ def test_bearing_capacity(
8080
ground_water_level=water_level,
8181
shape="square",
8282
apply_local_shear=apply_loc_shear,
83-
ubc_type="terzaghi",
83+
ubc_method="terzaghi",
8484
)
8585
actual = ubc.ultimate_bearing_capacity()
8686
assert actual == pytest.approx(expected, 0.01)
@@ -121,7 +121,7 @@ def test_bearing_capacity(
121121
ground_water_level=water_level,
122122
shape="circle",
123123
apply_local_shear=apply_loc_shear,
124-
ubc_type="terzaghi",
124+
ubc_method="terzaghi",
125125
)
126126
actual = ubc.ultimate_bearing_capacity()
127127
assert actual == pytest.approx(expected, 0.01)
@@ -165,7 +165,7 @@ def test_bearing_capacity(
165165
ground_water_level=water_level,
166166
shape="rectangle",
167167
apply_local_shear=apply_loc_shear,
168-
ubc_type="terzaghi",
168+
ubc_method="terzaghi",
169169
)
170170
actual = ubc.ultimate_bearing_capacity()
171171
assert actual == pytest.approx(expected, 0.01)

0 commit comments

Comments
 (0)