Skip to content

Commit 33c4bec

Browse files
committed
Rename _apply_indexer_to_data() to _apply_selection_to_data()
1 parent 505edca commit 33c4bec

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

flixopt/results.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1060,7 +1060,7 @@ def plot_node_balance(
10601060
# Don't pass select/indexer to node_balance - we'll apply it afterwards
10611061
ds = self.node_balance(with_last_timestep=True, unit_type=unit_type, drop_suffix=drop_suffix)
10621062

1063-
ds, suffix_parts = _apply_indexer_to_data(ds, select=select, drop=True)
1063+
ds, suffix_parts = _apply_selection_to_data(ds, select=select, drop=True)
10641064

10651065
# Matplotlib requires only 'time' dimension; check for extras after selection
10661066
if engine == 'matplotlib':
@@ -1177,8 +1177,8 @@ def plot_node_balance_pie(
11771177
drop_suffix='|',
11781178
)
11791179

1180-
inputs, suffix_parts = _apply_indexer_to_data(inputs, select=select, drop=True)
1181-
outputs, suffix_parts = _apply_indexer_to_data(outputs, select=select, drop=True)
1180+
inputs, suffix_parts = _apply_selection_to_data(inputs, select=select, drop=True)
1181+
outputs, suffix_parts = _apply_selection_to_data(outputs, select=select, drop=True)
11821182

11831183
# Sum over time dimension
11841184
inputs = inputs.sum('time')
@@ -1313,7 +1313,7 @@ def node_balance(
13131313
drop_suffix='|' if drop_suffix else None,
13141314
)
13151315

1316-
ds, _ = _apply_indexer_to_data(ds, select=select, drop=True)
1316+
ds, _ = _apply_selection_to_data(ds, select=select, drop=True)
13171317

13181318
if unit_type == 'flow_hours':
13191319
ds = ds * self._calculation_results.hours_per_timestep
@@ -1419,8 +1419,8 @@ def plot_charge_state(
14191419
charge_state_da = self.charge_state
14201420

14211421
# Apply select filtering
1422-
ds, suffix_parts = _apply_indexer_to_data(ds, select=select, drop=True)
1423-
charge_state_da, _ = _apply_indexer_to_data(charge_state_da, select=select, drop=True)
1422+
ds, suffix_parts = _apply_selection_to_data(ds, select=select, drop=True)
1423+
charge_state_da, _ = _apply_selection_to_data(charge_state_da, select=select, drop=True)
14241424
suffix = '--' + '-'.join(suffix_parts) if suffix_parts else ''
14251425

14261426
title = f'Operation Balance of {self.label}{suffix}'
@@ -2042,7 +2042,7 @@ def plot_heatmap(
20422042
title_name = name
20432043

20442044
# Apply select filtering
2045-
data, suffix_parts = _apply_indexer_to_data(data, select=select, drop=True)
2045+
data, suffix_parts = _apply_selection_to_data(data, select=select, drop=True)
20462046
suffix = '--' + '-'.join(suffix_parts) if suffix_parts else ''
20472047

20482048
# Matplotlib heatmaps require at most 2D data
@@ -2339,7 +2339,7 @@ def apply_filter(array, coord_name: str, coord_values: Any | list[Any]):
23392339
return da
23402340

23412341

2342-
def _apply_indexer_to_data(
2342+
def _apply_selection_to_data(
23432343
data: xr.DataArray | xr.Dataset,
23442344
select: dict[str, Any] | None = None,
23452345
drop=False,

0 commit comments

Comments
 (0)