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

Pandas deprecation fixes #916

Merged
merged 4 commits into from
Feb 7, 2024
Merged

Pandas deprecation fixes #916

merged 4 commits into from
Feb 7, 2024

Conversation

koen-vg
Copy link
Contributor

@koen-vg koen-vg commented Feb 6, 2024

Just fixing some deprecation and future warnings as I go along :)

Checklist

  • I tested my contribution locally and it seems to work fine.
  • Code and workflow changes are sufficiently documented.
  • Changed dependencies are added to envs/environment.yaml.
  • Changes in configuration options are added in all of config.default.yaml.
  • Changes in configuration options are also documented in doc/configtables/*.csv.
  • A release note doc/release_notes.rst is added.

@koen-vg koen-vg changed the title Pandas dep fixes Pandas deprecation fixes Feb 6, 2024
@koen-vg
Copy link
Contributor Author

koen-vg commented Feb 6, 2024

Ah, this time the tests saved me; I was a little too eager with just one of the fixes.

Copy link
Member

@fneum fneum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Thanks! Just unsure about two cases that I couldn't verify without testing it myself.

scripts/make_summary_perfect.py Outdated Show resolved Hide resolved
scripts/make_summary_perfect.py Outdated Show resolved Hide resolved
@koen-vg
Copy link
Contributor Author

koen-vg commented Feb 7, 2024

Yes you were right! At least the one I was able to test, in the weighted price calculation. It turned out the code path wasn't used before due to an unrelated bug, which I now also fixed. I will say that the whole function seems pretty fragile...

For the CO2 emissions calculations, the code path you pointed out is also never taken! Hence why I didn't find the mistake. It turns out that in sector-coupled perfect foresight networks there aren't any co2-emitting generators anyway; all emissions go the the co2 atmosphere store.

@fneum
Copy link
Member

fneum commented Feb 7, 2024

Great! Thanks for looking into it and sorry that the script is so buggy...

@fneum
Copy link
Member

fneum commented Feb 7, 2024

test failures seem unrelated, I will merge given previous commit CI ran through.

@fneum fneum merged commit 0ded96c into PyPSA:master Feb 7, 2024
4 of 6 checks passed
@koen-vg
Copy link
Contributor Author

koen-vg commented Feb 7, 2024

No worries, happy to help and anyway it's so much better to have anything at all to get started with than having to do everything scratch!

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.

2 participants