py-pilecore 0.6.0__py3-none-any.whl → 0.7.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.6.0
3
+ Version: 0.7.1
4
4
  Summary: Public python SDK for the CEMS PileCore web-API.
5
5
  License: MIT License
6
6
 
@@ -48,25 +48,20 @@ Requires-Dist: ipython ==8.11.0 ; extra == 'docs'
48
48
  Requires-Dist: asteroid-sphinx-theme ==0.0.3 ; extra == 'docs'
49
49
  Requires-Dist: sphinx-rtd-theme ==1.2.0 ; extra == 'docs'
50
50
  Provides-Extra: lint
51
- Requires-Dist: mypy ==1.6.1 ; extra == 'lint'
52
- Requires-Dist: mypy-extensions ==1.0.0 ; extra == 'lint'
53
- Requires-Dist: tomli ==2.0.1 ; extra == 'lint'
54
- Requires-Dist: typing-extensions ==4.7.1 ; extra == 'lint'
55
- Requires-Dist: black[jupyter] ==23.10.1 ; extra == 'lint'
56
- Requires-Dist: click ==8.1.3 ; extra == 'lint'
57
- Requires-Dist: packaging ==23.2 ; extra == 'lint'
58
- Requires-Dist: pathspec ==0.11.1 ; extra == 'lint'
59
- Requires-Dist: platformdirs ==3.5.1 ; extra == 'lint'
60
- Requires-Dist: isort ==5.12.0 ; 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'
61
55
  Requires-Dist: flake8 ==6.0.0 ; extra == 'lint'
62
- Requires-Dist: mccabe ==0.7.0 ; extra == 'lint'
63
- Requires-Dist: pycodestyle ==2.10.0 ; extra == 'lint'
64
- Requires-Dist: pyflakes ==3.0.1 ; extra == 'lint'
65
- Requires-Dist: pandas-stubs <3,>2 ; extra == 'lint'
66
- Requires-Dist: types-tqdm <5,>4 ; 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'
67
61
  Provides-Extra: test
68
62
  Requires-Dist: coveralls ; extra == 'test'
69
63
  Requires-Dist: pytest ; extra == 'test'
64
+ Requires-Dist: openapi-core ; extra == 'test'
70
65
 
71
66
  # py-pilecore
72
67
  Public python SDK for the CEMS PileCore web-API
@@ -102,7 +97,7 @@ Go to `personal-access-tokens` and create a new user token.
102
97
 
103
98
  ## Environment
104
99
 
105
- We recommend developing in Python3.10 with a clean virtual environment (using `virtualenv` or `conda`), installing the requirements from the requirements.txt file:
100
+ We recommend developing in Python3.11 with a clean virtual environment (using `virtualenv` or `conda`), installing the requirements from the requirements.txt file:
106
101
 
107
102
  Example using `virtualenv` and `pip` to install the dependencies in a new environment .env on Linux:
108
103
 
@@ -154,7 +149,7 @@ coverage run -m pytest
154
149
 
155
150
  ## Requirements
156
151
 
157
- Requirements are autogenerated by the `pip-compile` command with python 3.10
152
+ Requirements are autogenerated by the `pip-compile` command with python 3.11
158
153
 
159
154
  Install pip-tools with:
160
155
 
@@ -1,5 +1,5 @@
1
1
  pypilecore/__init__.py,sha256=oJvwYShj_7FyNVlUgQda4tTdYyLIi5H1asdiS_uYt9M,162
2
- pypilecore/_version.py,sha256=R1s1AISNxSuge8l1EIVicoxY29JCaFvDTnMtfkWQDMM,175
2
+ pypilecore/_version.py,sha256=lwhPyTTgYzs-cvOxSAquZ8lujNcRnmmZe1m2wWaWutg,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
@@ -16,9 +16,9 @@ pypilecore/common/piles/geometry/components/common.py,sha256=scYoF-4aE0Wknx9GgSO
16
16
  pypilecore/common/piles/geometry/components/rectangle.py,sha256=591KyIejyjNAMnKg8yThFjbrPXAVHQdf08vaiQYHZdk,18411
17
17
  pypilecore/common/piles/geometry/components/round.py,sha256=MX2_qGmxr1dTtodblFfkNGkoDYqd6xgXHJ57xFuz_Z0,14735
18
18
  pypilecore/input/__init__.py,sha256=Gyqsp6zqc8AYnIp17SfqbBNjDaUkRgAam8x2r0XibwM,492
19
- pypilecore/input/grouper_properties.py,sha256=qOc-SNYSPdOcZZ9DsRE-sBNVOKHbUD044EWRsWDu_kc,10893
19
+ pypilecore/input/grouper_properties.py,sha256=4Rhea8pnrbWqIIiplHdPS-EioDRurCcLe6thHkGkBEM,11146
20
20
  pypilecore/input/multi_cpt.py,sha256=V7A_MAYeJoMkGOQu1oFGJfJ3dkuBdhDSfeLvgiCLmqs,14196
