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 deprecations - offset warning #353

Merged
merged 10 commits into from
Jul 16, 2024

Conversation

finozzifa
Copy link
Contributor

@finozzifa finozzifa commented Jul 2, 2024

Closes # (if applicable).

The pull request partially addresses what listed in Issue #314.

Changes proposed in this Pull Request

The changes proposed are:

  • build_industry_demand: DataFrame.applymap has been deprecated. Use DataFrame.map instead. production_base = cagr.applymap(lambda x: 1)
  • prepare_sector_network: FutureWarning: 'H' is deprecated and will be removed in a future version, please use 'h' instead. snapshot_weightings = n.snapshot_weightings.resample(offset).sum()
  • prepare_sector_network: FutureWarning: 'H' is deprecated and will be removed in a future version, please use 'h' instead. pnl[k] = df.resample(offset).mean()
  • prepare_sector_network: FutureWarning: 'H' is deprecated and will be removed in a future version, please use 'h' instead. pnl[k] = df.resample(offset).max()
  • add_export: FutureWarning: 'H' is deprecated and will be removed in a future version, please use 'h' instead. export_profile = export_profile.resample(sopts[0]).mean()

Further work is needed for what follows. A new PR will be raised in the next days.

  • prepare_sector_network: FutureWarning: DataFrame.groupby with axis=1 is deprecated. Do frame.T.groupby(...) without axis instead. heat_demand[[sector + " water", sector + " space"]]
  • prepare_sector_network: FutureWarning: DataFrame.groupby with axis=1 is deprecated. Do frame.T.groupby(...) without axis instead. heat_shape = heat_shape.groupby(

Checklist

  • 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 envs/environment.docs.yaml.
  • Changes in configuration options are added in all of config.default.yaml, config.tutorial.yaml, and test/config.test1.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.

@davide-f
Copy link
Member

davide-f commented Jul 2, 2024

Many thanks @finozzifa ! :D

@davide-f davide-f mentioned this pull request Jul 4, 2024
18 tasks
@davide-f
Copy link
Member

davide-f commented Jul 4, 2024

Ping when this is ready :)

@energyLS
Copy link
Collaborator

Ping when this is ready :)

@finozzifa I think you mentioned last week it is ready?

@finozzifa
Copy link
Contributor Author

finozzifa commented Jul 15, 2024

@energyLS : ja it is ready for merging. Thanks for asking!

@energyLS
Copy link
Collaborator

@energyLS : ja it is ready for merging. Thanks for asking!

Fantastic. @davide-f you mentioned you wanted to have a ping when ready, here it is... can you review it?

@davide-f
Copy link
Member

On it :)

Copy link
Member

@davide-f davide-f left a comment

Choose a reason for hiding this comment

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

Great @finozzifa :D
This PR looks great, just a minor fact that one file was removed.
Then this PR is ready to fly :D

scripts/plot_network_eur.py Outdated Show resolved Hide resolved
@davide-f
Copy link
Member

Great @finozzifa :D
Merging :)

@davide-f davide-f merged commit 9c3ec89 into pypsa-meets-earth:main Jul 16, 2024
3 checks passed
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.

3 participants