From 143fca5660e47778554a395adef7d11ad5b8b00f Mon Sep 17 00:00:00 2001 From: Masato Onodera Date: Tue, 25 Aug 2026 17:38:29 +0900 Subject: [PATCH] Fix collision in science-target constraint names makeName("ST", key[0], key[1]) indexed the first two characters of the target-class string rather than elements of a tuple, so every class sharing a two-character prefix produced one name: sci_P1 through sci_P7 all became ST_s_c. The constraints themselves still reached the solver, but HiGHS received duplicate row names, and _constraintdict kept only the last constraint per colliding name, so constraintByName could not retrieve them. FIBERALLOC-63 Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01CsehUfGABWV8uBhVQWUBet --- ets_fiber_assigner/netflow.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ets_fiber_assigner/netflow.py b/ets_fiber_assigner/netflow.py index 445cbd8..42d4c16 100644 --- a/ets_fiber_assigner/netflow.py +++ b/ets_fiber_assigner/netflow.py @@ -695,7 +695,7 @@ def buildProblem(bench, targets, tpos, classdict, tvisit, vis_cost=None, n_obs = len(val)-1 if "nobs_max" in classdict[key]: n_obs = classdict[key]["nobs_max"] - prob.add_constraint(makeName("ST", key[0], key[1]), + prob.add_constraint(makeName("ST", key), prob.sum([v for v in val]) == n_obs) # Science targets inside a given program must not get more observation time