Skip to content
This repository was archived by the owner on Sep 11, 2023. It is now read-only.

Commit 8293caf

Browse files
Merge pull request #405 from openclimatefix/bug/400-pandas-loc
add .copy and warnings go away
2 parents 8e85735 + cadded1 commit 8293caf

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

nowcasting_dataset/data_sources/gsp/eso.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ def get_gsp_shape_from_eso(
158158
if join_duplicates:
159159
logger.debug("Removing duplicates by joining geometry together")
160160

161-
shape_gpd_no_duplicates = shape_gpd.drop_duplicates(subset=["RegionID"])
161+
shape_gpd_no_duplicates = shape_gpd.drop_duplicates(subset=["RegionID"]).copy()
162162
duplicated_raw = shape_gpd[shape_gpd["RegionID"].duplicated()]
163163

164164
for _, duplicate in duplicated_raw.iterrows():
@@ -171,7 +171,6 @@ def get_gsp_shape_from_eso(
171171
new_geometry = shape_gpd_no_duplicates.loc[index_other, "geometry"].union(
172172
duplicate.geometry
173173
)
174-
175174
# set new geometry
176175
shape_gpd_no_duplicates.loc[index_other, "geometry"] = new_geometry
177176

tests/data_sources/test_pv_data_source.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ def test_get_example_and_batch(): # noqa: D103
3131
meters_per_pixel=2000,
3232
filename=PV_DATA_FILENAME,
3333
metadata_filename=PV_METADATA_FILENAME,
34-
start_dt=datetime.fromisoformat("2019-01-01 00:00:00.000+00:00"),
35-
end_dt=datetime.fromisoformat("2019-01-02 00:00:00.000+00:00"),
34+
start_dt=datetime.fromisoformat("2019-01-01 00:00:00.000"),
35+
end_dt=datetime.fromisoformat("2019-01-02 00:00:00.000"),
3636
load_azimuth_and_elevation=False,
3737
load_from_gcs=False,
3838
)

0 commit comments

Comments
 (0)