pypsa-meets-earth / pypsa-earth

PyPSA-Earth: A flexible Python-based open optimisation model to study energy system futures around the world.
https://pypsa-earth.readthedocs.io/en/latest/
207 stars 167 forks source link

Issue 687 pandas deprecations #1023

Closed finozzifa closed 1 month ago

finozzifa commented 1 month ago

Closes # (if applicable).

Issue #687

Changes proposed in this Pull Request

The changes are listed in the comment https://github.com/pypsa-meets-earth/pypsa-earth/issues/687#issuecomment-2100447481

Checklist

finozzifa commented 1 month ago

Hi all, The PR apparently solves just three out of the four deprecations listed in Issue #687. The one in build_osm_network remains unfortunately still outstanding. Sincere apologies!

EDIT on May 10th 2024: all deprecations have been addressed!

ekatef commented 1 month ago

Hi all, The PR apparently solves just three out of the four deprecations listed in Issue #687. The one in build_osm_network remains unfortunately still outstanding. Sincere apologies!

EDIT on May 10th 2024: all deprecations have been addressed!

Perfect, thanks a lot for addressing this issue!! The PR looks good for me, have only some doubts regarding this special case of empty lines dataframe. It would be great to test that it really works as expected.

As an additional comment, I see that the CI logs became now much cleaner, which is the fantastic news πŸ’š But it appears that CI is reporting another pandas deprecation issue (haven't seen it locally): lines.geometry.loc[i] = linemerge( /home/runner/work/pypsa-earth/pypsa-earth/.snakemake/scripts/tmprqe2v9pu.build_osm_network.py:178: FutureWarning: ChainedAssignmentError: behaviour will change in pandas 3.0!. Would you mind to look into it?

finozzifa commented 1 month ago

Hi all, I have found extra deprecations that I have resolved. However there are a couple I would like your opinion about.

You can find them listed in this comment.

ekatef commented 1 month ago

Thanks a lot for introducing the changes @finozzifa! In my opinion, the PR is ready for merge :)

@davide-f what is your feeling about that? :) May you have any further comments?

ekatef commented 1 month ago

Merged :D

Thanks a lot @finozzifa for the great contribution! πŸŽ‰ πŸŽ‰ πŸŽ‰ Thanks to your PR, we are now ready to the future pandas, which is awesome :)))

@davide-f thank you for the fantastic support πŸ™‚