Skip to content

Pandas deprecation fixes#916

Merged
fneum merged 4 commits intoPyPSA:masterfrom
koen-vg:pandas-dep-fixes
Feb 7, 2024
Merged

Pandas deprecation fixes#916
fneum merged 4 commits intoPyPSA:masterfrom
koen-vg:pandas-dep-fixes

Conversation

@koen-vg
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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.

@koen-vg
Copy link
Copy Markdown
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
Copy Markdown
Member

fneum commented Feb 7, 2024

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

@fneum
Copy link
Copy Markdown
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
@koen-vg
Copy link
Copy Markdown
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