Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
f1f8d4e
Implement OETC authentication step
KristijanFaust-OET Jun 9, 2025
cf88264
Implement cloud provider credentials fetch
KristijanFaust-OET Jun 9, 2025
89c2da5
Implement OETC model compression and upload
KristijanFaust-OET Jun 9, 2025
888cfb6
Implement job submission to oetc
KristijanFaust-OET Jun 10, 2025
a6585fa
Implement waiting for OETC job completion
KristijanFaust-OET Jun 10, 2025
f966fd6
Implement solution download and decompression
KristijanFaust-OET Jun 11, 2025
e65c805
Add proper logging
KristijanFaust-OET Jun 11, 2025
bb341b6
Add oetc call to linopy model
KristijanFaust-OET Jun 12, 2025
df6835d
Add requests dependency
KristijanFaust-OET Aug 1, 2025
0195b88
Fix wrong orchestrator endpoint values
KristijanFaust-OET Aug 4, 2025
866f421
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 4, 2025
26f8786
Fix type hint error caught by mypy
KristijanFaust-OET Aug 4, 2025
467786f
Fix conflicts
KristijanFaust-OET Aug 4, 2025
4fb5be7
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 4, 2025
8032e6a
Add OETC integration entry in the release notes
KristijanFaust-OET Aug 4, 2025
c96e9f7
Ignore false positive type warning
KristijanFaust-OET Aug 4, 2025
b76e034
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 4, 2025
bf8dc91
Extend logging for oetc processes
KristijanFaust-OET Aug 26, 2025
c23e794
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 26, 2025
c67f2e6
Use remote argument instead of oetc_settings
KristijanFaust-OET Sep 3, 2025
2addc89
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Sep 3, 2025
5429c8d
Fix mypy errors
KristijanFaust-OET Sep 3, 2025
ee3629f
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Sep 3, 2025
3285108
Update solve method docs
KristijanFaust-OET Sep 3, 2025
d6ddfa0
Merge branch 'master' into oetc-support
FabianHofmann Sep 4, 2025
9b95e63
Merge branch 'master' into oetc-support
FabianHofmann Sep 4, 2025
302246e
fix: missing import of RemoteHandler
FabianHofmann Sep 4, 2025
33432ac
Merge branch 'master' into oetc-support
FabianHofmann Sep 4, 2025
a0b75d5
refac: use remote dir and move stuff there
FabianHofmann Sep 4, 2025
8f5b6fb
feat: increase test coverage
FabianHofmann Sep 4, 2025
eed5ffa
add type hints
FabianHofmann Sep 4, 2025
87fc221
Merge branch 'master' into oetc-support
FabianHofmann Sep 4, 2025
a97b8f4
Merge branch 'master' into oetc-support
FabianHofmann Sep 4, 2025
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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,14 @@ doc/_build
doc/generated
doc/api
.vscode
.idea
Highs.log
paper/
monkeytype.sqlite3
.github/copilot-instructions.md
uv.lock
*.pyc


# Environments
.env
Expand Down
1 change: 1 addition & 0 deletions doc/release_notes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Version 0.5.6

* Improved variable/expression arithmetic methods so that they correctly handle types
* Gurobi: Pass dictionary as env argument `env={...}` through to gurobi env creation
* Added integration with OETC platform
* Mosek: Remove explicit use of Env, use global env instead
* Objectives can now be created from variables via `linopy.Model.add_objective`.

Expand Down
3 changes: 2 additions & 1 deletion linopy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
from linopy.io import read_netcdf
from linopy.model import Model, Variable, Variables, available_solvers
from linopy.objective import Objective
from linopy.remote import RemoteHandler
from linopy.remote import OetcHandler, RemoteHandler

__all__ = (
"Constraint",
Expand All @@ -31,6 +31,7 @@
"LinearExpression",
"Model",
"Objective",
"OetcHandler",
"QuadraticExpression",
"RemoteHandler",
"Variable",
Expand Down
36 changes: 20 additions & 16 deletions linopy/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
)
from linopy.matrices import MatrixAccessor
from linopy.objective import Objective
from linopy.remote import OetcHandler, RemoteHandler
from linopy.solvers import IO_APIS, available_solvers, quadratic_solvers
from linopy.types import (
ConstantLike,
Expand Down Expand Up @@ -1050,7 +1051,7 @@ def solve(
sanitize_zeros: bool = True,
sanitize_infinities: bool = True,
slice_size: int = 2_000_000,
remote: Any = None,
remote: RemoteHandler | OetcHandler = None, # type: ignore
progress: bool | None = None,
**solver_options: Any,
) -> tuple[str, str]:
Expand Down Expand Up @@ -1111,7 +1112,7 @@ def solve(
Size of the slice to use for writing the lp file. The slice size
is used to split large variables and constraints into smaller
chunks to avoid memory issues. The default is 2_000_000.
remote : linopy.remote.RemoteHandler
remote : linopy.remote.RemoteHandler | linopy.oetc.OetcHandler, optional
Remote handler to use for solving model on a server. Note that when
solving on a rSee
linopy.remote.RemoteHandler for more details.
Expand All @@ -1137,20 +1138,23 @@ def solve(
f"Keyword argument `io_api` has to be one of {IO_APIS} or None"
)

if remote:
solved = remote.solve_on_remote(
self,
solver_name=solver_name,
io_api=io_api,
problem_fn=problem_fn,
solution_fn=solution_fn,
log_fn=log_fn,
basis_fn=basis_fn,
warmstart_fn=warmstart_fn,
keep_files=keep_files,
sanitize_zeros=sanitize_zeros,
**solver_options,
)
if remote is not None:
if isinstance(remote, OetcHandler):
solved = remote.solve_on_oetc(self)
else:
solved = remote.solve_on_remote(
self,
solver_name=solver_name,
io_api=io_api,
problem_fn=problem_fn,
solution_fn=solution_fn,
log_fn=log_fn,
basis_fn=basis_fn,
warmstart_fn=warmstart_fn,
keep_files=keep_files,
sanitize_zeros=sanitize_zeros,
**solver_options,
)

self.objective.set_value(solved.objective.value)
self.status = solved.status
Expand Down
19 changes: 19 additions & 0 deletions linopy/remote/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
"""
Remote execution handlers for linopy models.

This module provides different handlers for executing optimization models
on remote systems:

- RemoteHandler: SSH-based remote execution using paramiko
- OetcHandler: Cloud-based execution via OET Cloud service
"""

from linopy.remote.oetc import OetcCredentials, OetcHandler, OetcSettings
from linopy.remote.ssh import RemoteHandler

__all__ = [
"RemoteHandler",
"OetcHandler",
"OetcSettings",
"OetcCredentials",
]
Loading
Loading