Skip to content

v8 integration: all breaking changes for the next major#747

Draft
FBumann wants to merge 7 commits into
mainfrom
v8
Draft

v8 integration: all breaking changes for the next major#747
FBumann wants to merge 7 commits into
mainfrom
v8

Conversation

@FBumann

@FBumann FBumann commented Jul 23, 2026

Copy link
Copy Markdown
Member

What this is

The v8 integration branch — the collection point for every breaking change destined for v8.0.0. Policy: main stays fully v7-compatible (see #746); anything breaking lands here via PRs based on v8, and main → v8 syncs keep it current. This PR is the final gate: one review, one merge, one v8.0.0 release.

Already collected

Work Origin
Removal of all overdue deprecated APIs (Optimization/Results, FlowSystem methods, pyvis, kwarg shims) + v8 migration guide #741
Batched element models (up to 67× faster builds) + v7 compat layer (LegacySolutionWrapper, LegacyElementAccess, default-on with DeprecationWarnings) #744 / #602
Clustering dim-rename layer drop (breaking for persisted artifacts — reverted on main by #746) #739
tests/superseded removal (harsh-cleanup) direct

Still to collect

Sync discipline

Full suite on v8: 1454 passed, 0 failed; all fast docs notebooks execute.

🤖 Generated with Claude Code

@coderabbitai

coderabbitai Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 07b2deb9-b4c8-43fc-ab79-25814ddc5b8b

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch v8

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.

FBumann and others added 4 commits July 23, 2026 17:14
Squash of the remove-deprecated-api branch. Removes everything that outlived
its promised removal deadline (announced for v6/v7):

- Optimization / SegmentedOptimization / Results classes
- FlowSystem.sel/isel/resample/coords, plot_network and the network app
  wrappers, topology.plot_legacy() and the pyvis renderer (pyvis dependency
  dropped)
- normalize_weights parameter, the deprecated-kwarg rename bridge,
  from_old_results(), tests/deprecated and the deprecated_api marker

Kept: FlowSystem.from_old_dataset() + io conversion helpers as the supported
pre-v5 file migration path, with real-file regression tests (sunset: v9).
Adds docs/user-guide/migration-guide-v8.md and the CHANGELOG Unreleased
section.

BREAKING CHANGE: see the v8 migration guide for the complete removed->
replacement table.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Squash of the element-data-classes work rebased onto the v8 removals.

Batched/vectorized model building — up to 67x faster for large systems:
type-level FlowsModel/StoragesModel/BusesModel replace per-element loops,
*Data containers pre-compute element parameters as element-dimensioned
DataArrays, variables use linopy masks, and the solution uses batched
naming ('flow|rate' with a flow dim instead of per-element variables).

v7 compatibility layer (CONFIG.Legacy.solution_access, default on for the
v8 transition, sunset v9):
- LegacySolutionWrapper translates old solution keys (flows, storages,
  effects, component status family) with DeprecationWarnings attributed to
  user code; membership checks translate too
- LegacyElementAccess keeps Dataset-style stats patterns working:
  flow_rates['Boiler(Q_th)'], .items(), .data_vars
- verified against real v7 result files: load, raw access and re-optimize
  work; stats accessors need one re-optimize

Also: clustered-storage investment effects fixed (dead collect_effects path),
intercluster sizes included in stats.sizes, docs notebooks adapted to the
batched idioms, expansion machinery reconciled with the tsam_xarray world.

BREAKING CHANGE: solution and linopy variables use batched names; statistics
accessors return element-dimensioned DataArrays. The legacy access layer
bridges common v7 patterns during the transition.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
544K of tests that never ran (ignored via addopts since the accessor
redesign). The v8 branch is the place to stop carrying them.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The post-solve validation in _create_effects_dataset compared
ds[effect].sum(...) against solution[label] via np.allclose on the raw
.values. When the two arrays carry the same dims in a different order --
e.g. a clustered system expanded back yields (scenario, period) while the
computed total is (period, scenario) -- numpy cannot broadcast (3,2) against
(2,3) and raises ValueError, turning a soft warning into a hard crash.

Align the two label-aware before comparing: warn on a genuine dimension-set
mismatch, otherwise transpose solution[label] to the computed dim order.
Applies to both copies of the check (StatisticsAccessor and Results).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
FBumann and others added 3 commits July 23, 2026 19:13
# Conflicts:
#	flixopt/results.py
#	flixopt/statistics_accessor.py
#	tests/test_effects_dataset_validation.py
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@FBumann

FBumann commented Jul 23, 2026

Copy link
Copy Markdown
Member Author

main → v8 sync after #746 is done: merged main at bc18a54 (includes #745/#746), reverted the revert (06eddd7) so #739 stays on v8, and adapted the new clustered-roundtrip test from main to the batched stats API (a7df344). tests/test_clustering + tests/test_effects_dataset_validation.py: 289 passed locally. The tracked reapply-on-main PR is #748 (draft, do not merge before v8.0.0 — close it if this branch lands first).

🤖 Generated with Claude Code

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