mirror of
https://github.com/ANL-CEEESA/MIPLearn.git
synced 2025-12-07 01:48:51 -06:00
Add types to remaining files; activate mypy's disallow_untyped_defs
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
from inspect import isclass
|
||||
from typing import List, Callable, Any
|
||||
|
||||
from miplearn.instance.base import Instance
|
||||
from miplearn.problems.knapsack import KnapsackInstance, GurobiKnapsackInstance
|
||||
from miplearn.solvers.gurobi import GurobiSolver
|
||||
from miplearn.solvers.internal import InternalSolver
|
||||
@@ -19,7 +20,7 @@ def _is_subclass_or_instance(obj: Any, parent_class: Any) -> bool:
|
||||
)
|
||||
|
||||
|
||||
def _get_knapsack_instance(solver):
|
||||
def _get_knapsack_instance(solver: Any) -> Instance:
|
||||
if _is_subclass_or_instance(solver, BasePyomoSolver):
|
||||
return KnapsackInstance(
|
||||
weights=[23.0, 26.0, 20.0, 18.0],
|
||||
|
||||
Reference in New Issue
Block a user