py-pilecore 0.3.4__py3-none-any.whl → 0.4.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
  from __future__ import annotations
2
2
 
3
- from functools import lru_cache
3
+ from dataclasses import dataclass
4
4
  from typing import Any, Optional, Sequence, Tuple, Union
5
5
 
6
6
  import numpy as np
@@ -8,6 +8,7 @@ import pandas as pd
8
8
  from matplotlib import pyplot as plt
9
9
  from matplotlib.axes import Axes
10
10
  from matplotlib.figure import Figure
11
+ from numpy.typing import NDArray
11
12
 
12
13
  from pypilecore.results.soil_properties import (
13
14
  CPTTable,
@@ -19,177 +20,72 @@ from pypilecore.results.soil_properties import (
19
20
  Number = Union[float, int]
20
21
 
21
22
 
23
+ @dataclass(frozen=True)
22
24
  class CPTResultsTable:
23
25
  """Object containing the results of a single CPT."""
24
26
 
25
- def __init__(
26
- self,
27
- pile_tip_level_nap: Sequence[float],
28
- F_nk_cal: Sequence[float],
29
- F_nk_k: Sequence[float],
30
- F_nk_d: Sequence[float],
31
- R_b_cal: Sequence[float],
32
- R_b_k: Sequence[float],
33
- R_b_d: Sequence[float],
34
- R_s_cal: Sequence[float],
35
- R_s_k: Sequence[float],
36
- R_s_d: Sequence[float],
37
- R_c_cal: Sequence[float],
38
- R_c_k: Sequence[float],
39
- R_c_d: Sequence[float],
40
- R_c_d_net: Sequence[float],
41
- F_c_k: Sequence[float],
42
- F_c_k_tot: Sequence[float],
43
- negative_friction_range_nap_top: Sequence[float | None],
44
- negative_friction_range_nap_btm: Sequence[float | None],
45
- positive_friction_range_nap_top: Sequence[float],
46
- positive_friction_range_nap_btm: Sequence[float],
47
- q_b_max: Sequence[float],
48
- q_s_max_mean: Sequence[float],
49
- qc1: Sequence[float],
50
- qc2: Sequence[float],
51
- qc3: Sequence[float],
52
- s_b: Sequence[float],
53
- s_el: Sequence[float],
54
- k_v_b: Sequence[float],
55
- k_v_1: Sequence[float],
56
- ):
57
- """
58
- Parameters
59
- ----------
60
- pile_tip_level_nap:
61
- The pile-tip level in [m] w.r.t. the reference.
62
- F_nk_cal:
63
- The calculated value of the negative shaft friction force [kN].
64
- F_nk_k:
65
- The characteristic value of the negative shaft friction force [kN].
66
- F_nk_d:
67
- The design value of the negative shaft friction force [kN].
68
- R_b_cal:
69
- The calculated value of the bottom bearingcapacity [kN].
70
- R_b_k:
71
- The characteristic value of the bottom bearingcapacity [kN].
72
- R_b_d:
73
- The design value of the bottom bearingcapacity [kN].
74
- R_s_cal:
75
- The calculated value of the shaft bearingcapacity [kN].
76
- R_s_k:
77
- The characteristic value of the shaft bearingcapacity [kN].
78
- R_s_d:
79
- The design value of the shaft bearingcapacity [kN].
80
- R_c_cal:
81
- The calculated value of the total compressive bearingcapacity [kN].
82
- R_c_k:
83
- The characteristic value of the total compressive bearingcapacity [kN].
84
- R_c_d:
85
- The design value of the total compressive bearingcapacity [kN].
86
- R_c_d_net:
87
- The net design value of the total bearingcapacity [kN] (netto =
88
- excluding design negative friction force.).
89
- F_c_k:
90
- The compressive force on the pile-head [kN].
91
- F_c_k_tot:
92
- The characteristic value of the total compressive pile load [kN]
93
- (building-load + neg. friction force).
94
- negative_friction_range_nap_top:
95
- The top boundary of the negative friction interval [m] w.r.t. NAP.
96
- Can be None when the friction force was provided directly.
97
- negative_friction_range_nap_btm:
98
- The bottom boundary of the negative friction interval [m] w.r.t. NAP.
99
- Can be None when the friction force was provided directly.
100
- positive_friction_range_nap_top:
101
- The top boundary of the positive friction interval [m] w.r.t. NAP.
102
- positive_friction_range_nap_btm:
103
- The bottom boundary of the positive friction interval [m] w.r.t. NAP.
104
- q_b_max:
105
- The maximum bottom bearing resistance [MPa].
106
- q_s_max_mean:
107
- The maximum shaft bearing resistance [MPa].
108
- qc1:
109
- The average friction resistance in Koppejan trajectory I, :math:`q_{c;I;gem}` [MPa] .
110
- qc2:
111
- The average friction resistance in Koppejan trajectory II, :math:`q_{c;II;gem}` [MPa] .
112
- qc3:
113
- The average friction resistance in Koppejan trajectory III, :math:`q_{c;III;gem}` [MPa] .
114
- s_b:
115
- The settlement of the pile bottom [mm].
116
- s_el:
117
- The elastic shortening of the pile due to elastic strain [mm].
118
- k_v_b:
119
- The 1-dimensional stiffness modulus at pile bottom [kN/m].
120
- k_v_1:
121
- The 1-dimensional stiffness modulus at pile head [MN/mm].
122
- """
123
-
124
- self.pile_tip_level_nap = np.array(pile_tip_level_nap).astype(np.float64)
125
- """The pile-tip level in [m] w.r.t. the reference."""
126
- self.F_nk_cal = np.array(F_nk_cal).astype(np.float64)
127
- """The calculated value of the negative shaft friction force [kN]."""
128
- self.F_nk_k = np.array(F_nk_k).astype(np.float64)
129
- """The characteristic value of the negative shaft friction force [kN]."""
130
- self.F_nk_d = np.array(F_nk_d).astype(np.float64)
131
- """The design value of the negative shaft friction force [kN]."""
132
- self.R_b_cal = np.array(R_b_cal).astype(np.float64)
133
- """The calculated value of the bottom bearingcapacity [kN]."""
134
- self.R_b_k = np.array(R_b_k).astype(np.float64)
135
- """The characteristic value of the bottom bearingcapacity [kN]."""
136
- self.R_b_d = np.array(R_b_d).astype(np.float64)
137
- """The design value of the bottom bearingcapacity [kN]."""
138
- self.R_s_cal = np.array(R_s_cal).astype(np.float64)
139
- """The calculated value of the shaft bearingcapacity [kN]."""
140
- self.R_s_k = np.array(R_s_k).astype(np.float64)
141
- """The characteristic value of the shaft bearingcapacity [kN]."""
142
- self.R_s_d = np.array(R_s_d).astype(np.float64)
143
- """The design value of the shaft bearingcapacity [kN]."""
144
- self.R_c_cal = np.array(R_c_cal).astype(np.float64)
145
- """The calculated value of the total compressive bearingcapacity [kN]."""
146
- self.R_c_k = np.array(R_c_k).astype(np.float64)
147
- """The characteristic value of the total compressive bearingcapacity [kN]."""
148
- self.R_c_d = np.array(R_c_d).astype(np.float64)
149
- """The design value of the total compressive bearingcapacity [kN]."""
150
- self.R_c_d_net = np.array(R_c_d_net).astype(np.float64)
151
- """The net design value of the total bearingcapacity [kN] (netto =excluding design negative friction force.)."""
152
- self.F_c_k = np.array(F_c_k).astype(np.float64)
153
- """The compressive force on the pile-head [kN]."""
154
- self.F_c_k_tot = np.array(F_c_k_tot).astype(np.float64)
155
- """The characteristic value of the total compressive pile load [kN](building-load + neg. friction force)."""
156
- self.negative_friction_range_nap_top = np.array(
157
- negative_friction_range_nap_top
158
- ).astype(np.float64)
159
- """The top boundary of the negative friction interval [m] w.r.t. NAP.
160
- Can be None when the friction force was provided directly."""
161
- self.negative_friction_range_nap_btm = np.array(
162
- negative_friction_range_nap_btm
163
- ).astype(np.float64)
164
- """The bottom boundary of the negative friction interval [m] w.r.t. NAP.
165
- Can be None when the friction force was provided directly."""
166
- self.positive_friction_range_nap_top = np.array(
167
- positive_friction_range_nap_top
168
- ).astype(np.float64)
169
- """The top boundary of the positive friction interval [m] w.r.t. NAP."""
170
- self.positive_friction_range_nap_btm = np.array(
171
- positive_friction_range_nap_btm
172
- ).astype(np.float64)
173
- """The bottom boundary of the positive friction interval [m] w.r.t. NAP."""
174
- self.q_b_max = np.array(q_b_max).astype(np.float64)
175
- """The maximum bottom bearing resistance [MPa]."""
176
- self.q_s_max_mean = np.array(q_s_max_mean).astype(np.float64)
177
- """The maximum shaft bearing resistance [MPa]."""
178
- self.qc1 = np.array(qc1).astype(np.float64)
179
- """The average friction resistance in Koppejan trajectory I, :math:`q_{c;I;gem}` [MPa] ."""
180
- self.qc2 = np.array(qc2).astype(np.float64)
181
- """The average friction resistance in Koppejan trajectory II, :math:`q_{c;II;gem}` [MPa] ."""
182
- self.qc3 = np.array(qc3).astype(np.float64)
183
- """The average friction resistance in Koppejan trajectory III, :math:`q_{c;III;gem}` [MPa] ."""
184
- self.s_b = np.array(s_b).astype(np.float64)
185
- """The settlement of the pile bottom [mm]."""
186
- self.s_el = np.array(s_el).astype(np.float64)
187
- """The elastic shortening of the pile due to elastic strain [mm]."""
188
- self.k_v_b = np.array(k_v_b).astype(np.float64)
189
- """The 1-dimensional stiffness modulus at pile bottom [kN/m]."""
190
- self.k_v_1 = np.array(k_v_1).astype(np.float64)
191
- """The 1-dimensional stiffness modulus at pile head [MN/mm]."""
192
-
27
+ pile_tip_level_nap: NDArray[np.float64]
28
+ """The pile-tip level in [m] w.r.t. the reference."""
29
+ F_nk_cal: NDArray[np.float64]
30
+ """The calculated value of the negative shaft friction force [kN]."""
31
+ F_nk_k: NDArray[np.float64]
32
+ """The characteristic value of the negative shaft friction force [kN]."""
33
+ F_nk_d: NDArray[np.float64]
34
+ """The design value of the negative shaft friction force [kN]."""
35
+ R_b_cal: NDArray[np.float64]
36
+ """The calculated value of the bottom bearingcapacity [kN]."""
37
+ R_b_k: NDArray[np.float64]
38
+ """The characteristic value of the bottom bearingcapacity [kN]."""
39
+ R_b_d: NDArray[np.float64]
40
+ """The design value of the bottom bearingcapacity [kN]."""
41
+ R_s_cal: NDArray[np.float64]
42
+ """The calculated value of the shaft bearingcapacity [kN]."""
43
+ R_s_k: NDArray[np.float64]
44
+ """The characteristic value of the shaft bearingcapacity [kN]."""
45
+ R_s_d: NDArray[np.float64]
46
+ """The design value of the shaft bearingcapacity [kN]."""
47
+ R_c_cal: NDArray[np.float64]
48
+ """The calculated value of the total compressive bearingcapacity [kN]."""
49
+ R_c_k: NDArray[np.float64]
50
+ """The characteristic value of the total compressive bearingcapacity [kN]."""
51
+ R_c_d: NDArray[np.float64]
52
+ """The design value of the total compressive bearingcapacity [kN]."""
53
+ R_c_d_net: NDArray[np.float64]
54
+ """The net design value of the total bearingcapacity [kN] (netto =excluding design negative friction force.)."""
55
+ F_c_k: NDArray[np.float64]
56
+ """The compressive force on the pile-head [kN]."""
57
+ F_c_k_tot: NDArray[np.float64]
58
+ """The characteristic value of the total compressive pile load [kN](building-load + neg. friction force)."""
59
+ negative_friction_range_nap_top: NDArray[np.float64]
60
+ """The top boundary of the negative friction interval [m] w.r.t. NAP.
61
+ Can be None when the friction force was provided directly."""
62
+ negative_friction_range_nap_btm: NDArray[np.float64]
63
+ """The bottom boundary of the negative friction interval [m] w.r.t. NAP.
64
+ Can be None when the friction force was provided directly."""
65
+ positive_friction_range_nap_top: NDArray[np.float64]
66
+ """The top boundary of the positive friction interval [m] w.r.t. NAP."""
67
+ positive_friction_range_nap_btm: NDArray[np.float64]
68
+ """The bottom boundary of the positive friction interval [m] w.r.t. NAP."""
69
+ q_b_max: NDArray[np.float64]
70
+ """The maximum bottom bearing resistance [MPa]."""
71
+ q_s_max_mean: NDArray[np.float64]
72
+ """The maximum shaft bearing resistance [MPa]."""
73
+ qc1: NDArray[np.float64]
74
+ """The average friction resistance in Koppejan trajectory I, :math:`q_{c;I;gem}` [MPa] ."""
75
+ qc2: NDArray[np.float64]
76
+ """The average friction resistance in Koppejan trajectory II, :math:`q_{c;II;gem}` [MPa] ."""
77
+ qc3: NDArray[np.float64]
78
+ """The average friction resistance in Koppejan trajectory III, :math:`q_{c;III;gem}` [MPa] ."""
79
+ s_b: NDArray[np.float64]
80
+ """The settlement of the pile bottom [mm]."""
81
+ s_el: NDArray[np.float64]
82
+ """The elastic shortening of the pile due to elastic strain [mm]."""
83
+ k_v_b: NDArray[np.float64]
84
+ """The 1-dimensional stiffness modulus at pile bottom [kN/m]."""
85
+ k_v_1: NDArray[np.float64]
86
+ """The 1-dimensional stiffness modulus at pile head [MN/mm]."""
87
+
88
+ def __post_init__(self) -> None:
193
89
  dict_lengths = {}
194
90
  for key, value in self.__dict__.items():
195
91
  if not np.all(np.isnan(value)):
@@ -199,7 +95,79 @@ class CPTResultsTable:
199
95
  f"Inputs for LayerTable must have same lengths, but got lengths: {dict_lengths}"
200
96
  )
201
97
 
202
- @lru_cache
98
+ @classmethod
99
+ def from_sequences(
100
+ cls,
101
+ pile_tip_level_nap: Sequence[Number],
102
+ F_nk_cal: Sequence[Number],
103
+ F_nk_k: Sequence[Number],
104
+ F_nk_d: Sequence[Number],
105
+ R_b_cal: Sequence[Number],
106
+ R_b_k: Sequence[Number],
107
+ R_b_d: Sequence[Number],
108
+ R_s_cal: Sequence[Number],
109
+ R_s_k: Sequence[Number],
110
+ R_s_d: Sequence[Number],
111
+ R_c_cal: Sequence[Number],
112
+ R_c_k: Sequence[Number],
113
+ R_c_d: Sequence[Number],
114
+ R_c_d_net: Sequence[Number],
115
+ F_c_k: Sequence[Number],
116
+ F_c_k_tot: Sequence[Number],
117
+ negative_friction_range_nap_top: Sequence[Number],
118
+ negative_friction_range_nap_btm: Sequence[Number],
119
+ positive_friction_range_nap_top: Sequence[Number],
120
+ positive_friction_range_nap_btm: Sequence[Number],
121
+ q_b_max: Sequence[Number],
122
+ q_s_max_mean: Sequence[Number],
123
+ qc1: Sequence[Number],
124
+ qc2: Sequence[Number],
125
+ qc3: Sequence[Number],
126
+ s_b: Sequence[Number],
127
+ s_el: Sequence[Number],
128
+ k_v_b: Sequence[Number],
129
+ k_v_1: Sequence[Number],
130
+ ) -> CPTResultsTable:
131
+ return cls(
132
+ pile_tip_level_nap=np.array(pile_tip_level_nap).astype(np.float64),
133
+ F_nk_cal=np.array(F_nk_cal).astype(np.float64),
134
+ F_nk_k=np.array(F_nk_k).astype(np.float64),
135
+ F_nk_d=np.array(F_nk_d).astype(np.float64),
136
+ R_b_cal=np.array(R_b_cal).astype(np.float64),
137
+ R_b_k=np.array(R_b_k).astype(np.float64),
138
+ R_b_d=np.array(R_b_d).astype(np.float64),
139
+ R_s_cal=np.array(R_s_cal).astype(np.float64),
140
+ R_s_k=np.array(R_s_k).astype(np.float64),
141
+ R_s_d=np.array(R_s_d).astype(np.float64),
142
+ R_c_cal=np.array(R_c_cal).astype(np.float64),
143
+ R_c_k=np.array(R_c_k).astype(np.float64),
144
+ R_c_d=np.array(R_c_d).astype(np.float64),
145
+ R_c_d_net=np.array(R_c_d_net).astype(np.float64),
146
+ F_c_k=np.array(F_c_k).astype(np.float64),
147
+ F_c_k_tot=np.array(F_c_k_tot).astype(np.float64),
148
+ negative_friction_range_nap_top=np.array(
149
+ negative_friction_range_nap_top
150
+ ).astype(np.float64),
151
+ negative_friction_range_nap_btm=np.array(
152
+ negative_friction_range_nap_btm
153
+ ).astype(np.float64),
154
+ positive_friction_range_nap_top=np.array(
155
+ positive_friction_range_nap_top
156
+ ).astype(np.float64),
157
+ positive_friction_range_nap_btm=np.array(
158
+ positive_friction_range_nap_btm
159
+ ).astype(np.float64),
160
+ q_b_max=np.array(q_b_max).astype(np.float64),
161
+ q_s_max_mean=np.array(q_s_max_mean).astype(np.float64),
162
+ qc1=np.array(qc1).astype(np.float64),
163
+ qc2=np.array(qc2).astype(np.float64),
164
+ qc3=np.array(qc3).astype(np.float64),
165
+ s_b=np.array(s_b).astype(np.float64),
166
+ s_el=np.array(s_el).astype(np.float64),
167
+ k_v_b=np.array(k_v_b).astype(np.float64),
168
+ k_v_1=np.array(k_v_1).astype(np.float64),
169
+ )
170
+
203
171
  def to_pandas(self) -> pd.DataFrame:
204
172
  """Get the pandas.DataFrame representation"""
205
173
  return pd.DataFrame(self.__dict__).dropna(axis=1)
@@ -250,6 +218,7 @@ class SingleCPTBearingResults:
250
218
  layer_table=LayerTable.from_api_response(
251
219
  cpt_results_dict["layer_table"]
252
220
  ),
221
+ test_id=cpt_results_dict.get("test_id"),
253
222
  ref_height=ref_height,
254
223
  surface_level_ref=surface_level_ref,
255
224
  groundwater_level_ref=cpt_results_dict["groundwater_level_nap"],
@@ -257,7 +226,7 @@ class SingleCPTBearingResults:
257
226
  y=y,
258
227
  ),
