diff --git a/doc/release_notes.rst b/doc/release_notes.rst index ddaf257e7..9e079380b 100644 --- a/doc/release_notes.rst +++ b/doc/release_notes.rst @@ -18,6 +18,8 @@ E.g. if a new rule becomes available describe how to use it `snakemake -j1 run_t **Minor Changes and bug-fixing** +* Minor bug-fixing for GADM_ID format naming. `PR #980 `__ and `PR #986 `__ + * Keep data on the original voltage value when rebasing voltages to the standard values and adjust the transmission capacity accordingly. `PR #898 `__ diff --git a/scripts/build_shapes.py b/scripts/build_shapes.py index 5fbf76eb0..08c5f9644 100644 --- a/scripts/build_shapes.py +++ b/scripts/build_shapes.py @@ -1297,7 +1297,10 @@ def gadm( # renaming 3 letter to 2 letter ISO code before saving GADM file # In the case of a contested territory in the form 'Z00.00_0', save 'AA.00_0' - df_gadm["GADM_ID"] = df_gadm["country"] + df_gadm["GADM_ID"].str[3:] + # Include bugfix for the case of 'XXX00_0' where the "." is missing, such as for Ghana + df_gadm["GADM_ID"] = df_gadm["country"] + df_gadm["GADM_ID"].str[3:].apply( + lambda x: x if x[0] == "." else "." + x + ) df_gadm.set_index("GADM_ID", inplace=True) df_gadm["geometry"] = df_gadm["geometry"].map(_simplify_polys) df_gadm.geometry = df_gadm.geometry.apply(