Skip to content

Commit 547e8e8

Browse files
Fix the WDPA links to function on Windows (#2008)
* Fix the WDPA links to function on Windows Minor changes: - replace the second : in the WDPA links with %3A * add additional url fixes and schema check --------- Co-authored-by: Lukas Trippe <lkstrp@pm.me>
1 parent 88acb83 commit 547e8e8

3 files changed

Lines changed: 14 additions & 5 deletions

File tree

data/versions.csv

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ aquifer_data,v1.2,archive,latest supported,2026-01-13,,https://data.pypsa.org/wo
44
attributed_ports,2020-07-10,primary,latest supported,2025-12-02,,https://datacatalogfiles.worldbank.org/ddh-published/0038118/1/DR0046414/attributed_ports.geojson
55
attributed_ports,2020-07-10,archive,latest supported,2026-01-13,Moved from github repo `data/` folder,https://data.pypsa.org/workflows/eur/attributed_ports/2020-07-10/attributed_ports.json
66
bfs_gdp_and_population,2019-03-28,primary,latest supported,2025-12-02,,https://dam-api.bfs.admin.ch/hub/api/dam/assets/7786557/master
7-
bfs_gdp_and_population,2019-03-28,archive,latest supported,2025-12-02,,https://web.archive.org/web/20250818151254if_/https://dam-api.bfs.admin.ch/hub/api/dam/assets/7786557/master
7+
bfs_gdp_and_population,2019-03-28,archive,latest supported,2025-12-02,,https://web.archive.org/web/20250818151254if_/https%3A//dam-api.bfs.admin.ch/hub/api/dam/assets/7786557/master
88
bfs_road_vehicle_stock,unknown,primary,latest supported,2025-12-02,This dataset is not versioned and is updated regularly. The link points to the latest version. More information on the latest update on this website: https://www.bfs.admin.ch/bfs/de/home/statistiken/kataloge-datenbanken.assetdetail.33827666.html,https://datawrapper.dwcdn.net/31f3521eddfa82ada1a436983c31caf5/1/dataset.csv
99
bfs_road_vehicle_stock,2024-03-13,archive,latest supported,2025-12-02,,https://raw.githubusercontent.com/PyPSA/pypsa-eur/5b5d308bf70f15dd0b107d8a19c121093dcdd5bd/data/gr-e-11.03.02.01.01-cc.csv
1010
bidding_zones_electricitymaps,v1.238.0,primary,latest supported,2026-01-22,,https://raw.githubusercontent.com/electricitymaps/electricitymaps-contrib/refs/tags/v1.238.0/web/geo/world.geojson
@@ -58,7 +58,7 @@ gem_gspt,march-2025-v1,primary,not-supported,2025-12-02,,https://globalenergymon
5858
gem_gspt,april-2024-v1,archive,latest supported,2026-01-13,,https://data.pypsa.org/workflows/eur/gem_gspt/april-2024-v1/Global-Steel-Plant-Tracker-April-2024-Standard-Copy-V1.xlsx
5959
geothermal_heat_utilisation_potentials,341.5,primary,latest supported,2025-12-02,,https://fordatis.fraunhofer.de/bitstream/fordatis/341.5/11/Results_DH_Matching_Cluster.xlsx
6060
geothermal_heat_utilisation_potentials,341.5,archive,latest supported,2026-01-13,,https://data.pypsa.org/workflows/eur/geothermal_heat_utilisation_potentials/341.5/Results_DH_Matching_Cluster.xlsx
61-
ghg_emissions,v23,primary,latest supported,2025-12-02,,https://web.archive.org/web/20200622130401if_/https://www.eea.europa.eu/data-and-maps/data/national-emissions-reported-to-the-unfccc-and-to-the-eu-greenhouse-gas-monitoring-mechanism-16/national-greenhouse-gas-inventories-ipcc-common-reporting-format-sector-classification/ascii-delimited-zip-2/at_download/file
61+
ghg_emissions,v23,primary,latest supported,2025-12-02,,https://web.archive.org/web/20200622130401if_/https%3A//www.eea.europa.eu/data-and-maps/data/national-emissions-reported-to-the-unfccc-and-to-the-eu-greenhouse-gas-monitoring-mechanism-16/national-greenhouse-gas-inventories-ipcc-common-reporting-format-sector-classification/ascii-delimited-zip-2/at_download/file
6262
ghg_emissions,v23,archive,latest supported,2026-01-13,earlier part of databundle,https://data.pypsa.org/workflows/eur/ghg_emissions/v23/UNFCCC_v23.csv
6363
h2_salt_caverns,16-10-2019,primary,latest supported,2025-12-02,,https://zenodo.org/records/16899309/files/h2_salt_caverns_GWh_per_sqkm.geojson
6464
h2_salt_caverns,16-10-2019,archive,latest supported,2026-01-13,,https://data.pypsa.org/workflows/eur/h2_salt_caverns/16-10-2019/h2_salt_caverns_GWh_per_sqkm.geojson
@@ -123,8 +123,8 @@ synthetic_electricity_demand,0.1.0,archive,deprecated might-work,2026-01-13,,htt
123123
tyndp,2024,primary,latest supported,2025-12-02,,https://2024-data.entsos-tyndp-scenarios.eu/files/scenarios-inputs
124124
tyndp,2024,archive,latest supported,2026-01-13,,https://data.pypsa.org/workflows/eur/tyndp/2024
125125
wdpa,unknown,primary,latest supported,2025-12-02,"WDPA changes its URL every month, the URL here is used as a template and {bYYYY} is replaced inside the retrieve.smk.",https://d1gam3xoknrgr2.cloudfront.net/current/WDPA_{bYYYY}_Public_shp.zip
126-
wdpa,2025-07,archive,latest supported,2025-12-02,"We are legally not allowed to redistribute this dataset, luckily the web archive is keeping copies of it.",https://web.archive.org/web/20250715071823if_/https://d1gam3xoknrgr2.cloudfront.net/current/WDPA_Jul2025_Public_shp.zip
126+
wdpa,2025-07,archive,latest supported,2025-12-02,"We are legally not allowed to redistribute this dataset, luckily the web archive is keeping copies of it.",https://web.archive.org/web/20250715071823if_/https%3A//d1gam3xoknrgr2.cloudfront.net/current/WDPA_Jul2025_Public_shp.zip
127127
wdpa_marine,unknown,primary,latest supported,2025-12-02,"WDPA maritime changes its URL every month, the URL here is used as a template and {bYYYY} is replaced inside the retrieve.smk.",https://d1gam3xoknrgr2.cloudfront.net/current/WDPA_WDOECM_{bYYYY}_Public_marine_shp.zip
128-
wdpa_marine,2025-07,archive,latest supported,2025-12-02,"We are legally not allowed to redistribute this dataset, luckily the web archive is keeping copies of it.",https://web.archive.org/web/20250715084308if_/https://d1gam3xoknrgr2.cloudfront.net/current/WDPA_WDOECM_Jul2025_Public_marine_shp.zip
128+
wdpa_marine,2025-07,archive,latest supported,2025-12-02,"We are legally not allowed to redistribute this dataset, luckily the web archive is keeping copies of it.",https://web.archive.org/web/20250715084308if_/https%3A//d1gam3xoknrgr2.cloudfront.net/current/WDPA_WDOECM_Jul2025_Public_marine_shp.zip
129129
worldbank_urban_population,unknown,primary,latest might-work,2025-12-02,"This is the original World Bank API link, which is sometimes updated; it is not guaranteed to work with the current codebase and data changes without notice.",https://api.worldbank.org/v2/en/indicator/SP.URB.TOTL.IN.ZS?downloadformat=csv
130130
worldbank_urban_population,2025-08-14,archive,latest supported,2026-01-13,,https://data.pypsa.org/workflows/eur/worldbank_urban_population/2025-08-14/API_SP.URB.TOTL.IN.ZS_DS2_en_csv_v2_22447.zip

doc/release_notes.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,8 @@ Upcoming Release
170170

171171
* Misc: Automatically update the DAGs shown in the documentation (https://github.com/PyPSA/pypsa-eur/pull/1880).
172172

173+
* Fix the WDPA links to function on Windows (https://github.com/PyPSA/pypsa-eur/pull/2008).
174+
173175
* Fix: An issue with the download and extraction of WDPA and WDPA Marine data (https://github.com/PyPSA/pypsa-eur/issues/2005).
174176

175177
PyPSA-Eur v2025.07.0 (11th July 2025)

test/test_data_versions_layer.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,14 @@ def sort_versions(df: pd.DataFrame) -> pd.DataFrame:
8080
default=date.today().isoformat(),
8181
),
8282
"note": Column(str, nullable=True),
83-
"url": Column(str, nullable=True),
83+
"url": Column(
84+
str,
85+
Check.str_matches(
86+
r'^(https?://[^:\s<>"|*]*)?$',
87+
error='URL must start with http(s):// and not contain colons (use %3A), spaces, or Windows-invalid characters (<>"|*).',
88+
),
89+
nullable=True,
90+
),
8491
},
8592
checks=[
8693
is_sorted,

0 commit comments

Comments
 (0)