Skip to content

chore: update linopy requirement from <0.8,>=0.5.1 to >=0.5.1,<0.10#750

Open
dependabot[bot] wants to merge 1 commit into
mainfrom
dependabot/pip/linopy-gte-0.5.1-and-lt-0.10
Open

chore: update linopy requirement from <0.8,>=0.5.1 to >=0.5.1,<0.10#750
dependabot[bot] wants to merge 1 commit into
mainfrom
dependabot/pip/linopy-gte-0.5.1-and-lt-0.10

Conversation

@dependabot

@dependabot dependabot Bot commented on behalf of github Jul 26, 2026

Copy link
Copy Markdown
Contributor

Updates the requirements on linopy to permit the latest version.

Release notes

Sourced from linopy's releases.

v0.9.0

What's Changed

New Contributors

... (truncated)

Changelog

Sourced from linopy's changelog.

Version 0.9.0

Features

In-place solver updates (persistent re-solve)

  • A built solver can now be re-solved against a mutated Model without a full rebuild. Construct with Solver.from_name(..., track_updates=True) and re-call solver.solve(model) after edits — the diff against the previous build is applied in place when the backend supports it, falling back to a rebuild otherwise. Supported on HiGHS, Gurobi, Xpress, and Mosek (io_api="direct"). ([#718](https://github.com/PyPSA/linopy/issues/718) <https://github.com/PyPSA/linopy/pull/718>__)
  • Pass disallow_rebuild=True to solve(model, ...) to guarantee an in-place update or raise RebuildRequiredError. Inspect solver._last_rebuild_reason (a RebuildReason, or None after an in-place update) to understand why a rebuild was triggered. ([#718](https://github.com/PyPSA/linopy/issues/718) <https://github.com/PyPSA/linopy/pull/718>__)
  • New linopy.persistent module exposes ModelSnapshot, ModelDiff, and RebuildReason for users who want to introspect or build the diff themselves. ModelDiff.from_snapshot / from_models return the RebuildReason directly when the change cannot be applied in place. ([#718](https://github.com/PyPSA/linopy/issues/718) <https://github.com/PyPSA/linopy/pull/718>__)

Improved IO

  • Model.to_netcdf now records the writing linopy version in the _linopy_version dataset attribute. Files written by older versions (without the attribute) continue to read unchanged. ([#780](https://github.com/PyPSA/linopy/issues/780) <https://github.com/PyPSA/linopy/pull/780>__)

Other

  • Default internal integer labels to int32, cutting memory ~25% and speeding up model build 10-35%. Models exceeding the int32 maximum (~2.1 billion labels) widen to int64 automatically with a UserWarning; pass Model(dtypes={"labels": np.int64}) upfront to avoid the mid-build upcast (exposed read-only via Model.dtypes). ([#566](https://github.com/PyPSA/linopy/issues/566) <https://github.com/PyPSA/linopy/pull/566>__)
  • add_variables(binary=True, ...) now accepts lower/upper bounds, as long as they are 0 or 1. Previously binary bounds could only be set via the .lower/.upper setters after creation. ([#776](https://github.com/PyPSA/linopy/issues/776) <https://github.com/PyPSA/linopy/issues/776>__)
  • add_piecewise_formulation gained an active_fill parameter that gates a partial active (defined over a subset of the indexed dimension, or masked) as always-active (1) or always-off (0); without it, a partial active — which was previously zeroed silently — now raises. Useful when one formulation mixes gated and ungated entities (e.g. committable and non-committable units sharing a status). active_fill is transitional and will be removed once v1 semantics make active.reindex(coords).fillna(value) sufficient. ([#796](https://github.com/PyPSA/linopy/issues/796) <https://github.com/PyPSA/linopy/issues/796>__)

Performance

  • LinearExpression.groupby(...).sum() now scatters terms directly into the padded result arrays via xarray.apply_ufunc, avoiding intermediate copies and speeding up the grouping. A single kernel covers both numpy and chunked (dask) data, the latter staying lazy. On representative models this lowers build and export peak memory by up to ~3x. The kernel emits the grouped result in its final axis order in one contiguous allocation; on dask inputs the reduction now runs over a single chunk (it no longer parallelises over the surviving dimensions). ([#802](https://github.com/PyPSA/linopy/issues/802) <https://github.com/PyPSA/linopy/pull/802>__)

Deprecations

  • Mutation via assignment to Variable.lower / Variable.upper / Constraint.coeffs / Constraint.vars / Constraint.lhs / Constraint.sign / Constraint.rhs is deprecated and emits a DeprecationWarning. Use Variable.update(...) / Constraint.update(...) instead — the canonical mutation API with one validation path and one place that flips the persistent-solver dirty flag. Read access to these properties is unchanged. The setters will be removed in a future release. ([#718](https://github.com/PyPSA/linopy/issues/718) <https://github.com/PyPSA/linopy/pull/718>__)
  • Passing a raw DataArray of integer labels to Constraint.vars = ... setter is deprecated and emits a FutureWarning. Pass a Variable to Constraint.update() instead — it is the supported input. The DataArray path will be removed in a future release. ([#718](https://github.com/PyPSA/linopy/issues/718) <https://github.com/PyPSA/linopy/pull/718>__)

Bug fixes

  • Fix GLPK objective parsing. ([#818](https://github.com/PyPSA/linopy/issues/818) <https://github.com/PyPSA/linopy/pull/818>__)
  • LP file export now honors bounds tightened below [0, 1] on a binary variable via the .lower/.upper setters after creation (e.g. upper = 0). Previously such bounds were written only by io_api="direct" and dropped by io_api="lp". ([#776](https://github.com/PyPSA/linopy/issues/776) <https://github.com/PyPSA/linopy/issues/776>__)
  • Freezing an empty constraint group (e.g. an empty isel slice) no longer raises ValueError: cannot reshape array of size 0. Model(freeze_constraints=True) and Constraint.freeze() now round-trip zero-row constraints losslessly. ([#783](https://github.com/PyPSA/linopy/issues/783) <https://github.com/PyPSA/linopy/pull/783>__)
  • Variable.where no longer raises ValueError: exact match required for all data variable names once a solution is attached (after Model.solve) or the variable is fixed. The fill value now covers auxiliary data variables (solution, stashed bounds) instead of only labels/lower/upper. ([#790](https://github.com/PyPSA/linopy/issues/790) <https://github.com/PyPSA/linopy/pull/790>__)
  • LinearExpression.groupby(...).sum() with a multi-dimensional DataArray grouper now reduces over all of the grouper's dimensions on the default (fast) path, instead of leaking one of them into the result. ([#824](https://github.com/PyPSA/linopy/issues/824) <https://github.com/PyPSA/linopy/pull/824>__)
  • LinearExpression.groupby(...).sum() now keeps the grouped dimension's position, replacing it in place like xarray's native groupby-reduce, instead of moving the group dimension to the trailing position (regressed in 0.8.0). Both the default and use_fallback=True paths are fixed. ([#860](https://github.com/PyPSA/linopy/issues/860) <https://github.com/PyPSA/linopy/pull/860>__)
  • LinearExpression.groupby(...).sum() now raises when a grouper's labels are reordered or a different set relative to the expression, instead of silently regrouping by position. Reorder the grouper to match the expression's coordinates before grouping. ([#827](https://github.com/PyPSA/linopy/issues/827) <https://github.com/PyPSA/linopy/issues/827>__)
  • linopy.testing.assert_linequal now aligns dimension order before comparing, so mathematically identical expressions built in different orders (e.g. x + y versus y + x, which inherit different dimension orders from xarray broadcasting) are correctly treated as equal. Genuinely different expressions still fail. ([#801](https://github.com/PyPSA/linopy/issues/801) <https://github.com/PyPSA/linopy/pull/801>__)
  • Summing an expression over a dimension that carries an auxiliary (non-dimension) coordinate no longer leaks that coordinate onto the internal term dimension, where it broke later arithmetic with a CoordinateValidationError. Auxiliary coordinates on the remaining dimensions still propagate. ([#295](https://github.com/PyPSA/linopy/issues/295) <https://github.com/PyPSA/linopy/issues/295>__)
  • Solver.close() (also triggered by model.solver = None and the next solve() call) now explicitly disposes the gurobipy model before the environment. Previously the model was only dereferenced, so a user-held model.solver_model reference silently kept the Gurobi license acquired after close(). ([#459](https://github.com/PyPSA/linopy/issues/459) <https://github.com/PyPSA/linopy/issues/459>__)
  • The linopy.remote and linopy.persistent subpackages are now shipped in the wheel; previously they were omitted, so importing them failed on a pip-installed linopy. ([#865](https://github.com/PyPSA/linopy/issues/865) <https://github.com/PyPSA/linopy/pull/865>__)

Version 0.8.0

Features

... (truncated)

Commits
  • a29ca11 release v0.9; update release notes
  • 2afe5d0 docs: harmonize PR/issue refs in release notes (#866)
  • e295723 fix(packaging): ship linopy.remote and linopy.persistent in the wheel (#865)
  • 8853e38 fix: don't leak aux coords of summed dims onto the term dimension (#829)
  • 4711206 fix(groupby): preserve grouped-dim position in groupby-sum (#860)
  • c2607b6 added two example notebooks: energy-resource-build and sudoku (#356)
  • d701781 docs: list SCIP in supported solvers (README, index) (#835)
  • 435a645 docs: add working-with-solvers notebook for the stateful Solver API (#685)
  • f3e30ae fix(groupby): align groupers by label, raise on mismatch (#827) (#830)
  • 065b7ff fix(gurobi): dispose the solver model before the env on close (#826)
  • Additional commits viewable in compare view

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

Updates the requirements on [linopy](https://github.com/PyPSA/linopy) to permit the latest version.
- [Release notes](https://github.com/PyPSA/linopy/releases)
- [Changelog](https://github.com/PyPSA/linopy/blob/v0.9.0/doc/release_notes.rst)
- [Commits](PyPSA/linopy@v0.5.1...v0.9.0)

---
updated-dependencies:
- dependency-name: linopy
  dependency-version: 0.9.0
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot dependabot Bot added dependencies Updating or fixing dependencies python Pull requests that update python code labels Jul 26, 2026
@github-actions
github-actions Bot enabled auto-merge (squash) July 26, 2026 12:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Updating or fixing dependencies python Pull requests that update python code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants