Skip to content
This repository was archived by the owner on Jun 2, 2025. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions ocf_datapipes/utils/eso.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
import logging
import os
from typing import Union
from urllib.request import urlopen

import geopandas as gpd
import pandas as pd
import requests

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

with urlopen(url) as response:
shape_gpd = gpd.read_file(response)
with requests.get(url) as response:
shape_gpd = gpd.read_file(response.text)

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