Skip to content

chore: upgrade to linopy 0.7.0#173

Merged
FBumann merged 2 commits into
mainfrom
chore/linopy-0.7.0
May 11, 2026
Merged

chore: upgrade to linopy 0.7.0#173
FBumann merged 2 commits into
mainfrom
chore/linopy-0.7.0

Conversation

@FBumann
Copy link
Copy Markdown
Owner

@FBumann FBumann commented May 11, 2026

Summary

  • Replace the git-commit pin (2d2e851d, 0.6.4.post1.dev80) with the released linopy>=0.7.0. This unblocks PyPI publication — PyPI rejects direct URL deps, so the git pin was the actual blocker, not the alpha version suffix.
  • Drop the xarray<2026.4.0 cap — PyPSA/linopy#647 fixes the Dataset-as-data_vars regression in 0.7.0; xarray now resolves to 2026.4.0 locally.
  • Silence linopy.EvolvingAPIWarning inside _create_piecewise_constraints so users don't see it on every solve — fluxopt owns the API-stability risk of add_piecewise_formulation and will surface it in its own changelog instead.
  • Cosmetic: drop -alpha.0 from initial-version in .release-please-config.json (bootstrap-only field, no functional effect).

Our existing PiecewiseConversion wiring already matches the unified v0.7.0 API (PyPSA/linopy#638) — (expr, breaks) / (expr, breaks, sign) tuples, method="auto"|"sos2"|"incremental"|"lp", active= gate. No code changes needed there.

The release-please manifest (0.0.7-alpha.0) and the 3 - Alpha classifier are intentionally left alone — the next release-please cycle will drop the prerelease suffix on its own now that prerelease/prerelease-type are gone from the config (already done in #163).

Test plan

  • uv sync --group dev resolves linopy 0.7.0 + xarray 2026.4.0
  • uv run pytest — 469 passed, 227 skipped (full piecewise suite green)
  • uv run mypy src/ — clean
  • uv run ruff check . — clean
  • EvolvingAPIWarning no longer appears in pytest warning summary

🤖 Generated with Claude Code

Replace the git-commit pin with the released linopy>=0.7.0, drop the
xarray<2026.4.0 cap (PyPSA/linopy#647 fixes the Dataset-as-data_vars
regression in 0.7.0), and silence the EvolvingAPIWarning emitted by
`add_piecewise_formulation` so users don't see it on every solve —
fluxopt absorbs that API-stability risk in its own changelog.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@FBumann FBumann changed the base branch from dev to main May 11, 2026 19:05
@FBumann FBumann enabled auto-merge (squash) May 11, 2026 19:07
@FBumann FBumann disabled auto-merge May 11, 2026 19:08
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 11, 2026

📝 Walkthrough

Walkthrough

This PR upgrades the project to use linopy 0.7.0+ from its published package instead of a pinned Git reference, loosens the xarray compatibility constraint, and suppresses the EvolvingAPIWarning that the newer linopy emits during piecewise formulation construction.

Changes

linopy Upgrade and Warning Handling

Layer / File(s) Summary
Dependency Constraints
pyproject.toml
linopy dependency changed from a Git pin to linopy>=0.7.0; xarray upper bound removed, keeping only xarray>=2024.1.0.
Warning Suppression
src/fluxopt/model.py
Added imports for warnings and EvolvingAPIWarning; wrapped add_piecewise_formulation() call in warnings.catch_warnings() context to suppress the warning during constraint construction.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 A linopy tale, from pin to published grace,
No more Git hashes cluttering the space,
With warnings suppressed in a tidy embrace,
Our constraints now build at a measured pace,
A xarray's upper bound fades without trace!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title 'chore: upgrade to linopy 0.7.0' clearly summarizes the main change of updating the linopy dependency from a git commit pin to version 0.7.0.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description check ✅ Passed The PR description provides a comprehensive summary of changes, technical rationale, and testing verification covering all required aspects of the description template.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/linopy-0.7.0

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 11, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

Files with missing lines Coverage Δ
src/fluxopt/model.py 97.43% <100.00%> (+0.01%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Cosmetic — initial-version is only used at bootstrap (already past).
Cleans up the last alpha reference touched by config; manifest and
classifier left as-is so release-please drops the prerelease suffix
on its own cycle.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@FBumann FBumann merged commit f361685 into main May 11, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant