ocf-data-sampler 0.5.10__py3-none-any.whl → 0.5.12__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of ocf-data-sampler might be problematic. Click here for more details.
- ocf_data_sampler/load/gsp.py +0 -2
- ocf_data_sampler/numpy_sample/gsp.py +1 -3
- ocf_data_sampler/utils.py +8 -5
- {ocf_data_sampler-0.5.10.dist-info → ocf_data_sampler-0.5.12.dist-info}/METADATA +1 -1
- {ocf_data_sampler-0.5.10.dist-info → ocf_data_sampler-0.5.12.dist-info}/RECORD +7 -7
- {ocf_data_sampler-0.5.10.dist-info → ocf_data_sampler-0.5.12.dist-info}/WHEEL +0 -0
- {ocf_data_sampler-0.5.10.dist-info → ocf_data_sampler-0.5.12.dist-info}/top_level.txt +0 -0
ocf_data_sampler/load/gsp.py
CHANGED
|
@@ -71,7 +71,6 @@ def open_gsp(
|
|
|
71
71
|
ds = ds.assign_coords(
|
|
72
72
|
x_osgb=(df_gsp_loc.x_osgb.to_xarray()),
|
|
73
73
|
y_osgb=(df_gsp_loc.y_osgb.to_xarray()),
|
|
74
|
-
nominal_capacity_mwp=ds.installedcapacity_mwp,
|
|
75
74
|
effective_capacity_mwp=ds.capacity_mwp,
|
|
76
75
|
)
|
|
77
76
|
|
|
@@ -84,7 +83,6 @@ def open_gsp(
|
|
|
84
83
|
coord_dtypes = {
|
|
85
84
|
"time_utc": np.datetime64,
|
|
86
85
|
"gsp_id": np.integer,
|
|
87
|
-
"nominal_capacity_mwp": np.floating,
|
|
88
86
|
"effective_capacity_mwp": np.floating,
|
|
89
87
|
"x_osgb": np.floating,
|
|
90
88
|
"y_osgb": np.floating,
|
|
@@ -9,7 +9,6 @@ class GSPSampleKey:
|
|
|
9
9
|
"""Keys for the GSP sample dictionary."""
|
|
10
10
|
|
|
11
11
|
gsp = "gsp"
|
|
12
|
-
nominal_capacity_mwp = "gsp_nominal_capacity_mwp"
|
|
13
12
|
effective_capacity_mwp = "gsp_effective_capacity_mwp"
|
|
14
13
|
time_utc = "gsp_time_utc"
|
|
15
14
|
t0_idx = "gsp_t0_idx"
|
|
@@ -27,8 +26,7 @@ def convert_gsp_to_numpy_sample(da: xr.DataArray, t0_idx: int | None = None) ->
|
|
|
27
26
|
"""
|
|
28
27
|
sample = {
|
|
29
28
|
GSPSampleKey.gsp: da.values,
|
|
30
|
-
GSPSampleKey.
|
|
31
|
-
GSPSampleKey.effective_capacity_mwp: da.isel(time_utc=0)["effective_capacity_mwp"].values,
|
|
29
|
+
GSPSampleKey.effective_capacity_mwp: da.effective_capacity_mwp.values[0],
|
|
32
30
|
GSPSampleKey.time_utc: da["time_utc"].values.astype(float),
|
|
33
31
|
}
|
|
34
32
|
|
ocf_data_sampler/utils.py
CHANGED
|
@@ -23,15 +23,18 @@ def compute(xarray_dict: dict) -> dict:
|
|
|
23
23
|
return xarray_dict
|
|
24
24
|
|
|
25
25
|
|
|
26
|
-
def
|
|
27
|
-
"""
|
|
26
|
+
def tensorstore_read(xarray_dict: dict) -> dict:
|
|
27
|
+
"""Start reading a nested dictionary of xarray-tensorstore DataArrays."""
|
|
28
28
|
# Kick off the tensorstore async reading
|
|
29
29
|
for k, v in xarray_dict.items():
|
|
30
30
|
if isinstance(v, dict):
|
|
31
|
-
xarray_dict[k] =
|
|
31
|
+
xarray_dict[k] = tensorstore_read(v)
|
|
32
32
|
else:
|
|
33
33
|
xarray_dict[k] = read(v)
|
|
34
|
+
return xarray_dict
|
|
34
35
|
|
|
35
|
-
|
|
36
|
-
|
|
36
|
+
|
|
37
|
+
def tensorstore_compute(xarray_dict: dict) -> dict:
|
|
38
|
+
"""Eagerly read and load a nested dictionary of xarray-tensorstore DataArrays."""
|
|
39
|
+
return compute(tensorstore_read(xarray_dict))
|
|
37
40
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
ocf_data_sampler/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
|
2
|
-
ocf_data_sampler/utils.py,sha256=
|
|
2
|
+
ocf_data_sampler/utils.py,sha256=CTJf9bjHjO8vOJebUtXiMpvgwUpF7gEOjjaoE77fhTk,1177
|
|
3
3
|
ocf_data_sampler/config/__init__.py,sha256=O29mbH0XG2gIY1g3BaveGCnpBO2SFqdu-qzJ7a6evl0,223
|
|
4
4
|
ocf_data_sampler/config/load.py,sha256=LL-7wemI8o4KPkx35j-wQ3HjsMvDgqXr7G46IcASfnU,632
|
|
5
5
|
ocf_data_sampler/config/model.py,sha256=Jss8UDJAaQIBDr9megX2pERoT0ocFmwLNFC8pCWN6VA,12386
|
|
@@ -7,7 +7,7 @@ ocf_data_sampler/config/save.py,sha256=m8SPw5rXjkMm1rByjh3pK5StdBi4e8ysnn3jQopdR
|
|
|
7
7
|
ocf_data_sampler/data/uk_gsp_locations_20220314.csv,sha256=RSh7DRh55E3n8lVAaWXGTaXXHevZZtI58td4d4DhGos,10415772
|
|
8
8
|
ocf_data_sampler/data/uk_gsp_locations_20250109.csv,sha256=XZISFatnbpO9j8LwaxNKFzQSjs6hcHFsV8a9uDDpy2E,9055334
|
|
9
9
|
ocf_data_sampler/load/__init__.py,sha256=-vQP9g0UOWdVbjEGyVX_ipa7R1btmiETIKAf6aw4d78,201
|
|
10
|
-
ocf_data_sampler/load/gsp.py,sha256=
|
|
10
|
+
ocf_data_sampler/load/gsp.py,sha256=C-r5IidXFq1-zw_KkMjuXczjJ-5t3k4UyjXk6BjQNoU,2881
|
|
11
11
|
ocf_data_sampler/load/load_dataset.py,sha256=K8rWykjII-3g127If7WRRFivzHNx3SshCvZj4uQlf28,2089
|
|
12
12
|
ocf_data_sampler/load/open_xarray_tensorstore.py,sha256=kAqlIavGe1dcCPkzAtoZo2dFS-tW36E-wRE_3w1HMfg,5620
|
|
13
13
|
ocf_data_sampler/load/satellite.py,sha256=B-m0_Py_D0GwzwX5o-ixyeXntV5Z4k4MbmMBHZLUWMM,1831
|
|
@@ -26,7 +26,7 @@ ocf_data_sampler/numpy_sample/__init__.py,sha256=5bdpzM8hMAEe0XRSZ9AZFQdqEeBsEPh
|
|
|
26
26
|
ocf_data_sampler/numpy_sample/collate.py,sha256=hoxIc5SoHoIs3Nx37aRZzWChpswjy9lHUgaKgHIoo80,2039
|
|
27
27
|
ocf_data_sampler/numpy_sample/common_types.py,sha256=9CjYHkUTx0ObduWh43fhsybZCTXvexql7qC2ptMDoek,377
|
|
28
28
|
ocf_data_sampler/numpy_sample/datetime_features.py,sha256=ObHM42VnZB7_daQ5a42GeftoDWYtVMT-wDP8kRtY_84,857
|
|
29
|
-
ocf_data_sampler/numpy_sample/gsp.py,sha256=
|
|
29
|
+
ocf_data_sampler/numpy_sample/gsp.py,sha256=sOWX1ubeQSrK6_0vdy_RKVUvqzohOc5pBu7W4Co7iN8,983
|
|
30
30
|
ocf_data_sampler/numpy_sample/nwp.py,sha256=lXqE2Il0xX5hzz76HHkiYmfDsXWWhmaA_6bSnmwbAXU,1078
|
|
31
31
|
ocf_data_sampler/numpy_sample/satellite.py,sha256=RaYzYIcB1AmDrKeiqSpn4QVfBH-QMe26F1P5t1az2Jg,1111
|
|
32
32
|
ocf_data_sampler/numpy_sample/site.py,sha256=4S19bzCN5lswVUrmWRfwpVsBPUE7bi0OIdxsD9wgvhU,982
|
|
@@ -56,7 +56,7 @@ ocf_data_sampler/torch_datasets/utils/valid_time_periods.py,sha256=xcy75cVxl0Wrg
|
|
|
56
56
|
ocf_data_sampler/torch_datasets/utils/validation_utils.py,sha256=YqmT-lExWlI8_ul3l0EP73Ik002fStr_bhsZh9mQqEU,4735
|
|
57
57
|
scripts/download_gsp_location_data.py,sha256=rRDXMoqX-RYY4jPdxhdlxJGhWdl6r245F5UARgKV6P4,3121
|
|
58
58
|
scripts/refactor_site.py,sha256=skzvsPP0Cn9yTKndzkilyNcGz4DZ88ctvCJ0XrBdc2A,3135
|
|
59
|
-
ocf_data_sampler-0.5.
|
|
60
|
-
ocf_data_sampler-0.5.
|
|
61
|
-
ocf_data_sampler-0.5.
|
|
62
|
-
ocf_data_sampler-0.5.
|
|
59
|
+
ocf_data_sampler-0.5.12.dist-info/METADATA,sha256=2s4Pf9ZEgBo72guZFO6JI3mwJzOGRxLmkmeihiQ8Ogw,12817
|
|
60
|
+
ocf_data_sampler-0.5.12.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
61
|
+
ocf_data_sampler-0.5.12.dist-info/top_level.txt,sha256=deUxqmsONNAGZDNbsntbXH7BRA1MqWaUeAJrCo6q_xA,25
|
|
62
|
+
ocf_data_sampler-0.5.12.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|