py-pilecore 0.8.0__py3-none-any.whl → 0.8.2__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.2
4
4
  Summary: Public python SDK for the CEMS PileCore web-API.
5
5
  License: MIT License
6
6
 
@@ -29,39 +29,39 @@ Keywords: API,PileCore,CEMS,CRUX
29
29
  Requires-Python: >=3.9
30
30
  Description-Content-Type: text/markdown
31
31
  License-File: LICENSE
32
- Requires-Dist: pygef <1,>0.8
33
- Requires-Dist: numpy <2,>1
34
- Requires-Dist: pandas <3,>2
35
- Requires-Dist: cems-nuclei[client] <2,>=1
36
- Requires-Dist: matplotlib <4,>=3.8
37
- Requires-Dist: tqdm[notebook] <5,>4
38
- Requires-Dist: natsort <9,>8
39
- Requires-Dist: shapely <3,>=2
40
- Requires-Dist: scipy <2,>=1.13
41
- Requires-Dist: ipywidgets <9,>=8
42
- Requires-Dist: dash <3,>=2.17
43
- Requires-Dist: plotly-geo <2,>=1.0.0
32
+ Requires-Dist: pygef<1,>0.8
33
+ Requires-Dist: numpy<2,>1
34
+ Requires-Dist: pandas<3,>2
35
+ Requires-Dist: cems-nuclei[client]<2,>=1
36
+ Requires-Dist: matplotlib<4,>=3.8
37
+ Requires-Dist: tqdm[notebook]<5,>4
38
+ Requires-Dist: natsort<9,>8
39
+ Requires-Dist: shapely<3,>=2
40
+ Requires-Dist: scipy<2,>=1.13
41
+ Requires-Dist: ipywidgets<9,>=8
42
+ Requires-Dist: dash<3,>=2.17
43
+ Requires-Dist: plotly-geo<2,>=1.0.0
44
+ Provides-Extra: test
45
+ Requires-Dist: coveralls; extra == "test"
46
+ Requires-Dist: pytest; extra == "test"
47
+ Requires-Dist: openapi-core; extra == "test"
44
48
  Provides-Extra: docs
45
- Requires-Dist: Sphinx ==6.1.3 ; extra == 'docs'
46
- Requires-Dist: sphinx-autodoc-typehints ==1.22 ; extra == 'docs'
47
- Requires-Dist: ipython ==8.11.0 ; extra == 'docs'
48
- Requires-Dist: asteroid-sphinx-theme ==0.0.3 ; extra == 'docs'
49
- Requires-Dist: sphinx-rtd-theme ==1.2.0 ; extra == 'docs'
49
+ Requires-Dist: Sphinx==6.1.3; extra == "docs"
50
+ Requires-Dist: sphinx-autodoc-typehints==1.22; extra == "docs"
51
+ Requires-Dist: ipython==8.11.0; extra == "docs"
52
+ Requires-Dist: asteroid-sphinx-theme==0.0.3; extra == "docs"
53
+ Requires-Dist: sphinx_rtd_theme==1.2.0; extra == "docs"
50
54
  Provides-Extra: lint
