Skip to content
This repository was archived by the owner on Jun 2, 2025. It is now read-only.

Commit f1c00df

Browse files
Merge pull request #58 from openclimatefix/issue/requests
change urllib to requests
2 parents 2a41e35 + 0d99621 commit f1c00df

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

ocf_datapipes/utils/eso.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@
1616
import logging
1717
import os
1818
from typing import Union
19-
from urllib.request import urlopen
2019

2120
import geopandas as gpd
2221
import pandas as pd
22+
import requests
2323

2424
from ocf_datapipes.utils.geospatial import osgb_to_lat_lon
2525
from ocf_datapipes.utils.pvlive import get_list_of_gsp_ids
@@ -126,8 +126,8 @@ def get_gsp_shape_from_eso(
126126
"resource/08534dae-5408-4e31-8639-b579c8f1c50b/download/gsp_regions_20220314.geojson"
127127
)
128128

129-
with urlopen(url) as response:
130-
shape_gpd = gpd.read_file(response)
129+
with requests.get(url) as response:
130+
shape_gpd = gpd.read_file(response.text)
131131

132132
# calculate the centroid before using - to_crs
133133
shape_gpd["centroid_x"] = shape_gpd["geometry"].centroid.x

0 commit comments

Comments
 (0)