Skip to content

Commit 82a60cd

Browse files
FabianHofmannclaude
andcommitted
fix: resolve remaining mypy type errors in COPT solver
Fix type compatibility issues in solvers.py: - Convert condition to string for Status.from_termination_condition() - Ensure legacy_status assignment matches expected str type Resolves the final mypy errors, completing issue #367. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 65f8210 commit 82a60cd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

linopy/solvers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2041,9 +2041,9 @@ def solve_problem_from_file(
20412041

20422042
# TODO: check if this suffices
20432043
condition = m.MipStatus if m.ismip else m.LpStatus
2044-
termination_condition = CONDITION_MAP.get(condition, condition)
2044+
termination_condition = CONDITION_MAP.get(condition, str(condition))
20452045
status = Status.from_termination_condition(termination_condition)
2046-
status.legacy_status = condition
2046+
status.legacy_status = str(condition)
20472047

20482048
def get_solver_solution() -> Solution:
20492049
# TODO: check if this suffices

0 commit comments

Comments
 (0)