21
- pypilecore/input/soil_properties.py,sha256=VZHGGmns768XPLjMTVwQDpy3f0LDFG0AwbKVfm3xKWc,7993
21
+ pypilecore/input/soil_properties.py,sha256=ms2zxRPK_0zJAgei4QTJhC71Y7ivUguqoRTDUzuqyl8,8277
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
@@ -36,9 +36,9 @@ pypilecore/viewers/interactive_figures/__init__.py,sha256=u6fkLqDB35J2bdGvUewzRC
36
36
  pypilecore/viewers/interactive_figures/figure_cpt_group_results_versus_ptls.py,sha256=RzNOYQmP_yT8oYeIMW9aYNl7aAKU-uFQfygxP9AwDsU,6471
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
- pypilecore/viewers/interactive_figures/utils.py,sha256=Wl5hNsTdgh6wPm_sVGg1bfKamHzGnVNpuepgOg-oOFY,1582
40
- py_pilecore-0.6.0.dist-info/LICENSE,sha256=3OCAZXffN0Bettjeya8uF_ZYegyvvCfH1WUt6CrHb_0,1061
41
- py_pilecore-0.6.0.dist-info/METADATA,sha256=mmjEYozM_QO3ZKpRV1uYHNYWS5lU-Fo5O4kw9c-8ArA,5935
42
- py_pilecore-0.6.0.dist-info/WHEEL,sha256=cVxcB9AmuTcXqmwrtPhNK88dr7IR_b6qagTj0UvIEbY,91
43
- py_pilecore-0.6.0.dist-info/top_level.txt,sha256=7BKIWZuSkbQtJ0ho5P1JvcaEbHzqADCcBuOduZmIaiI,11
44
- py_pilecore-0.6.0.dist-info/RECORD,,
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,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (74.1.2)
2
+ Generator: setuptools (75.1.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.6.0"
7
+ __version__ = "0.7.1"
@@ -74,7 +74,8 @@ def create_grouper_payload(
74
74
  Parameters
75
75
  ----------
76
76
  cpt_results_dict:
77
- Dictionary with key as CPT name and value a SingleCPTBearingResults class
77
+ Dictionary with key as CPT name and value a SingleCPTBearingResults class.
78
+ Should contain at least 2 entries.
78
79
  pile_load_uls
79
80
  ULS load in kN. Used to determine if a grouping configuration is valid.
80
81
  stiff_construction
@@ -131,12 +132,12 @@ def create_grouper_payload(
131
132
  ValueError:
132
133
  - if NaN values are present in negative friction, bottom or shaft bearing_capacity
133
134
 
134
-
135
135
  - if x or y coordinate is None
136
136
 
137
-
138
137
  - if pile tip levels don't macht for all SingleCPTBearingResults
139
138
 
139
+ - if less than 2 valid CPTs are provided
140
+
140
141
 
141
142
  Returns
142
143
  -------
@@ -212,6 +213,12 @@ def create_grouper_payload(
212
213
  },
213
214
  }
214
215
  )
216
+
217
+ if not len(cpt_objects) >= 2:
218
+ raise ValueError(
219
+ "The PileCore grouper requires at least 2 CPTs with valid bearing capacity."
220
+ )
221
+
215
222
  payload["cpt_objects"] = cpt_objects
216
223
 
217
224
  # validate pile tip levels
@@ -158,9 +158,19 @@ def create_soil_properties_payload(
158
158
  groundwater_level_nap=groundwater_level_nap
159
159
  if groundwater_level_nap is not None
160
160
  else cpt.delivered_vertical_position_offset - 1,
161
- coordinates=dict(x=cpt.delivered_location.x, y=cpt.delivered_location.y),
162
161
  )
163
162
 
163
+ # Optionally add coordinates
164
+ if (
165
+ cpt.delivered_location is not None
166
+ and cpt.delivered_location.x is not None
167
+ and cpt.delivered_location.y is not None
168
+ ):
169
+ soil_properties["coordinates"] = {
170
+ "x": cpt.delivered_location.x,
171
+ "y": cpt.delivered_location.y,
172
+ }
173
+
164
174
  # Optionally add cpt-specific friction-range parameters
165
175
  if (
166
176
  individual_negative_friction_range_nap is not None
@@ -1,5 +1,6 @@
1
1
  from typing import Any
2
2
 
3
+ import numpy as np
3
4
  import plotly
4
5
 
5
6
 
@@ -19,14 +20,14 @@ def get_continuous_color(colorscale: Any, intermed: float) -> Any:
19
20
  colorscale = plotly.colors.make_colorscale(viridis_colors, scale=scale)
20
21
 
21
22
  :param colorscale: A plotly continuous colorscale defined with RGB string colors.
22
- :param intermed: value in the range [0, 1]
23
+ :param intermed: value in the range [0, 1]. If `intermed` is NaN, it returns the first color in the colorscale.
23
24
  :return: color in rgb string format
24
25
  :rtype: str
25
26
  """
26
27
  if len(colorscale) < 1:
27
28
  raise ValueError("colorscale must have at least one color")
28
29
 
29
- if intermed <= 0 or len(colorscale) == 1:
30
+ if intermed <= 0 or len(colorscale) == 1 or np.isnan(intermed):
30
31
  return colorscale[0][1]
31
32
  if intermed >= 1:
32
33
  return colorscale[-1][1]