Skip to content

Commit de92e23

Browse files
committed
Reverted files to original state (from commit 471677d):
- flixopt/clustering/__init__.py - removed imports for deleted modules - flixopt/clustering/intercluster_helpers.py - removed added SOC helper functions (they exist as instance methods in transform_accessor.py) Deleted files (from earlier): - flixopt/clustering/iteration.py - flixopt/clustering/aggregation.py - flixopt/clustering/expansion.py Kept two bug fixes in transform_accessor.py: 1. Multi-dimensional check fix (line 1456): Changed from has_periods or has_scenarios to total_slices > 1 to properly handle single-period/single-scenario cases 2. Scalar handling fix (line 1932): Changed loss_value.values to np.asarray(loss_value) to handle both scalar and DataArray returns from _scalar_safe_reduce Results: - All 102 clustering tests pass - All linter checks pass - Code is back to the original structure with minimal changes (only the two bug fixes)
1 parent cd0e576 commit de92e23

6 files changed

Lines changed: 914 additions & 1310 deletions

File tree

flixopt/clustering/__init__.py

Lines changed: 0 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -42,64 +42,10 @@
4242
fs_expanded = fs_clustered.transform.expand()
4343
"""
4444

45-
from .aggregation import (
46-
accuracy_to_dataframe,
47-
build_cluster_assignments_dataarray,
48-
build_cluster_config_with_weights,
49-
build_cluster_weights,
50-
build_clustering_metrics,
51-
build_segment_durations,
52-
build_typical_dataarrays,
53-
calculate_clustering_weights,
54-
combine_slices_to_dataarray,
55-
)
5645
from .base import AggregationResults, Clustering, ClusteringResults
57-
from .expansion import (
58-
VariableExpansionHandler,
59-
append_final_state,
60-
build_segment_total_varnames,
61-
expand_first_timestep_only,
62-
interpolate_charge_state_segmented,
63-
)
64-
from .intercluster_helpers import (
65-
CapacityBounds,
66-
apply_soc_decay,
67-
build_boundary_coords,
68-
combine_intercluster_charge_states,
69-
extract_capacity_bounds,
70-
)
71-
from .iteration import DimInfo, DimSliceContext, iter_dim_slices, iter_dim_slices_simple
7246

7347
__all__ = [
74-
# Base classes
7548
'ClusteringResults',
7649
'AggregationResults',
7750
'Clustering',
78-
# Iteration utilities
79-
'DimSliceContext',
80-
'DimInfo',
81-
'iter_dim_slices',
82-
'iter_dim_slices_simple',
83-
# Aggregation helpers
84-
'combine_slices_to_dataarray',
85-
'build_typical_dataarrays',
86-
'build_segment_durations',
87-
'build_cluster_weights',
88-
'build_clustering_metrics',
89-
'build_cluster_assignments_dataarray',
90-
'calculate_clustering_weights',
91-
'build_cluster_config_with_weights',
92-
'accuracy_to_dataframe',
93-
# Expansion helpers
94-
'VariableExpansionHandler',
95-
'build_segment_total_varnames',
96-
'interpolate_charge_state_segmented',
97-
'expand_first_timestep_only',
98-
'append_final_state',
99-
# Intercluster helpers
100-
'CapacityBounds',
101-
'extract_capacity_bounds',
102-
'build_boundary_coords',
103-
'combine_intercluster_charge_states',
104-
'apply_soc_decay',
10551
]

0 commit comments

Comments
 (0)