Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions linopy/solvers.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
"mosek",
"copt",
"mindopt",
"knitro",
]

# Solvers that don't need a solution file when keep_files=False
Expand Down Expand Up @@ -145,6 +146,9 @@ class xpress_Namespaces: # type: ignore[no-redef]
except coptpy.CoptError:
pass

with contextlib.suppress(ModuleNotFoundError, ImportError):
pass

quadratic_solvers = [s for s in QUADRATIC_SOLVERS if s in available_solvers]
logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -176,6 +180,7 @@ class SolverName(enum.Enum):
COPT = "copt"
MindOpt = "mindopt"
PIPS = "pips"
Knitro = "knitro"


def path_to_string(path: Path) -> str:
Expand Down
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ docs = [
"gurobipy==11.0.2",
"ipykernel==6.29.5",
"matplotlib==3.9.1",
"knitro>=15.0.1",
]
dev = [
"pytest",
Expand All @@ -70,6 +71,7 @@ dev = [
"types-requests",
"gurobipy",
"highspy",
"knitro",
]
solvers = [
"gurobipy",
Expand All @@ -81,6 +83,7 @@ solvers = [
"coptpy!=7.2.1",
"xpress; platform_system != 'Darwin' and python_version < '3.11'",
"pyscipopt; platform_system != 'Darwin'",
"knitro>=15.0.1",
]

[tool.setuptools.packages.find]
Expand Down
Loading