Skip to content

Commit 7b43a5e

Browse files
authored
Merge branch 'main' into upgrade_dependencies_week_16_E2A4DE
2 parents c9f83e9 + f5a3016 commit 7b43a5e

File tree

7 files changed

+70
-74
lines changed

7 files changed

+70
-74
lines changed

.basedpyright/baseline.json

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1070,14 +1070,6 @@
10701070
"endColumn": 43,
10711071
"lineCount": 1
10721072
}
1073-
},
1074-
{
1075-
"code": "reportReturnType",
1076-
"range": {
1077-
"startColumn": 15,
1078-
"endColumn": 64,
1079-
"lineCount": 1
1080-
}
10811073
}
10821074
],
10831075
"./src/libecalc/domain/process/compressor/core/sampled/compressor_model_sampled_2d.py": [

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ dependencies = [
3131
"pydantic<3",
3232
"PyYAML==6.*",
3333
"numpy<3",
34-
"pandas==2.*",
34+
"pandas>=3,<4",
3535
"scipy<2",
3636
"ruamel-yaml~=0.18",
3737
"Shapely==2.*",

src/libecalc/domain/process/compressor/core/sampled/compressor_model_sampled.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,7 @@ def _non_degenerated_variables(sampled_data: pd.DataFrame) -> list[str]:
414414
415415
"""
416416
uniques = sampled_data.apply(lambda x: x.nunique())
417-
return array_to_list(uniques[uniques != 1].index.values)
417+
return list(uniques[uniques != 1].index)
418418

419419
@dataclass
420420
class Turbine:

src/libecalc/domain/process/compressor/core/sampled/compressor_model_sampled_2d.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -50,16 +50,16 @@ def __init__(self, sampled_data: pd.DataFrame, function_header: str):
5050
"""
5151
# the interpolator we use when calculating energy usage
5252
self._interpolator = LinearNDInterpolator(
53-
sampled_data[self.variable_order_2d][:].values,
54-
sampled_data[function_header[:]][:].values, # type: ignore[arg-type]
53+
sampled_data[self.variable_order_2d].to_numpy(),
54+
sampled_data[function_header].to_numpy(), # type: ignore[arg-type]
5555
fill_value=np.nan,
5656
rescale=True,
5757
)
5858

5959
# we define a convex hull for the working area for the compressor
6060
# for any point (rate, Dp) in the convex hull we can draw a line between
6161
# them to interpolate and find interpolated values
62-
convex_hull = ConvexHull(sampled_data[self.variable_order_2d][:].values)
62+
convex_hull = ConvexHull(sampled_data[self.variable_order_2d].to_numpy())
6363

6464
# we can only increase rate, therefore we do not care about upper_rate_points...
6565
# we either want upper or lower convex hull, so for Pd we want lower
@@ -217,13 +217,13 @@ class CompressorModelSampled2DRatePs:
217217

218218
def __init__(self, sampled_data: pd.DataFrame, function_header: str):
219219
self._interpolator = LinearNDInterpolator(
220-
sampled_data[self.variable_order_2d][:].values,
221-
sampled_data[function_header[:]][:].values, # type: ignore[arg-type]
220+
sampled_data[self.variable_order_2d].to_numpy(),
221+
sampled_data[function_header].to_numpy(), # type: ignore[arg-type]
222222
fill_value=np.nan,
223223
rescale=True,
224224
)
225225

226-
convex_hull = ConvexHull(sampled_data[self.variable_order_2d][:].values)
226+
convex_hull = ConvexHull(sampled_data[self.variable_order_2d].to_numpy())
227227
(
228228
lower_rate_points_qh,
229229
_,
@@ -292,13 +292,13 @@ class CompressorModelSampled2DPsPd:
292292

293293
def __init__(self, sampled_data: pd.DataFrame, function_header: str):
294294
self._interpolator = LinearNDInterpolator(
295-
sampled_data[self.variable_order_2d][:].values,
296-
sampled_data[function_header[:]][:].values, # type: ignore[arg-type]
295+
sampled_data[self.variable_order_2d].to_numpy(),
296+
sampled_data[function_header].to_numpy(), # type: ignore[arg-type]
297297
fill_value=np.nan,
298298
rescale=True,
299299
)
300300

301-
convex_hull = ConvexHull(sampled_data[self.variable_order_2d][:].values)
301+
convex_hull = ConvexHull(sampled_data[self.variable_order_2d].to_numpy())
302302
lower_pd_points_qh, _, _ = get_lower_upper_qhull(convex_hull, axis=self.pd_axis, case_2d="ps_pd")
303303
lower_pd_points = lower_pd_points_qh.points
304304

src/libecalc/domain/process/compressor/core/sampled/compressor_model_sampled_3d.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,17 +124,17 @@ def __init__(
124124
self._scale_factor_rate = round(
125125
2 * sampled_data[RATE_NAME].mean() / (sampled_data[PS_NAME].mean() + sampled_data[PD_NAME].mean())
126126
)
127-
sampled_data_scaled.loc[:, RATE_NAME] = sampled_data_scaled.loc[:, RATE_NAME] / self._scale_factor_rate
127+
sampled_data_scaled[RATE_NAME] = sampled_data_scaled[RATE_NAME] / self._scale_factor_rate
128128
else:
129129
self._do_rescale = False
130130
self._scale_factor_rate = 1.0
131131

132-
qhull_points = sampled_data_scaled[self.variable_order_3d][:].values
132+
qhull_points = sampled_data_scaled[self.variable_order_3d].to_numpy()
133133
convex_hull = ConvexHull(qhull_points)
134134
delaunay = Delaunay(qhull_points)
135135
interpolator = LinearNDInterpolator(
136136
points=delaunay,
137-
values=sampled_data[function_header[:]][:].values, # type: ignore[arg-type]
137+
values=sampled_data[function_header].to_numpy(), # type: ignore[arg-type]
138138
fill_value=np.nan,
139139
rescale=False,
140140
)

tests/libecalc/core/models/compressor_modelling/sampled/test_convex_hull_common.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def test_get_lower_upper_qhull():
4040
# func_header = EcalcYamlKeywords.consumer_tabular_fuel
4141
df.columns = variables # + [func_header]
4242

43-
qh = ConvexHull(df[variables][:].values)
43+
qh = ConvexHull(df[variables].to_numpy())
4444

4545
# Test in all three directions
4646
lower_p, upper_p, _ = get_lower_upper_qhull(qh, axis=0)
@@ -78,7 +78,7 @@ def test_get_lower_upper_qhull():
7878

7979
df.columns = variables
8080

81-
qh = ConvexHull(df[variables][:].values)
81+
qh = ConvexHull(df[variables].to_numpy())
8282

8383
# axis=0
8484
lower_p, upper_p, _ = get_lower_upper_qhull(qh, axis=0)
@@ -121,7 +121,7 @@ def test_get_lower_upper_qhull():
121121
df = pd.DataFrame(df_data)
122122
df.columns = variables
123123

124-
qh = ConvexHull(df[variables][:].values)
124+
qh = ConvexHull(df[variables].to_numpy())
125125

126126
# axis=0
127127
lower_p, upper_p, _ = get_lower_upper_qhull(qh, axis=0)
@@ -314,7 +314,7 @@ def test_sampled_compressor_datedata2():
314314

315315
ps_pd = np.asarray([[68.04, 111.90], [49.5160, 59.4977]])
316316

317-
convex_hull = ConvexHull(df[variable_headers][:].values)
317+
convex_hull = ConvexHull(df[variable_headers].to_numpy())
318318
lower_rate_qh = get_lower_upper_qhull(convex_hull, axis=0)
319319

320320
lower_convex_hull_0 = lower_rate_qh[0]

0 commit comments

Comments
 (0)