py-pilecore 0.4.2__py3-none-any.whl → 0.5.1__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.
@@ -30,6 +30,7 @@ def create_soil_properties_payload(
30
30
  ]
31
31
  | None = None,
32
32
  individual_ocr: Mapping[Any, float] | None = None,
33
+ verbose: bool = False,
33
34
  ) -> Tuple[List[dict], Dict[str, dict]]:
34
35
  """
35
36
  Creates a dictionary with the `soil_properties` payload content for the PileCore
@@ -89,6 +90,8 @@ def create_soil_properties_payload(
89
90
  A dictionary, mapping ``CPTData.alias`` values to Over-Consolidation-Ratio [-]
90
91
  values of the foundation layer. This will overrule the general `ocr` setting for
91
92
  these specific CPTs only.
93
+ verbose:
94
+ If True, show progress bars and status messages in stdout.
92
95
 
93
96
  Returns
94
97
  -------
@@ -103,7 +106,15 @@ def create_soil_properties_payload(
103
106
  results_passover = {}
104
107
  soil_properties_list = []
105
108
 
106
- for cpt in tqdm(cptdata_objects, desc="Create soil properties payload"):
109
+ pbar = None
110
+ if verbose:
111
+ pbar = tqdm(total=len(cptdata_objects))
112
+ for cpt in cptdata_objects:
113
+ # Push verbose message
114
+ if pbar:
115
+ pbar.update()
116
+ pbar.set_description(f"Create soil properties payload for CPT: {cpt.alias}")
117
+
107
118
  # Construct the cpt_data payload
108
119
  cpt_data = dict(
109
120
  depth=np.array(cpt.data["depth"], dtype=float),
@@ -9,6 +9,7 @@ import natsort
9
9
  import numpy as np
10
10
  import pandas as pd
11
11
  from matplotlib import pyplot as plt
12
+ from matplotlib.axes import Axes
12
13
  from numpy.typing import NDArray
13
14
  from shapely import MultiPoint
14
15
 
@@ -184,7 +185,7 @@ class SingleClusterData:
184
185
  return pd.DataFrame(self.__dict__)
185
186
 
186
187
  def plot_variation_coefficient(
187
- self, axes: plt.Axes | None = None, **kwargs: Any
188
+ self, axes: Axes | None = None, **kwargs: Any
188
189
  ) -> None:
189
190
  """
190
191
  Plot the bearing capacity and variation coefficient in a subplot
@@ -206,7 +207,7 @@ class SingleClusterData:
206
207
  axes.set_xlabel("Variation coefficient [-]")
207
208
 
208
209
  def plot_bearing_capacity(
209
- self, axes: plt.Axes | None = None, pile_load_uls: float = 0.0, **kwargs: Any
210
+ self, axes: Axes | None = None, pile_load_uls: float = 0.0, **kwargs: Any
210
211
  ) -> None:
211
212
  """
212
213
  Plot the bearing capacity and variation coefficient in a subplot
@@ -9,12 +9,9 @@ import pandas as pd
9
9
  from matplotlib.axes import Axes
10
10
  from matplotlib.patches import Patch
11
11
 
12
+ from pypilecore.common.piles import PileProperties
12
13
  from pypilecore.exceptions import UserError
13
14
  from pypilecore.results.load_settlement import get_load_settlement_plot
14
- from pypilecore.results.pile_properties import (
15
- PileProperties,
16
- create_pile_properties_from_api_response,
17
- )
18
15
  from pypilecore.results.single_cpt_results import SingleCPTBearingResults
19
16
 
20
17
  Number = Union[float, int]
@@ -218,7 +215,7 @@ class CPTGroupResultsTable:
218
215
  @lru_cache
219
216
  def to_pandas(self) -> pd.DataFrame:
220
217
  """The pandas.DataFrame representation"""
221
- return pd.DataFrame(self.__dict__).dropna(axis=1)
218
+ return pd.DataFrame(self.__dict__).dropna(axis=0, how="all")
222
219
 
223
220
  def plot_bearing_capacities(
224
221
  self,
@@ -474,7 +471,7 @@ class MultiCPTBearingResults:
474
471
  group_results = response_dict["group_results"]
475
472
  return cls(
476
473
  cpt_results=cpt_results_dict,
477
- pile_properties=create_pile_properties_from_api_response(
474
+ pile_properties=PileProperties.from_api_response(
478
475
  response_dict["pile_properties"]
479
476
  ),
480
477
  group_results_table=CPTGroupResultsTable(
@@ -642,7 +639,7 @@ class MultiCPTBearingResults:
642
639
  # Draw a box and whisker plot
643
640
  axes.boxplot(
644
641
  np.flip(data, axis=0),
645
- labels=np.flip(self.group_results_table.pile_tip_level_nap),
642
+ tick_labels=np.flip(self.group_results_table.pile_tip_level_nap),
646
643
  whis=(0, 100),
647
644
  autorange=True,
648
645
  vert=False,
@@ -742,6 +739,12 @@ class MultiCPTBearingResults:
742
739
  axes:
743
740
  The `Axes` object where the settlement curves were plotted on
744
741
  """
