py-pilecore 0.7.1__py3-none-any.whl → 0.8.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.

Potentially problematic release.


This version of py-pilecore might be problematic. Click here for more details.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: py-pilecore
3
- Version: 0.7.1
3
+ Version: 0.8.1
4
4
  Summary: Public python SDK for the CEMS PileCore web-API.
5
5
  License: MIT License
6
6
 
@@ -168,3 +168,9 @@ Update the requirements within the defined ranges with:
168
168
  ```bash
169
169
  pip-compile --upgrade --extra=test --extra=lint --extra=docs --output-file=requirements.txt pyproject.toml
170
170
  ```
171
+
172
+ Note that `pip-compile` might run from your global path. You can also invoke the compile
173
+ command from the `piptools` module on a specific python installation (e.g. within a virtualenv):
174
+
175
+ ```bash
176
+ python -m piptools compile
@@ -1,5 +1,5 @@
1
1
  pypilecore/__init__.py,sha256=oJvwYShj_7FyNVlUgQda4tTdYyLIi5H1asdiS_uYt9M,162
2
- pypilecore/_version.py,sha256=lwhPyTTgYzs-cvOxSAquZ8lujNcRnmmZe1m2wWaWutg,175
2
+ pypilecore/_version.py,sha256=hAEHEjBRfehOjTMw00czgS3SD_ZC3KWh5Zvf9h2LEW4,175
3
3
  pypilecore/api.py,sha256=QwwHXR6HYtrF-gCHQWLvMHZnTxf5fjTlWI2cGfYSkUc,7165
4
4
  pypilecore/exceptions.py,sha256=-MZOfsxyHLCI0k1-wZFfVsMxc1lya5buuhLks5rxlCo,89
5
5
  pypilecore/plot_utils.py,sha256=rK5_067-4-x7LzZgt_t6ahcGrZInxNrqHqsy0RzCnq8,954
@@ -17,8 +17,8 @@ pypilecore/common/piles/geometry/components/rectangle.py,sha256=591KyIejyjNAMnKg
17
17
  pypilecore/common/piles/geometry/components/round.py,sha256=MX2_qGmxr1dTtodblFfkNGkoDYqd6xgXHJ57xFuz_Z0,14735
18
18
  pypilecore/input/__init__.py,sha256=Gyqsp6zqc8AYnIp17SfqbBNjDaUkRgAam8x2r0XibwM,492
19
19
  pypilecore/input/grouper_properties.py,sha256=4Rhea8pnrbWqIIiplHdPS-EioDRurCcLe6thHkGkBEM,11146
20
- pypilecore/input/multi_cpt.py,sha256=V7A_MAYeJoMkGOQu1oFGJfJ3dkuBdhDSfeLvgiCLmqs,14196
21
- pypilecore/input/soil_properties.py,sha256=ms2zxRPK_0zJAgei4QTJhC71Y7ivUguqoRTDUzuqyl8,8277
20
+ pypilecore/input/multi_cpt.py,sha256=b5poixEs5ex8WGcu3rJiFMdS5Q4DE807L6jmeqiFE64,17506
21
+ pypilecore/input/soil_properties.py,sha256=fsgkdvLsNf7LqiQh-gIDS9XSZBO7BJJ_qp6bIs8TLz0,9061
22
22
  pypilecore/results/__init__.py,sha256=J6CHQ7BJRnUJxrKFe25br-BUCMrBATqmvRkjtaMkmkw,507
23
23
  pypilecore/results/cases_multi_cpt_results.py,sha256=Svy26fEMuSLPzD0hdq3-aQD-6TK0oyAERkVQZFPcXrE,9948
24
24
  pypilecore/results/grouper_result.py,sha256=HcjLbnD3wt28CtIACD1OSoyJRmfu5x8Qv2BdDMpvgyY,30952
@@ -37,8 +37,8 @@ pypilecore/viewers/interactive_figures/figure_cpt_group_results_versus_ptls.py,s
37
37
  pypilecore/viewers/interactive_figures/figure_cpt_results_plan_view.py,sha256=y1no2w0zN0yUpkNB_-WAFwQfa-IS70hJMhc-c0pOeMs,9268
38
38
  pypilecore/viewers/interactive_figures/figure_cpt_results_versus_ptls.py,sha256=6huCKcQ4bsBE-LNY-ZPa13IWuye0ENxPK4wT1dcCFRs,5964
39
39
  pypilecore/viewers/interactive_figures/utils.py,sha256=B2X8hbbmJqjm8E2VrS2EoX5F1yQ5qOQnQUG_vbsseT8,1692
40
- py_pilecore-0.7.1.dist-info/LICENSE,sha256=3OCAZXffN0Bettjeya8uF_ZYegyvvCfH1WUt6CrHb_0,1061
41
- py_pilecore-0.7.1.dist-info/METADATA,sha256=_EToNm1nMkzfEYcHpOMioBk8Uc5IGfPWE3UPOOxpNXw,5653
42
- py_pilecore-0.7.1.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
43
- py_pilecore-0.7.1.dist-info/top_level.txt,sha256=7BKIWZuSkbQtJ0ho5P1JvcaEbHzqADCcBuOduZmIaiI,11
44
- py_pilecore-0.7.1.dist-info/RECORD,,
40
+ py_pilecore-0.8.1.dist-info/LICENSE,sha256=3OCAZXffN0Bettjeya8uF_ZYegyvvCfH1WUt6CrHb_0,1061
41
+ py_pilecore-0.8.1.dist-info/METADATA,sha256=lqEfiUaVFto9lSj1I57R6eruvdG1hcBt7cV9WeNdWaY,5876
42
+ py_pilecore-0.8.1.dist-info/WHEEL,sha256=R06PA3UVYHThwHvxuRWMqaGcr-PuniXahwjmQRFMEkY,91
43
+ py_pilecore-0.8.1.dist-info/top_level.txt,sha256=7BKIWZuSkbQtJ0ho5P1JvcaEbHzqADCcBuOduZmIaiI,11
44
+ py_pilecore-0.8.1.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (75.1.0)
2
+ Generator: setuptools (75.5.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
pypilecore/_version.py CHANGED
@@ -4,4 +4,4 @@ try:
4
4
  __version__ = version("py-pilecore")
5
5
  # during CI
6
6
  except PackageNotFoundError:
7
- __version__ = "0.7.1"
7
+ __version__ = "0.8.1"
@@ -33,6 +33,9 @@ def create_multi_cpt_payload(
33
33
  pile_head_level_nap: float | Literal["surface"] = "surface",
34
34
  excavation_depth_nap: float | None = None,
35
35
  excavation_param_t: float = 1.0,
36
+ excavation_stress_reduction_method: Literal["constant", "begemann"] = "constant",
37
+ excavation_width: float | None = None,
38
+ excavation_edge_distance: float | None = None,
36
39
  individual_negative_friction_range_nap: Mapping[str, Tuple[float, float]]
37
40
  | None = None,
38
41
  individual_positive_friction_range_nap: Mapping[
@@ -160,6 +163,27 @@ def create_multi_cpt_payload(
160
163
  excavation method.
161
164
 
162
165
  See for more info NEN 9997-1+C2:2017 7.6.2.3.(10)(k)
166
+ excavation_stress_reduction_method:
167
+ Method used to calculate the stress reduction due to the excavation applied to the effective and total stresses.
168
+ Only used when `excavation_depth_nap` is different than `None`. It can be:
169
+ - "constant" (default): The stress reduction below the excavation is constant with depth. The stress reduction
170
+ is equal to the original effective stress (i.e. before the excavation) at the excavation depth.
171
+ - "begemann": The stress reduction below the excavation decreases with depth according to the Begemann method.
172
+ This method uses the elastic solution of a strip load acting on a semi-infinite homogeneous soil mass.
173
+ The load has a width equal to the excavation width and a magnitude equal to the original effective stress at
174
+ the excavation depth.
175
+ Regardless the method, the stress reduction applied above the excavation is equal to the original effective stress
176
+ at each corresponding depth.
177
+ excavation_width:
178
+ Width of the excavation [m]. Used to calculate the stress reduction due to the excavation if the Begemann method is selected.
179
+ In this case, it must be provided and it must be > 0.
180
+ excavation_edge_distance:
181
+ Distance from the pile centerline to the excavation edge [m]. Used to calculate the stress reduction due to the excavation if
182
+ the Begemann method is selected. In this case, it must be provided and it must be between 0.0 and 0.5 * excavation_width.
183
+
184
+ Note that:
185
+ - 0.0 means that the pile is located at the edge of the excavation.
186
+ - 0.5 * excavation_width means that the pile is at the center of the excavation.
163
187
  individual_negative_friction_range_nap:
164
188
  A dictionary, mapping ``CPTData.alias`` values to fixed negative-friction ranges.
165
189
  For a specification of the values, see ``fixed_negative_friction_range_nap``
@@ -201,6 +225,9 @@ def create_multi_cpt_payload(
201
225
  ------
202
226
  ValueError:
203
227
  - If `excavation_depth_nap` is not None and `excavation_param_t` is None.
228
+ - If `excavation_stress_reduction_method` is not either 'constant' or 'begemann'.
229
+ - If `excavation_stress_reduction_method` is 'begemann' and `excavation_width` is None.
230
+ - If `excavation_stress_reduction_method` is 'begemann' and `excavation_edge_distance` is None.
204
231
  - If both `relative_pile_load` and `pile_load_sls` are None.
205
232
  """
206
233
  # Input validation
@@ -208,6 +235,21 @@ def create_multi_cpt_payload(
208
235
  raise ValueError(
209
236
  "`excavation_param_t` cannot be None when `excavation_depth_nap` is not None."
210
237
  )
238
+ if excavation_stress_reduction_method not in ["constant", "begemann"]:
239
+ raise ValueError(
240
+ "`excavation_stress_reduction_method` must be either 'constant' or 'begemann'."
241
+ )
242
+ if excavation_stress_reduction_method == "begemann" and excavation_width is None:
243
+ raise ValueError(
244
+ "`excavation_width` must be provided when `excavation_stress_reduction_method` is 'begemann'."
245
+ )
246
+ if (
247
+ excavation_stress_reduction_method == "begemann"
248
+ and excavation_edge_distance is None
249
+ ):
250
+ raise ValueError(
251
+ "`excavation_edge_distance` must be provided when `excavation_stress_reduction_method` is 'begemann'"
252
+ )
211
253
  if relative_pile_load is None and pile_load_sls is None:
212
254
  raise ValueError(
213
255
  "Need at least a value for one of: [`relative_pile_load`, `pile_load_sls`]"
@@ -243,6 +285,18 @@ def create_multi_cpt_payload(
243
285
  # Add optional properties
244
286
  if excavation_depth_nap is not None:
245
287
  multi_cpt_payload["excavation_depth_nap"] = excavation_depth_nap
288
+
289
+ if excavation_stress_reduction_method == "constant":
290
+ multi_cpt_payload["excavation_settings"] = dict(
291
+ stress_reduction_method="constant"
292
+ )
293
+ else:
294
+ multi_cpt_payload["excavation_settings"] = dict(
295
+ stress_reductin_method="begemann",
296
+ excavation_width=excavation_width,
297
+ excavation_edge_distance=excavation_edge_distance,
298
+ )
299
+
246
300
  if pile_load_sls is not None:
247
301
  multi_cpt_payload["pile_load"] = pile_load_sls
248
302
  if apply_qc3_reduction is not None:
@@ -1,8 +1,10 @@
1
1
  from __future__ import annotations
2
2
 
3
+ import warnings
3
4
  from typing import Any, Dict, List, Literal, Mapping, Tuple
4
5
 
5
6
  import numpy as np
7
+ from numpy.typing import NDArray
6
8
  from pygef.cpt import CPTData
7
9
  from tqdm import tqdm
8
10
 
@@ -16,6 +18,26 @@ transform = {
16
18
  }
17
19
 
18
20
 
21
+ def get_cpt_depth(cpt: CPTData) -> NDArray:
22
+ """
23
+ Returns the array of depth data from the CPT. Uses the (corrected) depth data if
24
+ present, otherwise the `penetrationLength` data along with a warning.
25
+ """
26
+ if "depth" in cpt.data.columns:
27
+ depth = cpt.data["depth"]
28
+ elif "penetrationLength" in cpt.data.columns:
29
+ warnings.warn(
30
+ f"CPT {cpt.alias} has no Corrected Depth trace. py-pilecore uses the Penetration Length instead, which might not be accurate."
31
+ )
32
+ depth = cpt.data["penetrationLength"]
33
+ else:
34
+ raise ValueError(
35
+ f"Cannot process CPT {cpt.alias}: required Corrected Depth or Penetration Length data is missing."
36
+ )
37
+
38
+ return np.array(depth, dtype=float)
39
+
40
+
19
41
  def create_soil_properties_payload(
20
42
  cptdata_objects: List[CPTData],
21
43
  classify_tables: Dict[str, dict],
@@ -117,7 +139,7 @@ def create_soil_properties_payload(
117
139
 
118
140
  # Construct the cpt_data payload
119
141
  cpt_data = dict(
120
- depth=np.array(cpt.data["depth"], dtype=float),
142
+ depth=get_cpt_depth(cpt),
121
143
  qc=np.array(cpt.data["coneResistance"], dtype=float).clip(0),
122
144
  )
123
145