From 4a4cc01caf98e7b513dc8e802cb64fbf5bedc508 Mon Sep 17 00:00:00 2001 From: Jordao Bragantini Date: Fri, 30 Aug 2024 16:49:06 -0400 Subject: [PATCH 1/2] fixing motile update that removed plurals from costs/constraints --- trackastra/tracking/ilp.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/trackastra/tracking/ilp.py b/trackastra/tracking/ilp.py index 8a8374f..6e36b93 100644 --- a/trackastra/tracking/ilp.py +++ b/trackastra/tracking/ilp.py @@ -109,35 +109,35 @@ def solve_full_ilp( used_costs = SimpleNamespace() # NODES - solver.add_costs( + solver.add_cost( motile.costs.NodeSelection(weight=p.nodeW, constant=p.nodeC, attribute="weight") ) used_costs.nodeW = p.nodeW used_costs.nodeC = p.nodeC # EDGES - solver.add_costs( + solver.add_cost( motile.costs.EdgeSelection(weight=p.edgeW, constant=p.edgeC, attribute="weight") ) used_costs.edgeW = p.edgeW used_costs.edgeC = p.edgeC # APPEAR - solver.add_costs(motile.costs.Appear(constant=p.appearC)) + solver.add_cost(motile.costs.Appear(constant=p.appearC)) used_costs.appearC = p.appearC # DISAPPEAR - solver.add_costs(motile.costs.Disappear(constant=p.disappearC)) + solver.add_cost(motile.costs.Disappear(constant=p.disappearC)) used_costs.disappearC = p.disappearC # DIVISION if allow_divisions: - solver.add_costs(motile.costs.Split(constant=p.splitC)) + solver.add_cost(motile.costs.Split(constant=p.splitC)) used_costs.splitC = p.splitC # Add constraints - solver.add_constraints(motile.constraints.MaxParents(1)) - solver.add_constraints(motile.constraints.MaxChildren(2 if allow_divisions else 1)) + solver.add_constraint(motile.constraints.MaxParents(1)) + solver.add_constraint(motile.constraints.MaxChildren(2 if allow_divisions else 1)) solver.solve() From 82a9c4123424dc6609c2e539b09268c91903e58d Mon Sep 17 00:00:00 2001 From: Jordao Bragantini Date: Fri, 30 Aug 2024 16:50:55 -0400 Subject: [PATCH 2/2] motile version bump --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index 76bf66d..28fffcd 100644 --- a/setup.cfg +++ b/setup.cfg @@ -44,7 +44,7 @@ include_package_data = True [options.extras_require] ilp = - motile >= 0.2 + motile >= 0.3 dev = pytest ruff