742
+ # Validate required properties are present
743
+ if self._pp.pile_type.settlement_curve is None:
744
+ raise ValueError(
745
+ "No settlement curve is defined for the pile-type. "
746
+ "Please define a settlement curve in the pile-type properties."
747
+ )
745
748
 
746
749
  # Validate axes
747
750
  if (axes is not None) and (not isinstance(axes, Axes)):
@@ -769,8 +772,8 @@ class MultiCPTBearingResults:
769
772
  )
770
773
 
771
774
  return get_load_settlement_plot(
772
- settlement_curve=self._pp.settlement_curve,
773
- d_eq=self._pp.equiv_base_diameter,
775
+ settlement_curve=self._pp.pile_type.settlement_curve,
776
+ d_eq=self._pp.geometry.equiv_diameter_pile_tip,
774
777
  s_b=self.group_results_table.s_b[idx],
775
778
  f_c_k=self.group_results_table.F_c_k[idx],
776
779
  f_nk_k=self.group_results_table.F_nk_k[idx],
@@ -170,7 +170,7 @@ class CPTResultsTable:
170
170
 
171
171
  def to_pandas(self) -> pd.DataFrame:
172
172
  """Get the pandas.DataFrame representation"""
173
- return pd.DataFrame(self.__dict__).dropna(axis=1)
173
+ return pd.DataFrame(self.__dict__).dropna(axis=0, how="all")
174
174
 
175
175
 
176
176
  class SingleCPTBearingResults:
@@ -122,7 +122,7 @@ class LayerTable:
122
122
  @lru_cache
123
123
  def to_pandas(self) -> pd.DataFrame:
124
124
  """The pandas.DataFrame representation"""
125
- return pd.DataFrame(self.__dict__).dropna(axis=1)
125
+ return pd.DataFrame(self.__dict__).dropna(axis=0, how="all")
126
126
 
127
127
 
128
128
  class CPTTable:
@@ -205,7 +205,7 @@ class CPTTable:
205
205
  @lru_cache
206
206
  def to_pandas(self) -> pd.DataFrame:
207
207
  """The pandas.DataFrame representation"""
208
- return pd.DataFrame(self.__dict__).dropna(axis=1)
208
+ return pd.DataFrame(self.__dict__).dropna(axis=0, how="all")
209
209
 
210
210
  def plot_qc(
211
211
  self,
@@ -1,24 +0,0 @@
1
- pypilecore/__init__.py,sha256=T2Uuao6fboVhrzKI_Sa7jXbcNAUl_PKk9BFdsozOG98,78
2
- pypilecore/_version.py,sha256=2dffVSzjhtY2kCEG85L-fZD3Xh0WRlG_TJVCqG9EfHc,175
3
- pypilecore/api.py,sha256=dXgjfttEUcQHUCMkTX9eYip0dd3bf_ppE6cdx87ouHY,6822
4
- pypilecore/exceptions.py,sha256=-MZOfsxyHLCI0k1-wZFfVsMxc1lya5buuhLks5rxlCo,89
5
- pypilecore/plot_utils.py,sha256=rK5_067-4-x7LzZgt_t6ahcGrZInxNrqHqsy0RzCnq8,954
6
- pypilecore/utils.py,sha256=ib9LgJBIgWukL7zd_Zk1LP27UTMIZTRJ4RBB6ubn97o,1186
7
- pypilecore/input/__init__.py,sha256=tlmThdPtO8e6L6pqxuRQ7EOHRxYwuIcaNNGlZyAnzig,606
8
- pypilecore/input/grouper_properties.py,sha256=qOc-SNYSPdOcZZ9DsRE-sBNVOKHbUD044EWRsWDu_kc,10893
9
- pypilecore/input/multi_cpt.py,sha256=cYwsbxX-BFfDSmhOXiasm5TVQiWt4GQr0Q4jwYmcynI,19592
10
- pypilecore/input/pile_properties.py,sha256=6O7iH-f7_G9PZbBsbzSWT_zUF2RtwYLfF5GRtUFvhHk,8404
11
- pypilecore/input/soil_properties.py,sha256=oqZWeSvhGyIKl4j0ZlGr923qyxkBjYxbVKBckG2rLAw,7687
12
- pypilecore/results/__init__.py,sha256=ggTI2QzILhX_oNx1YMOih6IVCkBFg8I5-Jyn9Sw3_h0,389
13
- pypilecore/results/grouper_result.py,sha256=wQxWSJRrgh7aO5pglrCNTPvCNdERBMDXAlm6YZE3v-s,30927
14
- pypilecore/results/load_settlement.py,sha256=EbfTrSvH_g96KE-x8ZjmO8D0mt5KFaQ_-AR8u4blLsU,9752
15
- pypilecore/results/multi_cpt_results.py,sha256=9unVE0sp25khcAhDM_CFRRgqg_SpTQCDW0L0hOtzxSg,30678
16
- pypilecore/results/pile_properties.py,sha256=z1R5UNoYjBem2rS8LMJ_ye2J5ejDoSilU5fCjUrNdUg,28592
17
- pypilecore/results/post_processing.py,sha256=UWXcdff5dhPFDwzKbVIayEIp3HX6pxW8oQR3Z7AHPn0,22262
18
- pypilecore/results/single_cpt_results.py,sha256=irNqsL_cBKUh-QEmWC216KZjkv9MAZkaiLTvDDlEt20,17448
19
- pypilecore/results/soil_properties.py,sha256=Mcwz23PcaIW1xKLabMUSfIeKCTBli7ouuZPfT5dfrb4,20722
20
- py_pilecore-0.4.2.dist-info/LICENSE,sha256=3OCAZXffN0Bettjeya8uF_ZYegyvvCfH1WUt6CrHb_0,1061
21
- py_pilecore-0.4.2.dist-info/METADATA,sha256=zeeDiTfTKJFa3I-TaPIKjFEayHGER0m2uKzd1FLRubM,5834
22
- py_pilecore-0.4.2.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
23
- py_pilecore-0.4.2.dist-info/top_level.txt,sha256=7BKIWZuSkbQtJ0ho5P1JvcaEbHzqADCcBuOduZmIaiI,11
24
- py_pilecore-0.4.2.dist-info/RECORD,,
@@ -1,213 +0,0 @@
1
- from __future__ import annotations
2
-
3
-
4
- def create_pile_properties_payload(
5
- pile_type: str,
6
- specification: str,
7
- installation: str,
8
- pile_shape: str,
9
- diameter_base: float | None = None,
10
- diameter_shaft: float | None = None,
11
- width_base_large: float | None = None,
12
- width_base_small: float | None = None,
13
- width_shaft_large: float | None = None,
14
- width_shaft_small: float | None = None,
15
- height_base: float | None = None,
16
- settlement_curve: float | None = None,
17
- adhesion: float | None = None,
18
- alpha_p: float | None = None,
19
- alpha_s_clay: float | None = None,
20
- alpha_s_sand: float | None = None,
21
- beta_p: float | None = None,
22
- pile_tip_factor_s: float | None = None,
23
- elastic_modulus: float | None = None,
24
- is_auger: float | None = None,
25
- is_low_vibrating: float | None = None,
26
- negative_fr_delta_factor: float | None = None,
27
- ) -> dict:
28
- """
29
- Creates a dictionary with the `pile_properties` payload content for the PileCore
30
- endpoints.
31
-
32
- Note
33
- ----
34
- The dictionary should be converted to a jsonifyable message before it can be passed
35
- to a `requests` call directly, for instance with
36
- `nuclei.client.utils.python_types_to_message()`.
37
-
38
- Parameters
39
- ----------
40
- pile_type:
41
- The equaly named entry in the "pile_type_specification" settings.
42
- Accepted values are: ["A","B","C""D","E","F","G"]
43
- specification:
44
- The equaly named entry in the "pile_type_specification" settings.
45
- Accepted values are: ["concrete","steel","micro","wood"]
46
- installation:
47
- The equaly named entry in the "pile_type_specification" settings.
48
- Accepted values are: ["1","2","3","4","5","6","7"]
49
- pile_shape:
50
- The shape of the pile.
51
- Accepted values are: ["round", "rect"]
52
- diameter_base:
53
- Pile base diameter [m].
54
- Only relevant if `shape`="round".
55
- diameter_shaft:
56
- Pile shaft diameter [m].
57
- Only relevant if `shape`="round".
58
- width_base_large:
59
- Largest dimension of the pile base [m].
60
- Only relevant if `shape`="rect".
61
- width_base_small:
62
- Smallest dimension of the pile base [m].
63
- Only relevant if `shape`="rect".
64
- width_shaft_large:
65
- Largest dimension of the pile shaft [m].
66
- Only relevant if `shape`="rect".
67
- width_shaft_small:
68
- Smallest dimension of the pile shaft [m].
69
- Only relevant if `shape`="rect".
70
- height_base:
71
- Height of pile base [m]. If None, a pile with constant dimension is inferred.
72
- Cannot be None if diameter_base and diameter_shaft are unequal.
73
- settlement_curve:
74
- Settlement lines for figures 7.n and 7.o of NEN-9997-1 As defined in table 7.c
75
- of NEN-9997-1. The value is inferred from the pile_type_specifications, but can
76
- be overwritten.
77
- adhesion:
78
- Optional adhesion value [kPa], use it if the pile shaft has undergone a special
79
- treatment. Examples: - adhesion = 50 kN/m2 for synthetic coating - adhesion = 20
80
- kN/m2 for bentonite - adhesion = 10 kN/m2 for bitumen coating See 7.3.2.2(d) of
81
- NEN 9997-1 for examples.
82
- alpha_p:
83
- Alpha p factor used in pile tip resistance calculation. The value is inferred
84
- from the pile_type_specifications, but can be overwritten.
85
- alpha_s_clay:
86
- Alpha s factor for soft layers used in the positive friction calculation. If
87
- None the factor is determined as specified in table 7.d of NEN 9997-1.
88
- alpha_s_sand:
89
- Alpha s factor for coarse layers used in the positive friction calculation. The
90
- value is inferred from the pile_type_specifications, but can be overwritten.
91
- beta_p:
92
- Factor s used in pile tip resistance calculation as per NEN 9997-1 7.6.2.3 (h).
93
- The value is inferred from the pile dimension properties, but can be overwritten.
94
- pile_tip_factor_s:
95
- Factor s used in pile tip resistance calculation as per NEN 9997-1 7.6.2.3 (h).
96
- The value is inferred from the pile dimension properties, but can be overwritten.
97
- elastic_modulus:
98
- Modulus of elasticity of the pile [Mpa]. The value is inferred from the
99
- pile_type_specifications, but can be overwritten.
100
- is_auger:
101
- Determines weather the pile the pile is an auger pile or not. The value is
102
- inferred from the pile_type_specifications, but can be overwritten.
103
- is_low_vibrating:
104
- Determines weather the pile has an installation type with low vibration. The
105
- value is inferred from the pile_type_specifications, but can be overwritten.
106
- negative_fr_delta_factor:
107
- factor * φ = δ. This parameter will be multiplied with phi to get the delta
108
- parameter used in negative friction calculation according to NEN-9997-1 7.3.2.2
109
- (e). Typically values are 1.0 for piles cast in place, and 0.75 for other pile
110
- types. The value is inferred from the pile_type_specifications, but can be
111
- overwritten.
112
-
113
- Returns
114
- -------
115
- pile_properties:
116
- The `pile_properties` payload content of the PileCore-API endpoints.
117
-
118
- Raises
119
- ------
120
- ValueError:
121
- - if `pile_shape`=="round" & `diameter_base` is None
122
- - if `pile_shape`=="rect" & `width_base_large` is None
123
- - if `pile_shape` not in ["rect", "round"]
124
- """
125
- pile_properties: dict = dict(
126
- props=dict(
127
- pile_type_specification=dict(
128
- pile_type=pile_type,
129
- specification=specification,
130
- installation=installation,
131
- )
132
- ),
133
- type=pile_shape,
134
- )
135
-
136
- if pile_shape == "round":
137
- if diameter_base is None:
138
- raise ValueError(
139
- 'A value for `diameter_base` is required for `pile_shape`=="round"'
140
- )
141
-
142
- pile_properties["props"]["diameter_base"] = diameter_base
143
-
144
- if diameter_shaft is not None:
145
- if height_base is None:
146
- raise ValueError(
147
- "A value for `height_base` is required when the base and shaft dimensions are unequal"
148
- )
149
-
150
- pile_properties["props"]["diameter_shaft"] = diameter_shaft
151
-
152
- elif pile_shape == "rect":
153
- if width_base_large is None:
154
- raise ValueError(
155
- 'A value for `width_base_large` is required for `pile_shape`=="rect"'
156
- )
157
- pile_properties["props"]["width_base_large"] = width_base_large
158
-
159
- if width_base_small is not None:
160
- pile_properties["props"]["width_base_small"] = width_base_small
161
-
162
- if (
163
- width_shaft_large is not None or width_shaft_small is not None
164
- ) and height_base is None:
165
- raise ValueError(
166
- "A value for `height_base` is required when the base and shaft dimensions are unequal"
167
- )
168
- if width_shaft_large is not None:
169
- pile_properties["props"]["width_shaft_large"] = width_shaft_large
170
-
171
- if width_shaft_small is not None:
172
- pile_properties["props"]["width_shaft_small"] = width_shaft_small
173
-
174
- else:
175
- raise ValueError('pile_shape should be one of ["round", "rect"]')
176
-
177
- if height_base is not None:
178
- pile_properties["props"]["height_base"] = height_base
179
-
180
- if settlement_curve is not None:
181
- pile_properties["props"]["settlement_curve"] = settlement_curve
182
-
183
- if adhesion is not None:
184
- pile_properties["props"]["adhesion"] = adhesion
185
-
186
- if alpha_p is not None:
187
- pile_properties["props"]["alpha_p"] = alpha_p
188
-
189
- if alpha_s_clay is not None:
190
- pile_properties["props"]["alpha_s_clay"] = alpha_s_clay
191
-
192
- if alpha_s_sand is not None:
193
- pile_properties["props"]["alpha_s_sand"] = alpha_s_sand
194
-
195
- if beta_p is not None:
196
- pile_properties["props"]["beta_p"] = beta_p
197
-
198
- if pile_tip_factor_s is not None:
199
- pile_properties["props"]["pile_tip_factor_s"] = pile_tip_factor_s
200
-
201
- if elastic_modulus is not None:
202
- pile_properties["props"]["elastic_modulus"] = elastic_modulus
203
-
204
- if is_auger is not None:
205
- pile_properties["props"]["is_auger"] = is_auger
206
-
207
- if is_low_vibrating is not None:
208
- pile_properties["props"]["is_low_vibrating"] = is_low_vibrating
209
-
210
- if negative_fr_delta_factor is not None:
211
- pile_properties["props"]["negative_fr_delta_factor"] = negative_fr_delta_factor
212
-
213
- return pile_properties