Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Nov 7, 2024
1 parent b77dd6a commit 66c3558
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions linopy/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,13 @@ def integers_to_file(
f.writelines(batch)


def to_lp_file(m: Model, fn: Path, integer_label: str, slice_size: int = 10_000_000, log: bool=None) -> None:
def to_lp_file(
m: Model,
fn: Path,
integer_label: str,
slice_size: int = 10_000_000,
log: bool = None,
) -> None:
batch_size = 5000

with open(fn, mode="w") as f:
Expand Down Expand Up @@ -557,7 +563,9 @@ def constraints_to_file_polars(m, f, log=False, lazy=False, slice_size=2_000_000
# formatted.sink_csv(f, **kwargs)


def to_lp_file_polars(m, fn, integer_label="general", slice_size=2_000_000, log: bool=None):
def to_lp_file_polars(
m, fn, integer_label="general", slice_size=2_000_000, log: bool = None
):
with open(fn, mode="wb") as f:
start = time.time()

Expand All @@ -579,7 +587,7 @@ def to_file(
io_api: str | None = None,
integer_label: str = "general",
slice_size: int = 2_000_000,
log = None,
log=None,
) -> Path:
"""
Write out a model to a lp or mps file.
Expand Down

0 comments on commit 66c3558

Please sign in to comment.