Skip to content

Commit

Permalink
Merge pull request #1102 from cpschau/fix_pp_bug
Browse files Browse the repository at this point in the history
Fix bug in powerplant data processing
  • Loading branch information
davide-f authored Sep 18, 2024
2 parents 2117425 + 82a4789 commit f660a3a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
1 change: 1 addition & 0 deletions doc/release_notes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ E.g. if a new rule becomes available describe how to use it `snakemake -j1 run_t
* Fixed problematic float parsing (`_parse_float`) in `clean_osm_data.py` to make sure all OSM lines are correctly accounted for `PR #1089 <https://github.com/pypsa-meets-earth/pypsa-earth/pull/1089>`__

* Fix minor bug for advanced csp implementation `PR #1076 <https://github.com/pypsa-meets-earth/pypsa-earth/pull/1076>`__
* Fix minor bug in `build_powerplants.py` where the gas technology assignment incorrectly introduced NaN values for all powerplant technologies. `PR #1102 <https://github.com/pypsa-meets-earth/pypsa-earth/pull/1102>`__


PyPSA-Earth 0.4.0
Expand Down
6 changes: 2 additions & 4 deletions scripts/build_powerplants.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,10 +285,8 @@ def replace_natural_gas_technology(df: pd.DataFrame):
unique_tech_with_ng = df.loc[fueltype, "Technology"].unique()
unknown_techs = np.setdiff1d(unique_tech_with_ng, ["CCGT", "OCGT"])
if len(unknown_techs) > 0:
df.Technology.where(
fueltype,
df["Technology"].map({t: "CCGT" for t in unknown_techs}),
inplace=True,
df.loc[fueltype, "Technology"] = df.loc[fueltype, "Technology"].replace(
{t: "CCGT" for t in unknown_techs}
)
df["Fueltype"] = np.where(fueltype, df["Technology"], df["Fueltype"])
return df
Expand Down

0 comments on commit f660a3a

Please sign in to comment.