ocf-data-sampler 0.5.6__tar.gz → 0.5.8__tar.gz
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-0.5.6 → ocf_data_sampler-0.5.8}/PKG-INFO +1 -1
- {ocf_data_sampler-0.5.6 → ocf_data_sampler-0.5.8}/ocf_data_sampler/load/open_xarray_tensorstore.py +1 -1
- {ocf_data_sampler-0.5.6 → ocf_data_sampler-0.5.8}/ocf_data_sampler/torch_datasets/datasets/pvnet_uk.py +3 -3
- {ocf_data_sampler-0.5.6 → ocf_data_sampler-0.5.8}/ocf_data_sampler/torch_datasets/datasets/site.py +3 -3
- ocf_data_sampler-0.5.8/ocf_data_sampler/utils.py +37 -0
- {ocf_data_sampler-0.5.6 → ocf_data_sampler-0.5.8}/ocf_data_sampler.egg-info/PKG-INFO +1 -1
- ocf_data_sampler-0.5.6/ocf_data_sampler/utils.py +0 -21
- {ocf_data_sampler-0.5.6 → ocf_data_sampler-0.5.8}/LICENSE +0 -0
- {ocf_data_sampler-0.5.6 → ocf_data_sampler-0.5.8}/README.md +0 -0
- {ocf_data_sampler-0.5.6 → ocf_data_sampler-0.5.8}/ocf_data_sampler/__init__.py +0 -0
- {ocf_data_sampler-0.5.6 → ocf_data_sampler-0.5.8}/ocf_data_sampler/config/__init__.py +0 -0
- {ocf_data_sampler-0.5.6 → ocf_data_sampler-0.5.8}/ocf_data_sampler/config/load.py +0 -0
- {ocf_data_sampler-0.5.6 → ocf_data_sampler-0.5.8}/ocf_data_sampler/config/model.py +0 -0
- {ocf_data_sampler-0.5.6 → ocf_data_sampler-0.5.8}/ocf_data_sampler/config/save.py +0 -0
- {ocf_data_sampler-0.5.6 → ocf_data_sampler-0.5.8}/ocf_data_sampler/data/uk_gsp_locations_20220314.csv +0 -0
- {ocf_data_sampler-0.5.6 → ocf_data_sampler-0.5.8}/ocf_data_sampler/data/uk_gsp_locations_20250109.csv +0 -0
- {ocf_data_sampler-0.5.6 → ocf_data_sampler-0.5.8}/ocf_data_sampler/load/__init__.py +0 -0
- {ocf_data_sampler-0.5.6 → ocf_data_sampler-0.5.8}/ocf_data_sampler/load/gsp.py +0 -0
- {ocf_data_sampler-0.5.6 → ocf_data_sampler-0.5.8}/ocf_data_sampler/load/load_dataset.py +0 -0
- {ocf_data_sampler-0.5.6 → ocf_data_sampler-0.5.8}/ocf_data_sampler/load/nwp/__init__.py +0 -0
- {ocf_data_sampler-0.5.6 → ocf_data_sampler-0.5.8}/ocf_data_sampler/load/nwp/nwp.py +0 -0
- {ocf_data_sampler-0.5.6 → ocf_data_sampler-0.5.8}/ocf_data_sampler/load/nwp/providers/__init__.py +0 -0
- {ocf_data_sampler-0.5.6 → ocf_data_sampler-0.5.8}/ocf_data_sampler/load/nwp/providers/cloudcasting.py +0 -0
- {ocf_data_sampler-0.5.6 → ocf_data_sampler-0.5.8}/ocf_data_sampler/load/nwp/providers/ecmwf.py +0 -0
- {ocf_data_sampler-0.5.6 → ocf_data_sampler-0.5.8}/ocf_data_sampler/load/nwp/providers/gfs.py +0 -0
- {ocf_data_sampler-0.5.6 → ocf_data_sampler-0.5.8}/ocf_data_sampler/load/nwp/providers/icon.py +0 -0
- {ocf_data_sampler-0.5.6 → ocf_data_sampler-0.5.8}/ocf_data_sampler/load/nwp/providers/ukv.py +0 -0
- {ocf_data_sampler-0.5.6 → ocf_data_sampler-0.5.8}/ocf_data_sampler/load/nwp/providers/utils.py +0 -0
- {ocf_data_sampler-0.5.6 → ocf_data_sampler-0.5.8}/ocf_data_sampler/load/satellite.py +0 -0
- {ocf_data_sampler-0.5.6 → ocf_data_sampler-0.5.8}/ocf_data_sampler/load/site.py +0 -0
- {ocf_data_sampler-0.5.6 → ocf_data_sampler-0.5.8}/ocf_data_sampler/load/utils.py +0 -0
- {ocf_data_sampler-0.5.6 → ocf_data_sampler-0.5.8}/ocf_data_sampler/numpy_sample/__init__.py +0 -0
- {ocf_data_sampler-0.5.6 → ocf_data_sampler-0.5.8}/ocf_data_sampler/numpy_sample/collate.py +0 -0
- {ocf_data_sampler-0.5.6 → ocf_data_sampler-0.5.8}/ocf_data_sampler/numpy_sample/common_types.py +0 -0
- {ocf_data_sampler-0.5.6 → ocf_data_sampler-0.5.8}/ocf_data_sampler/numpy_sample/datetime_features.py +0 -0
- {ocf_data_sampler-0.5.6 → ocf_data_sampler-0.5.8}/ocf_data_sampler/numpy_sample/gsp.py +0 -0
- {ocf_data_sampler-0.5.6 → ocf_data_sampler-0.5.8}/ocf_data_sampler/numpy_sample/nwp.py +0 -0
- {ocf_data_sampler-0.5.6 → ocf_data_sampler-0.5.8}/ocf_data_sampler/numpy_sample/satellite.py +0 -0
- {ocf_data_sampler-0.5.6 → ocf_data_sampler-0.5.8}/ocf_data_sampler/numpy_sample/site.py +0 -0
- {ocf_data_sampler-0.5.6 → ocf_data_sampler-0.5.8}/ocf_data_sampler/numpy_sample/sun_position.py +0 -0
- {ocf_data_sampler-0.5.6 → ocf_data_sampler-0.5.8}/ocf_data_sampler/select/__init__.py +0 -0
- {ocf_data_sampler-0.5.6 → ocf_data_sampler-0.5.8}/ocf_data_sampler/select/dropout.py +0 -0
- {ocf_data_sampler-0.5.6 → ocf_data_sampler-0.5.8}/ocf_data_sampler/select/fill_time_periods.py +0 -0
- {ocf_data_sampler-0.5.6 → ocf_data_sampler-0.5.8}/ocf_data_sampler/select/find_contiguous_time_periods.py +0 -0
- {ocf_data_sampler-0.5.6 → ocf_data_sampler-0.5.8}/ocf_data_sampler/select/geospatial.py +0 -0
- {ocf_data_sampler-0.5.6 → ocf_data_sampler-0.5.8}/ocf_data_sampler/select/location.py +0 -0
- {ocf_data_sampler-0.5.6 → ocf_data_sampler-0.5.8}/ocf_data_sampler/select/select_spatial_slice.py +0 -0
- {ocf_data_sampler-0.5.6 → ocf_data_sampler-0.5.8}/ocf_data_sampler/select/select_time_slice.py +0 -0
- {ocf_data_sampler-0.5.6 → ocf_data_sampler-0.5.8}/ocf_data_sampler/torch_datasets/datasets/__init__.py +0 -0
- {ocf_data_sampler-0.5.6 → ocf_data_sampler-0.5.8}/ocf_data_sampler/torch_datasets/sample/__init__.py +0 -0
- {ocf_data_sampler-0.5.6 → ocf_data_sampler-0.5.8}/ocf_data_sampler/torch_datasets/sample/base.py +0 -0
- {ocf_data_sampler-0.5.6 → ocf_data_sampler-0.5.8}/ocf_data_sampler/torch_datasets/sample/site.py +0 -0
- {ocf_data_sampler-0.5.6 → ocf_data_sampler-0.5.8}/ocf_data_sampler/torch_datasets/sample/uk_regional.py +0 -0
- {ocf_data_sampler-0.5.6 → ocf_data_sampler-0.5.8}/ocf_data_sampler/torch_datasets/utils/__init__.py +0 -0
- {ocf_data_sampler-0.5.6 → ocf_data_sampler-0.5.8}/ocf_data_sampler/torch_datasets/utils/config_normalization_values_to_dicts.py +0 -0
- {ocf_data_sampler-0.5.6 → ocf_data_sampler-0.5.8}/ocf_data_sampler/torch_datasets/utils/merge_and_fill_utils.py +0 -0
- {ocf_data_sampler-0.5.6 → ocf_data_sampler-0.5.8}/ocf_data_sampler/torch_datasets/utils/spatial_slice_for_dataset.py +0 -0
- {ocf_data_sampler-0.5.6 → ocf_data_sampler-0.5.8}/ocf_data_sampler/torch_datasets/utils/time_slice_for_dataset.py +0 -0
- {ocf_data_sampler-0.5.6 → ocf_data_sampler-0.5.8}/ocf_data_sampler/torch_datasets/utils/valid_time_periods.py +0 -0
- {ocf_data_sampler-0.5.6 → ocf_data_sampler-0.5.8}/ocf_data_sampler/torch_datasets/utils/validation_utils.py +0 -0
- {ocf_data_sampler-0.5.6 → ocf_data_sampler-0.5.8}/ocf_data_sampler.egg-info/SOURCES.txt +0 -0
- {ocf_data_sampler-0.5.6 → ocf_data_sampler-0.5.8}/ocf_data_sampler.egg-info/dependency_links.txt +0 -0
- {ocf_data_sampler-0.5.6 → ocf_data_sampler-0.5.8}/ocf_data_sampler.egg-info/requires.txt +0 -0
- {ocf_data_sampler-0.5.6 → ocf_data_sampler-0.5.8}/ocf_data_sampler.egg-info/top_level.txt +0 -0
- {ocf_data_sampler-0.5.6 → ocf_data_sampler-0.5.8}/pyproject.toml +0 -0
- {ocf_data_sampler-0.5.6 → ocf_data_sampler-0.5.8}/scripts/download_gsp_location_data.py +0 -0
- {ocf_data_sampler-0.5.6 → ocf_data_sampler-0.5.8}/scripts/refactor_site.py +0 -0
- {ocf_data_sampler-0.5.6 → ocf_data_sampler-0.5.8}/setup.cfg +0 -0
- {ocf_data_sampler-0.5.6 → ocf_data_sampler-0.5.8}/utils/compute_icon_mean_stddev.py +0 -0
|
@@ -30,7 +30,7 @@ from ocf_data_sampler.torch_datasets.utils.merge_and_fill_utils import (
|
|
|
30
30
|
fill_nans_in_arrays,
|
|
31
31
|
merge_dicts,
|
|
32
32
|
)
|
|
33
|
-
from ocf_data_sampler.utils import
|
|
33
|
+
from ocf_data_sampler.utils import minutes, tensorstore_compute
|
|
34
34
|
|
|
35
35
|
xr.set_options(keep_attrs=True)
|
|
36
36
|
|
|
@@ -254,7 +254,7 @@ class PVNetUKRegionalDataset(AbstractPVNetUKDataset):
|
|
|
254
254
|
"""
|
|
255
255
|
sample_dict = slice_datasets_by_space(self.datasets_dict, location, self.config)
|
|
256
256
|
sample_dict = slice_datasets_by_time(sample_dict, t0, self.config)
|
|
257
|
-
sample_dict =
|
|
257
|
+
sample_dict = tensorstore_compute(sample_dict)
|
|
258
258
|
|
|
259
259
|
return self.process_and_combine_datasets(sample_dict, t0, location)
|
|
260
260
|
|
|
@@ -313,7 +313,7 @@ class PVNetUKConcurrentDataset(AbstractPVNetUKDataset):
|
|
|
313
313
|
"""
|
|
314
314
|
# Slice by time then load to avoid loading the data multiple times from disk
|
|
315
315
|
sample_dict = slice_datasets_by_time(self.datasets_dict, t0, self.config)
|
|
316
|
-
sample_dict =
|
|
316
|
+
sample_dict = tensorstore_compute(sample_dict)
|
|
317
317
|
|
|
318
318
|
gsp_samples = []
|
|
319
319
|
|
{ocf_data_sampler-0.5.6 → ocf_data_sampler-0.5.8}/ocf_data_sampler/torch_datasets/datasets/site.py
RENAMED
|
@@ -34,7 +34,7 @@ from ocf_data_sampler.torch_datasets.utils.merge_and_fill_utils import (
|
|
|
34
34
|
fill_nans_in_arrays,
|
|
35
35
|
merge_dicts,
|
|
36
36
|
)
|
|
37
|
-
from ocf_data_sampler.utils import
|
|
37
|
+
from ocf_data_sampler.utils import minutes, tensorstore_compute
|
|
38
38
|
|
|
39
39
|
xr.set_options(keep_attrs=True)
|
|
40
40
|
|
|
@@ -272,7 +272,7 @@ class SitesDataset(Dataset):
|
|
|
272
272
|
sample_dict = slice_datasets_by_space(self.datasets_dict, location, self.config)
|
|
273
273
|
sample_dict = slice_datasets_by_time(sample_dict, t0, self.config)
|
|
274
274
|
|
|
275
|
-
sample_dict =
|
|
275
|
+
sample_dict = tensorstore_compute(sample_dict)
|
|
276
276
|
|
|
277
277
|
return process_and_combine_datasets(
|
|
278
278
|
sample_dict,
|
|
@@ -408,7 +408,7 @@ class SitesDatasetConcurrent(Dataset):
|
|
|
408
408
|
"""
|
|
409
409
|
# slice by time first as we want to keep all site id info
|
|
410
410
|
sample_dict = slice_datasets_by_time(self.datasets_dict, t0, self.config)
|
|
411
|
-
sample_dict =
|
|
411
|
+
sample_dict = tensorstore_compute(sample_dict)
|
|
412
412
|
|
|
413
413
|
site_samples = []
|
|
414
414
|
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"""Miscellaneous helper functions."""
|
|
2
|
+
|
|
3
|
+
import pandas as pd
|
|
4
|
+
from xarray_tensorstore import read
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
def minutes(minutes: int | list[float]) -> pd.Timedelta | pd.TimedeltaIndex:
|
|
8
|
+
"""Timedelta minutes.
|
|
9
|
+
|
|
10
|
+
Args:
|
|
11
|
+
minutes: the number of minutes, single value or list
|
|
12
|
+
"""
|
|
13
|
+
return pd.to_timedelta(minutes, unit="m")
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
def compute(xarray_dict: dict) -> dict:
|
|
17
|
+
"""Eagerly load a nested dictionary of xarray DataArrays."""
|
|
18
|
+
for k, v in xarray_dict.items():
|
|
19
|
+
if isinstance(v, dict):
|
|
20
|
+
xarray_dict[k] = compute(v)
|
|
21
|
+
else:
|
|
22
|
+
xarray_dict[k] = v.compute()
|
|
23
|
+
return xarray_dict
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
def tensorstore_compute(xarray_dict: dict) -> dict:
|
|
27
|
+
"""Eagerly read and load a nested dictionary of xarray-tensorstore DataArrays."""
|
|
28
|
+
# Kick off the tensorstore async reading
|
|
29
|
+
for k, v in xarray_dict.items():
|
|
30
|
+
if isinstance(v, dict):
|
|
31
|
+
xarray_dict[k] = tensorstore_compute(v)
|
|
32
|
+
else:
|
|
33
|
+
xarray_dict[k] = read(v)
|
|
34
|
+
|
|
35
|
+
# Running the compute function will wait until all arrays have been read
|
|
36
|
+
return compute(xarray_dict)
|
|
37
|
+
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"""Miscellaneous helper functions."""
|
|
2
|
-
|
|
3
|
-
import pandas as pd
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
def minutes(minutes: int | list[float]) -> pd.Timedelta | pd.TimedeltaIndex:
|
|
7
|
-
"""Timedelta minutes.
|
|
8
|
-
|
|
9
|
-
Args:
|
|
10
|
-
minutes: the number of minutes, single value or list
|
|
11
|
-
"""
|
|
12
|
-
return pd.to_timedelta(minutes, unit="m")
|
|
13
|
-
|
|
14
|
-
def compute(xarray_dict: dict) -> dict:
|
|
15
|
-
"""Eagerly load a nested dictionary of xarray DataArrays."""
|
|
16
|
-
for k, v in xarray_dict.items():
|
|
17
|
-
if isinstance(v, dict):
|
|
18
|
-
xarray_dict[k] = compute(v)
|
|
19
|
-
else:
|
|
20
|
-
xarray_dict[k] = v.compute(scheduler="single-threaded")
|
|
21
|
-
return xarray_dict
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{ocf_data_sampler-0.5.6 → ocf_data_sampler-0.5.8}/ocf_data_sampler/load/nwp/providers/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{ocf_data_sampler-0.5.6 → ocf_data_sampler-0.5.8}/ocf_data_sampler/load/nwp/providers/ecmwf.py
RENAMED
|
File without changes
|
{ocf_data_sampler-0.5.6 → ocf_data_sampler-0.5.8}/ocf_data_sampler/load/nwp/providers/gfs.py
RENAMED
|
File without changes
|
{ocf_data_sampler-0.5.6 → ocf_data_sampler-0.5.8}/ocf_data_sampler/load/nwp/providers/icon.py
RENAMED
|
File without changes
|
{ocf_data_sampler-0.5.6 → ocf_data_sampler-0.5.8}/ocf_data_sampler/load/nwp/providers/ukv.py
RENAMED
|
File without changes
|
{ocf_data_sampler-0.5.6 → ocf_data_sampler-0.5.8}/ocf_data_sampler/load/nwp/providers/utils.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{ocf_data_sampler-0.5.6 → ocf_data_sampler-0.5.8}/ocf_data_sampler/numpy_sample/common_types.py
RENAMED
|
File without changes
|
{ocf_data_sampler-0.5.6 → ocf_data_sampler-0.5.8}/ocf_data_sampler/numpy_sample/datetime_features.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{ocf_data_sampler-0.5.6 → ocf_data_sampler-0.5.8}/ocf_data_sampler/numpy_sample/satellite.py
RENAMED
|
File without changes
|
|
File without changes
|
{ocf_data_sampler-0.5.6 → ocf_data_sampler-0.5.8}/ocf_data_sampler/numpy_sample/sun_position.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{ocf_data_sampler-0.5.6 → ocf_data_sampler-0.5.8}/ocf_data_sampler/select/fill_time_periods.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{ocf_data_sampler-0.5.6 → ocf_data_sampler-0.5.8}/ocf_data_sampler/select/select_spatial_slice.py
RENAMED
|
File without changes
|
{ocf_data_sampler-0.5.6 → ocf_data_sampler-0.5.8}/ocf_data_sampler/select/select_time_slice.py
RENAMED
|
File without changes
|
|
File without changes
|
{ocf_data_sampler-0.5.6 → ocf_data_sampler-0.5.8}/ocf_data_sampler/torch_datasets/sample/__init__.py
RENAMED
|
File without changes
|
{ocf_data_sampler-0.5.6 → ocf_data_sampler-0.5.8}/ocf_data_sampler/torch_datasets/sample/base.py
RENAMED
|
File without changes
|
{ocf_data_sampler-0.5.6 → ocf_data_sampler-0.5.8}/ocf_data_sampler/torch_datasets/sample/site.py
RENAMED
|
File without changes
|
|
File without changes
|
{ocf_data_sampler-0.5.6 → ocf_data_sampler-0.5.8}/ocf_data_sampler/torch_datasets/utils/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{ocf_data_sampler-0.5.6 → ocf_data_sampler-0.5.8}/ocf_data_sampler.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|