Category: conflicting auxiliary coordinate (7 code sites)
Symptom
Under v1, cyclic / initial / final constraints raise:
ValueError: Auxiliary coordinate 'time' has conflicting values across operands:
left=1577836800000000000, right=1577872800000000000.
... Use `.drop_vars('time')` ... or `.isel(..., drop=True)` if the coord was
introduced by a scalar isel.
Also seen for 'scenario' (left=0, right=8) and 'cluster_boundary'.
Location
flixopt/components.py: _add_cluster_cyclic_constraint (isel(time=0)==isel(time=-2)), _add_initial_final_constraints (isel(time=0)==isel(time=-1)), InterclusterStorageModel cyclic (cluster_boundary), _compute_delta_soc, _add_combined_bound_constraints (isel(time=offset))
flixopt/features.py: _add_cluster_cyclic_constraint (status), state_transition_bounds caller (previous_status.isel(time=-1))
flixopt/structure.py: scenario-equality (isel(scenario=0) == isel(scenario=slice(1, None)))
Root cause
A scalar integer index (x.isel(time=0)) drops the dimension but keeps a leftover scalar aux-coord (time = that timestamp). Comparing two endpoints (isel(time=0) vs isel(time=-1)) yields two operands whose time aux-coord values disagree. Legacy silently drops the conflict; v1 (§11) raises.
Repro
tests/test_math/test_storage.py::test_storage_cyclic_charge_state under v1; or tests/test_clustering/ intercluster tests.
Proposed fix
Add drop=True to each scalar .isel(...) whose result is combined/compared, so the meaningless scalar coord never appears: x.isel(time=0, drop=True) == x.isel(time=-1, drop=True). Identical under legacy (legacy was discarding the coord anyway).
Severity
Build-breaking under v1. Currently masked behind the coordinate-mismatch issue (#730) — surfaces only once that is fixed. No numeric change once fixed.
Fixed in #729.
Category: conflicting auxiliary coordinate (7 code sites)
Symptom
Under v1, cyclic / initial / final constraints raise:
Also seen for
'scenario'(left=0, right=8) and'cluster_boundary'.Location
flixopt/components.py:_add_cluster_cyclic_constraint(isel(time=0)==isel(time=-2)),_add_initial_final_constraints(isel(time=0)==isel(time=-1)),InterclusterStorageModelcyclic (cluster_boundary),_compute_delta_soc,_add_combined_bound_constraints(isel(time=offset))flixopt/features.py:_add_cluster_cyclic_constraint(status),state_transition_boundscaller (previous_status.isel(time=-1))flixopt/structure.py: scenario-equality (isel(scenario=0) == isel(scenario=slice(1, None)))Root cause
A scalar integer index (
x.isel(time=0)) drops the dimension but keeps a leftover scalar aux-coord (time= that timestamp). Comparing two endpoints (isel(time=0)vsisel(time=-1)) yields two operands whosetimeaux-coord values disagree. Legacy silently drops the conflict; v1 (§11) raises.Repro
tests/test_math/test_storage.py::test_storage_cyclic_charge_stateunder v1; ortests/test_clustering/intercluster tests.Proposed fix
Add
drop=Trueto each scalar.isel(...)whose result is combined/compared, so the meaningless scalar coord never appears:x.isel(time=0, drop=True) == x.isel(time=-1, drop=True). Identical under legacy (legacy was discarding the coord anyway).Severity
Build-breaking under v1. Currently masked behind the coordinate-mismatch issue (#730) — surfaces only once that is fixed. No numeric change once fixed.
Fixed in #729.