259
228
  pile_head_level_nap=cpt_results_dict["annotations"]["pile_head_level_nap"],
260
- results_table=CPTResultsTable(
229
+ results_table=CPTResultsTable.from_sequences(
261
230
  pile_tip_level_nap=results_table["pile_tip_level_nap"],
262
231
  F_nk_cal=results_table["F_nk_cal"],
263
232
  F_nk_k=results_table["F_nk_k"],
@@ -144,7 +144,7 @@ class CPTTable:
144
144
  if depth_nap is None:
145
145
  self.depth_nap = np.array([depth_nap]).astype(np.float64)
146
146
  else:
147
- self.depth_nap = np.array(depth_nap).astype(np.float64)
147
+ self.depth_nap = np.array(depth_nap).astype(np.float64).round(decimals=2)
148
148
 
149
149
  """The depth [m] w.r.t. NAP"""
150
150
  self.qc = np.array(qc).astype(np.float64)
@@ -1,23 +0,0 @@
1
- pypilecore/__init__.py,sha256=T2Uuao6fboVhrzKI_Sa7jXbcNAUl_PKk9BFdsozOG98,78
2
- pypilecore/_version.py,sha256=cEzxmKpGQuAhyTIsS7l1-cyVvDCDosSmNxawG0Fq6G4,175
3
- pypilecore/api.py,sha256=rioxpj4ucZ0nOErGwC8PjI-pv08mwtoEx1zZco08osk,5133
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=AqZHvg-CXcoTW7u9wgyqSm1oZLBc7sSoTawxGK69144,10895
9
- pypilecore/input/multi_cpt.py,sha256=1gEK-Imdhr0xOfcn50lq1OwYvjFs2NMf51LDaVddGas,19539
10
- pypilecore/input/pile_properties.py,sha256=mK8_VRy-tHZCKFHcv8ftMlCEs8KEsZpG9eGLq13hYPA,8400
11
- pypilecore/input/soil_properties.py,sha256=pD_ezCcE73Ilw0G4p2k4ay2F3IHfEvqOQ2B-tsaeFIY,7696
12
- pypilecore/results/__init__.py,sha256=ggTI2QzILhX_oNx1YMOih6IVCkBFg8I5-Jyn9Sw3_h0,389
13
- pypilecore/results/grouper_result.py,sha256=XzrvsWezFB0ZXmIfC_Foy9oxqOqttRLDAxTa7eve1rc,21066
14
- pypilecore/results/load_settlement.py,sha256=EbfTrSvH_g96KE-x8ZjmO8D0mt5KFaQ_-AR8u4blLsU,9752
15
- pypilecore/results/multi_cpt_results.py,sha256=6Exz2aDH8PgZZUmGThq-hEMs87o78eUxBPU6asce3ng,25230
16
- pypilecore/results/pile_properties.py,sha256=z1R5UNoYjBem2rS8LMJ_ye2J5ejDoSilU5fCjUrNdUg,28592
17
- pypilecore/results/single_cpt_results.py,sha256=eFeqMOOhgiQimv9EHFFWPFWWZWV_iYcqhXU39jSreF4,19358
18
- pypilecore/results/soil_properties.py,sha256=oZYTKSXP5UgxY2vwX-bu_X447KLptuYPpsgFi_E00IQ,20704
19
- py_pilecore-0.3.4.dist-info/LICENSE,sha256=3OCAZXffN0Bettjeya8uF_ZYegyvvCfH1WUt6CrHb_0,1061
20
- py_pilecore-0.3.4.dist-info/METADATA,sha256=0nZbeEyHgbsPXNAmDkWR6EeGhA1VtdUXWkOcSXfsYMo,5806
21
- py_pilecore-0.3.4.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
22
- py_pilecore-0.3.4.dist-info/top_level.txt,sha256=7BKIWZuSkbQtJ0ho5P1JvcaEbHzqADCcBuOduZmIaiI,11
23
- py_pilecore-0.3.4.dist-info/RECORD,,