From 0c8c8c201d2f2d749623c0709f5e56abc42a8d8e Mon Sep 17 00:00:00 2001 From: Max Parzen Date: Wed, 4 May 2022 21:49:15 +0100 Subject: [PATCH] Fix notebook EPSG error (#332) * fix bug. epsg 3763 to 3857 * add release note Reviewed: Davide --- README.md | 128 +++++------------- doc/release_notes.rst | 3 + notebooks/validation/validation_nigeria.ipynb | 29 ++-- 3 files changed, 49 insertions(+), 111 deletions(-) diff --git a/README.md b/README.md index 2b44fec93..acb9f763b 100644 --- a/README.md +++ b/README.md @@ -116,38 +116,31 @@ The documentation is available here: [documentation](https://pypsa-meets-africa. - - - + + - - - - - - - -
- - hazemakhalek -
- Hazemakhalek -
-
- - jarry7 + + pz-max
- Jarrad Wright + Max Parzen
- - fneum + + davide-f
- Fabian Neumann + Davide-f
- - euronion + + restyled-commits
- Euronion + Restyled Commits
- - Justus-coded + + ekatef
- Justus Ilemobayo + Ekaterina
@@ -156,56 +149,41 @@ The documentation is available here: [documentation](https://pypsa-meets-africa.
Mnm-matin -
- - desenk -
- Desen Kirli -
- - LukasFrankenQ + + Hazem-IEG
- Lukas Franken + Hazem-IEG
-
- - pz-max + + euronion
- Max Parzen + Euronion
- - Cesare-Caputo + + giacfalk
- Cesare-Caputo + Giacomo Falchetta
- - Nayara2020 + + LukasFrankenQ
- Nayara2020 + Lukas Franken
- - Ay-Khi -
- Ayman Alkhirbash -
-
- - davide-f + + Tooblippe
- Davide-f + Jarrad Wright
@@ -216,48 +194,13 @@ The documentation is available here: [documentation](https://pypsa-meets-africa. - - Hazem-IEG -
- Hazem-IEG -
-
- - energyLS -
- EnergyLS -
-
- - restyled-commits -
- Restyled Commits -
-
- - ekatef + + jarry7
- Ekaterina + Jarrad Wright
- - giacfalk -
- Giacomo Falchetta -
-
- - Tooblippe -
- Jarrad Wright -
-
EmreYorat @@ -265,13 +208,6 @@ The documentation is available here: [documentation](https://pypsa-meets-africa. EmreYorat - - squoilin -
- Sylvain Quoilin -
-
stephenjlee diff --git a/doc/release_notes.rst b/doc/release_notes.rst index 37558504d..2fa116b5a 100644 --- a/doc/release_notes.rst +++ b/doc/release_notes.rst @@ -19,6 +19,9 @@ Upcoming Release * General user experience improvements: `PR #326 `__ +* Fix minor validation notebook inaccuracy: `PR #332 `__ + + PyPSA-Africa 0.0.2 (6th April 2022) ===================================== diff --git a/notebooks/validation/validation_nigeria.ipynb b/notebooks/validation/validation_nigeria.ipynb index e9c216eac..023781d71 100644 --- a/notebooks/validation/validation_nigeria.ipynb +++ b/notebooks/validation/validation_nigeria.ipynb @@ -190,7 +190,7 @@ "# load substation geodataframe\n", "df_substations_osm_clean = gpd.read_file(\n", " substations_OSMclean_path\n", - ") # .to_crs(epsg=3763)\n", + ") # .to_crs(epsg=3857)\n", "df_substations_osm_clean = df_substations_osm_clean[\n", " df_substations_osm_clean.country == \"NG\"\n", "]\n", @@ -198,7 +198,7 @@ " make_valid\n", ")\n", "# load lines geodataframe\n", - "df_lines_osm_clean = gpd.read_file(lines_OSMclean_path) # .to_crs(epsg=3763)\n", + "df_lines_osm_clean = gpd.read_file(lines_OSMclean_path) # .to_crs(epsg=3857)\n", "df_lines_osm_clean = df_lines_osm_clean[df_lines_osm_clean.country == \"NG\"]\n", "df_lines_osm_clean[\"geometry\"] = df_lines_osm_clean[\"geometry\"].apply(make_valid)" ] @@ -534,7 +534,7 @@ "df_lines_osm_raw = gpd.read_file(lines_OSMraw_path)\n", "df_lines_osm_raw = df_lines_osm_raw[df_lines_osm_raw.Country == \"NG\"]\n", "\n", - "# note that epsg=3763 has been chosen so that lenghts are in meters" + "# note that epsg=3857 has been chosen so that lenghts are in meters" ] }, { @@ -624,7 +624,7 @@ ], "source": [ "df_lines_osm_raw[\"length_by_geometry\"] = df_lines_osm_raw.to_crs(\n", - " epsg=3763\n", + " epsg=3857\n", ").geometry.length\n", "df_lines_osm_raw[[\"Length\", \"length_by_geometry\"]].head()" ] @@ -711,7 +711,7 @@ " \"cables_fix\",\n", "] = 3 # when NaN or None, set default value\n", "df_lines_osm_raw[\"length\"] = (\n", - " df_lines_osm_raw.to_crs(epsg=3763).geometry.length\n", + " df_lines_osm_raw.to_crs(epsg=3857).geometry.length\n", " * df_lines_osm_raw[\"cables_fix\"].astype(float)\n", " / 3\n", ")\n", @@ -742,7 +742,7 @@ } ], "source": [ - "df_lines_osm_raw.to_crs(epsg=3763).length.sum() / 1000" + "df_lines_osm_raw.to_crs(epsg=3857).length.sum() / 1000" ] }, { @@ -772,7 +772,7 @@ ], "source": [ "# Note, since CRS EPSG:3763 is used, distances are in meters, thus by dividing for 1000, the units are in km\n", - "df_lines_osm_raw.to_crs(epsg=3763)[\n", + "df_lines_osm_raw.to_crs(epsg=3857)[\n", " df_lines_osm_raw[\"tags.cables\"].isnull()\n", " | df_lines_osm_raw[\"tags.cables\"].isna() # when NaN or None, set default value\n", "].geometry.length.sum() / 1000" @@ -813,7 +813,7 @@ "source": [ "# Note, since CRS EPSG:3763 is used, distances are in meters, thus by dividing for 1000, the units are in km\n", "df_lines_osm_clean[\"length\"] = (\n", - " df_lines_osm_clean.to_crs(epsg=3763).geometry.length\n", + " df_lines_osm_clean.to_crs(epsg=3857).geometry.length\n", " * df_lines_osm_clean.circuits\n", " / 1000\n", ")\n", @@ -844,7 +844,7 @@ } ], "source": [ - "df_lines_osm_clean.to_crs(epsg=3763).length.sum() / 1000" + "df_lines_osm_clean.to_crs(epsg=3857).length.sum() / 1000" ] }, { @@ -868,7 +868,7 @@ ], "source": [ "df_lines_osm_clean[\"length\"] = (\n", - " df_lines_osm_clean.to_crs(epsg=3763).geometry.length\n", + " df_lines_osm_clean.to_crs(epsg=3857).geometry.length\n", " * df_lines_osm_clean.circuits\n", " / 1000\n", ")\n", @@ -1107,7 +1107,7 @@ "hash": "80b8e479329add50790c5c5f77c522cbd54126228b383995b70e0610cb78cfa9" }, "kernelspec": { - "display_name": "Python 3.9.6 64-bit ('toast': conda)", + "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, @@ -1121,10 +1121,9 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.9.7" - }, - "orig_nbformat": 4 + "version": "3.10.4" + } }, "nbformat": 4, - "nbformat_minor": 2 + "nbformat_minor": 4 }