rl-institut / oemof-B3

An open-source energy system model for Brandenburg/Berlin.
https://oemof-b3.readthedocs.io/
GNU Affero General Public License v3.0
9 stars 5 forks source link

FutureWarning in rule prepare_conv_pp #346

Closed Stefanie08 closed 11 months ago

Stefanie08 commented 11 months ago

Executing the rule prepare_conv_pp in the branch features/update_tabular (branch dev after release of v0.0.3) raises a FutureWarningwhich states the following:

~\scripts\prepare_conv_pp.py:146: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value 'MW' has dtype incompatible
 with float64, please explicitly cast to a compatible dtype first.
  df.loc[df["var_name"] == key, "var_unit"] = value

The pandas version I have installed is 2.0.3. The rule can be executed as usual but needs a correction to avoid future incompatibilities.

MaGering commented 11 months ago

Thanks for finding this! I overlooked that. Let's try to fix this within Milestone v0.0.3.

MaGering commented 11 months ago

Execute for testing:

snakemake -j1 clean
poetry install -E preprocessing
snakemake -j1 prepare_conv_pp
MaGering commented 11 months ago

Running snakemake -j1 prepare_conv_pp locally on branch features/update_tabular I could not reproduce the FutureWarning. I have the same Pandas version as you @Stefanie08. Could you please check again if you get it and otherwise close this issue?

I'll change the Milestone to a later release date.

Stefanie08 commented 11 months ago

This issue can be closed. After I created a new environment the FutureWarning does not get printed anymore. Thank you @MaGering for the review of this issue. :)