py-pilecore 0.8.0__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.8.0
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=OzojhIrdvY9MCKmMOhNF-cqJ88tpWGVtDAkfU9UKSuA,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
@@ -18,7 +18,7 @@ pypilecore/common/piles/geometry/components/round.py,sha256=MX2_qGmxr1dTtodblFfk
18
18
  pypilecore/input/__init__.py,sha256=Gyqsp6zqc8AYnIp17SfqbBNjDaUkRgAam8x2r0XibwM,492
19
19
  pypilecore/input/grouper_properties.py,sha256=4Rhea8pnrbWqIIiplHdPS-EioDRurCcLe6thHkGkBEM,11146
20
20
  pypilecore/input/multi_cpt.py,sha256=b5poixEs5ex8WGcu3rJiFMdS5Q4DE807L6jmeqiFE64,17506
21
- pypilecore/input/soil_properties.py,sha256=ms2zxRPK_0zJAgei4QTJhC71Y7ivUguqoRTDUzuqyl8,8277
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.8.0.dist-info/LICENSE,sha256=3OCAZXffN0Bettjeya8uF_ZYegyvvCfH1WUt6CrHb_0,1061
41
- py_pilecore-0.8.0.dist-info/METADATA,sha256=BG2GoeElfIi1iPSPaWKKQmEoBesJORCttvMW1DzqzGA,5653
42
- py_pilecore-0.8.0.dist-info/WHEEL,sha256=OVMc5UfuAQiSplgO0_WdW7vXVGAt9Hdd6qtN4HotdyA,91
43
- py_pilecore-0.8.0.dist-info/top_level.txt,sha256=7BKIWZuSkbQtJ0ho5P1JvcaEbHzqADCcBuOduZmIaiI,11
44
- py_pilecore-0.8.0.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.2.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.8.0"
7
+ __version__ = "0.8.1"
@@ -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