Open
Conversation
PyPSA 1.0 changed component DataFrame index names from component-specific
names ("Generator", "Link", "StorageUnit") to a universal "name". Updated
all reset_index() + rename patterns in results extraction code and tests
to use the new index name.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Changed mock DataFrames from set_index("Link") to set_index("name")
to accurately reflect pypsa 1.0 component DataFrame index naming.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace network.import_from_netcdf() with pypsa.Network(path) to match the pypsa 1.0 API. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
pandas DataFrame.reindex() loses the MultiIndex.name attribute when old and new index values are identical. This causes pypsa 1.0's xarray-based model builder to create a 'dim_0' dimension instead of 'snapshot', crashing define_spillage_variables(). Restore the name after setting snapshots, and pass multi_investment_periods=True to create_model(). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests.
🚀 New features to boost your workflow:
|
Tests that update_network_timeseries works when operational snapshots have identical values to capacity expansion snapshots, which triggers a pandas reindex bug that loses MultiIndex.name and breaks pypsa 1.0's xarray model builder. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The pypsa 1.0 upgrade removes the shapely <2.1 constraint that previously blocked 3.14 (shapely <2.1 lacked 3.14 wheels). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
shapely <2.1 lacks pre-built wheels for Python 3.14, causing build failures from missing geos_c.h. pypsa 1.0 no longer constrains shapely<2.1 so we can now require >=2.1.0. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
new index name:
drops the MultiIndex.name attribute. pypsa 1.0's xarray-based optimization model builder requires snapshots.name == "snapshot" to create correctly named dimensions — without it, xarray produces a dim_0 dimension instead and
define_spillage_variables() fails with KeyError: "'snapshot' is not a valid dimension". Added a workaround to restore the name after setting snapshots.