Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update environment after linopy PR #1276

Open
wants to merge 77 commits into
base: main
Choose a base branch
from

Conversation

davide-f
Copy link
Member

@davide-f davide-f commented Jan 3, 2025

Closes # (if applicable).

Changes proposed in this Pull Request

This PR merges #1172 and #1262 and includes comments by katia on #1262, plus restores conda installation of tsam

Checklist

  • I consent to the release of this PR's code under the AGPLv3 license and non-code contributions under CC0-1.0 and CC-BY-4.0.
  • I tested my contribution locally and it seems to work fine.
  • Code and workflow changes are sufficiently documented.
  • Newly introduced dependencies are added to envs/environment.yaml and doc/requirements.txt.
  • Changes in configuration options are added in all of config.default.yaml and config.tutorial.yaml.
  • Add a test config or line additions to test/ (note tests are changing the config.tutorial.yaml)
  • Changes in configuration options are also documented in doc/configtables/*.csv and line references are adjusted in doc/configuration.rst and doc/tutorial.rst.
  • A note for the release notes doc/release_notes.rst is amended in the format of previous release notes, including reference to the requested PR.

github-actions bot and others added 30 commits October 30, 2024 14:47
* Add a zenodo link to natura.tiff

* Update environment

* Revise structure definition for lines

* Remove get_aggregation_strategies

* Fix typo aggregation_strategies

* Replace aggregategenerators with aggregateoneport

* Add aggregation strategies as a parameter

* Re-define aggregation strategies

* Update aggregation strategies

* Update aggregation strategies for lines

* Update aggregation strategies for buses

* Fix typo

* Put aggregation strategies into a variable

* Parametrize the aggregation strategies

* Refactor update of the aggregation strategies

* Clean-up the code

* Revert "Add a zenodo link to natura.tiff"

This reverts commit 7700759.

* Define an explicit clustering strategy for v_nom

* Add a release note

* Get glpk back

* Specify v_nom for buses explicitly

* Revert "Specify v_nom for buses explicitly"

This reverts commit 20192e6.

* Add a version restriction to the environment specification

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Adjust naming

* Move the variable definition

* Move the variable

* Upgrade PyPSA version

---------

Co-authored-by: Davide Fioriti <fioritidavidesubs@gmail.com>
Co-authored-by: Davide Fioriti <67809479+davide-f@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* Add a zenodo link to natura.tiff

* Update environment

* Revise structure definition for lines

* Remove get_aggregation_strategies

* Fix typo aggregation_strategies

* Replace aggregategenerators with aggregateoneport

* Add aggregation strategies as a parameter

* Re-define aggregation strategies

* Update aggregation strategies

* Update aggregation strategies for lines

* Update aggregation strategies for buses

* Fix typo

* Put aggregation strategies into a variable

* Parametrize the aggregation strategies

* Refactor update of the aggregation strategies

* Clean-up the code

* Revert "Add a zenodo link to natura.tiff"

This reverts commit 7700759.

* Define an explicit clustering strategy for v_nom

* Add a release note

* Get glpk back

* Specify v_nom for buses explicitly

* Revert "Specify v_nom for buses explicitly"

This reverts commit 20192e6.

* Add a version restriction to the environment specification

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Adjust naming

* Move the variable definition

* Move the variable

* Upgrade PyPSA version

* Update docstring

* Fix imports duplication

* Update imports

* Update the carrier-capacity constraint

* Add docstring

* Update the equity constraint

* Add docstring

* Update BAU constraint

* Update SAFE constraint

* Add docstring

* Update operational reserve margin constraint

* Add docstring

* Add an new argument to the RM constraint

* Update the update of capacity constraints

* Update adding an operational reserve margin constraint

* Update docstring

* Update battery constraint

* Add docstring

* Update a constraint related to a RES share

* Fix usage of add_ERS_constraints

* Update solving script

* Update a solving run

* Fix typos

---------

Co-authored-by: Davide Fioriti <fioritidavidesubs@gmail.com>
Co-authored-by: Davide Fioriti <67809479+davide-f@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
…ets-earth#1162)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
* Add a zenodo link to natura.tiff

* Update environment

* Revise structure definition for lines

* Remove get_aggregation_strategies

* Fix typo aggregation_strategies

* Replace aggregategenerators with aggregateoneport

* Add aggregation strategies as a parameter

* Re-define aggregation strategies

* Update aggregation strategies

* Update aggregation strategies for lines

* Update aggregation strategies for buses

* Fix typo

* Put aggregation strategies into a variable

* Parametrize the aggregation strategies

* Refactor update of the aggregation strategies

* Clean-up the code

* Revert "Add a zenodo link to natura.tiff"

This reverts commit 7700759.

* Define an explicit clustering strategy for v_nom

* Add a release note

* Get glpk back

* Specify v_nom for buses explicitly

* Revert "Specify v_nom for buses explicitly"

This reverts commit 20192e6.

* Add a version restriction to the environment specification

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Adjust naming

* Move the variable definition

* Move the variable

* Upgrade PyPSA version

---------

Co-authored-by: Davide Fioriti <fioritidavidesubs@gmail.com>
Co-authored-by: Davide Fioriti <67809479+davide-f@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* Add a zenodo link to natura.tiff

* Update environment

* Revise structure definition for lines

* Remove get_aggregation_strategies

* Fix typo aggregation_strategies

* Replace aggregategenerators with aggregateoneport

* Add aggregation strategies as a parameter

* Re-define aggregation strategies

* Update aggregation strategies

* Update aggregation strategies for lines

* Update aggregation strategies for buses

* Fix typo

* Put aggregation strategies into a variable

* Parametrize the aggregation strategies

* Refactor update of the aggregation strategies

* Clean-up the code

* Revert "Add a zenodo link to natura.tiff"

This reverts commit 7700759.

* Define an explicit clustering strategy for v_nom

* Add a release note

* Get glpk back

* Specify v_nom for buses explicitly

* Revert "Specify v_nom for buses explicitly"

This reverts commit 20192e6.

* Add a version restriction to the environment specification

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Adjust naming

* Move the variable definition

* Move the variable

* Upgrade PyPSA version

* Update docstring

* Fix imports duplication

* Update imports

* Update the carrier-capacity constraint

* Add docstring

* Update the equity constraint

* Add docstring

* Update BAU constraint

* Update SAFE constraint

* Add docstring

* Update operational reserve margin constraint

* Add docstring

* Add an new argument to the RM constraint

* Update the update of capacity constraints

* Update adding an operational reserve margin constraint

* Update docstring

* Update battery constraint

* Add docstring

* Update a constraint related to a RES share

* Fix usage of add_ERS_constraints

* Update solving script

* Update a solving run

* Fix typos

---------

Co-authored-by: Davide Fioriti <fioritidavidesubs@gmail.com>
Co-authored-by: Davide Fioriti <67809479+davide-f@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
@davide-f
Copy link
Member Author

davide-f commented Jan 4, 2025

@ekatef , I believe this PR is ready as CI passes.
To ease review, the comparison of changes with respect to your linopy one is here:
pypsa_linopy_update...davide-f:pypsa-earth:test_linopy_latest_gpd

it would be great to merge the two environment changes together as they are both breaking changes and this would avoid users to update env and tooling twice

@davide-f
Copy link
Member Author

davide-f commented Jan 5, 2025

Note, I've been trying to re-allow the conda installation of chaospy, fake_useragent and googledrivedownloader.
There is progress:

@ekatef
Copy link
Member

ekatef commented Jan 5, 2025

@ekatef , I believe this PR is ready as CI passes. To ease review, the comparison of changes with respect to your linopy one is here: pypsa_linopy_update...davide-f:pypsa-earth:test_linopy_latest_gpd

it would be great to merge the two environment changes together as they are both breaking changes and this would avoid users to update env and tooling twice

Totally agree 😄 I see that you also have polished usage of safe_to_geojson. So, codewise the changes are perfectly alright. I think the only point missed in a release note 😉 Would you mind adding it?

Also, we must remember to revise the docs to include the instructions how to stick to the previous versions, and announce merging of this PR properly to minimise the damage

@davide-f
Copy link
Member Author

davide-f commented Jan 5, 2025

release note has been added :)
Regarding the previous versions, could you clarify? Do you refer versions like 0.5 or for this specific PR?

Mentioning how to stick to past versions may be risky from a maintenance point of view.
It would give the assumption that we maintain past versions and it can be a bit messy. What do you mean?

@ekatef
Copy link
Member

ekatef commented Jan 6, 2025

release note has been added :) Regarding the previous versions, could you clarify? Do you refer versions like 0.5 or for this specific PR?

Mentioning how to stick to past versions may be risky from a maintenance point of view. It would give the assumption that we maintain past versions and it can be a bit messy. What do you mean?

Super, thanks a lot! 😄

I do agree that we must be careful in wording to avoid an impression that we have resources to maintain the older versions. My only though has been to remind that the existing workflow can be kept for a while to avoid messing-up the existing modeling work.

My feeling is that we can follow the same strategy as for the merge: merge this PR but treat the changes as experimental for a while, while release 0.6.1 can be used for this time as a stable version. Does it sound reasonable for you?

@ekatef
Copy link
Member

ekatef commented Jan 6, 2025

To the point of the fixes: have added one in #1172. It has been needed to account that the interface of pypsa.clustering.spatial.Clustering() has changed. Tests are not capturing that as we use it only for a special case when a number of clusters equals to a number of nodes

@davide-f Happy to push the changes also to this branch if you think it's appropriate

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.

4 participants