51
- Requires-Dist: ansible-lint ==6.22.1 ; extra == 'lint'
52
- Requires-Dist: black ==23.11.0 ; extra == 'lint'
53
- Requires-Dist: cfn-lint ==0.83.3 ; extra == 'lint'
54
- Requires-Dist: cpplint ==1.6.1 ; extra == 'lint'
55
- Requires-Dist: flake8 ==6.0.0 ; extra == 'lint'
56
- Requires-Dist: isort ==5.12.0 ; extra == 'lint'
57
- Requires-Dist: mypy ==1.7.1 ; extra == 'lint'
58
- Requires-Dist: sqlfluff ==2.3.5 ; extra == 'lint'
59
- Requires-Dist: yamllint ==1.33.0 ; extra == 'lint'
60
- Requires-Dist: yq ==3.2.3 ; extra == 'lint'
61
- Provides-Extra: test
62
- Requires-Dist: coveralls ; extra == 'test'
63
- Requires-Dist: pytest ; extra == 'test'
64
- Requires-Dist: openapi-core ; extra == 'test'
55
+ Requires-Dist: ansible-lint==6.22.1; extra == "lint"
56
+ Requires-Dist: black==23.11.0; extra == "lint"
57
+ Requires-Dist: cfn-lint==0.83.3; extra == "lint"
58
+ Requires-Dist: cpplint==1.6.1; extra == "lint"
59
+ Requires-Dist: flake8==6.0.0; extra == "lint"
60
+ Requires-Dist: isort==5.12.0; extra == "lint"
61
+ Requires-Dist: mypy==1.7.1; extra == "lint"
62
+ Requires-Dist: sqlfluff==2.3.5; extra == "lint"
63
+ Requires-Dist: yamllint==1.33.0; extra == "lint"
64
+ Requires-Dist: yq==3.2.3; extra == "lint"
65
65
 
66
66
  # py-pilecore
67
67
  Public python SDK for the CEMS PileCore web-API
@@ -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,12 +1,12 @@
1
1
  pypilecore/__init__.py,sha256=oJvwYShj_7FyNVlUgQda4tTdYyLIi5H1asdiS_uYt9M,162
2
- pypilecore/_version.py,sha256=OzojhIrdvY9MCKmMOhNF-cqJ88tpWGVtDAkfU9UKSuA,175
2
+ pypilecore/_version.py,sha256=FyPanIUkBPhYghbhEw_aK3Ld2xsxcNUrJnwhCmvpgUk,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
6
6
  pypilecore/utils.py,sha256=ib9LgJBIgWukL7zd_Zk1LP27UTMIZTRJ4RBB6ubn97o,1186
7
7
  pypilecore/common/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
8
8
  pypilecore/common/piles/__init__.py,sha256=xHP56HiBc1sHg2WZ9iG6CSJAgR072ZwD83lp8PSdTa4,114
9
- pypilecore/common/piles/main.py,sha256=9Yy1VTD6p80Y33ycEFjafVbjgwjmdObMWetejocxI_0,10519
9
+ pypilecore/common/piles/main.py,sha256=CKhPxWrI0KGhAPSBZRcaSR0stF5x65e7JIynJK3l5Mk,10583
10
10
  pypilecore/common/piles/type.py,sha256=rxaJZ2MAybLdoGqb1KEBh8KYpaKEwnoebEq2bjBrahk,7227
11
11
  pypilecore/common/piles/geometry/__init__.py,sha256=dFCVazEXnPCt5cQeHkSi5wp-yHRB9gKvtlQ3V5kBuOQ,438
12
12
  pypilecore/common/piles/geometry/main.py,sha256=ant3y1ZTGRN2off5-dwz2024Xa7pC0K7auBbmjTy9p8,11231
@@ -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.2.dist-info/LICENSE,sha256=3OCAZXffN0Bettjeya8uF_ZYegyvvCfH1WUt6CrHb_0,1061
41
+ py_pilecore-0.8.2.dist-info/METADATA,sha256=eIyZk-NDIkafvDb49nBebn4tlwDvBmnaKPPhqWh-C3c,5831
42
+ py_pilecore-0.8.2.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
43
+ py_pilecore-0.8.2.dist-info/top_level.txt,sha256=7BKIWZuSkbQtJ0ho5P1JvcaEbHzqADCcBuOduZmIaiI,11
44
+ py_pilecore-0.8.2.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (75.2.0)
2
+ Generator: setuptools (75.6.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.2"
@@ -68,7 +68,9 @@ class PileProperties:
68
68
  @property
69
69
  def name(self) -> str | None:
70
70
  """The name of the pile."""
71
- return self._name
71
+ if self._name is not None:
72
+ return str(self._name)
73
+ return None
72
74
 
73
75
  def serialize_payload(self) -> Dict[str, dict | str]:
74
76
  """
@@ -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