From 7fa08071413c50db277a2678fb12d1375b7c69d9 Mon Sep 17 00:00:00 2001 From: samay2504 Date: Sat, 11 Apr 2026 23:55:55 +0530 Subject: [PATCH] fix: correct FRLM flow coverage annotation --- spopt/locate/flow.py | 2 +- spopt/tests/test_locate/test_flow.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/spopt/locate/flow.py b/spopt/locate/flow.py index ad2c0831..c9a17ab7 100644 --- a/spopt/locate/flow.py +++ b/spopt/locate/flow.py @@ -373,7 +373,7 @@ def add_combination_refueling_constraints( class FRLMCoverageMixin: """Mixin to calculate flow coverage statistics for FRLM.""" - def get_flow_coverage(self) -> None: + def get_flow_coverage(self) -> dict[str, float]: """Improved and fixed calculation of flow coverage.""" if not hasattr(self, "facility_vars") or self.facility_vars is None: raise AttributeError( diff --git a/spopt/tests/test_locate/test_flow.py b/spopt/tests/test_locate/test_flow.py index 84cfa603..a8ba044d 100644 --- a/spopt/tests/test_locate/test_flow.py +++ b/spopt/tests/test_locate/test_flow.py @@ -109,6 +109,7 @@ def test_flow_objective(self, setup_network_with_distances): result = model.solve(solver=pulp.PULP_CBC_CMD(msg=0)) assert result["status"] == "Optimal" coverage = model.get_flow_coverage() + assert isinstance(coverage, dict) assert coverage["covered_volume"] == 50 def test_vmt_objective(self, setup_network_with_distances):