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

Commit f35d2f2

Browse files
committed
Fix issue with renaming Xarray attribute
1 parent ba40d94 commit f35d2f2

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

ocf_datapipes/load/gsp.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,15 +78,14 @@ def __iter__(self) -> xr.DataArray:
7878

7979
# Ensure the centroids have the same GSP ID index as the GSP PV power:
8080
gsp_id_to_shape = gsp_id_to_shape.loc[gsp_pv_power_mw_ds.gsp_id]
81-
8281
data_array = _put_gsp_data_into_an_xr_dataarray(
8382
gsp_pv_power_mw=gsp_pv_power_mw_ds.generation_mw.data.astype(np.float32),
8483
time_utc=gsp_pv_power_mw_ds.datetime_gmt.data,
8584
gsp_id=gsp_pv_power_mw_ds.gsp_id.data,
8685
# TODO: Try using `gsp_id_to_shape.geometry.envelope.centroid`. See issue #76.
8786
x_osgb=gsp_id_to_shape.geometry.centroid.x.astype(np.float32),
8887
y_osgb=gsp_id_to_shape.geometry.centroid.y.astype(np.float32),
89-
capacity_megawatt_power=gsp_pv_power_mw_ds.installedcapacity_megawatt_power.data.astype(np.float32),
88+
capacity_megawatt_power=gsp_pv_power_mw_ds.installedcapacity_mwp.data.astype(np.float32),
9089
)
9190

9291
del gsp_id_to_shape, gsp_pv_power_mw_ds

tests/data/gsp/test.zarr/.zmetadata

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@
8484
"gsp_id"
8585
]
8686
},
87-
"installedcapacity_megawatt_power/.zarray": {
87+
"installedcapacity_mwp/.zarray": {
8888
"chunks": [
8989
49,
9090
22
@@ -106,7 +106,7 @@
106106
],
107107
"zarr_format": 2
108108
},
109-
"installedcapacity_megawatt_power/.zattrs": {
109+
"installedcapacity_mwp/.zattrs": {
110110
"_ARRAY_DIMENSIONS": [
111111
"datetime_gmt",
112112
"gsp_id"

0 commit comments

Comments
 (0)