ocf-data-sampler 0.5.11__tar.gz → 0.5.13__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.11 → ocf_data_sampler-0.5.13}/PKG-INFO +1 -1
- {ocf_data_sampler-0.5.11 → ocf_data_sampler-0.5.13}/ocf_data_sampler/select/select_spatial_slice.py +4 -4
- {ocf_data_sampler-0.5.11 → ocf_data_sampler-0.5.13}/ocf_data_sampler/utils.py +8 -5
- {ocf_data_sampler-0.5.11 → ocf_data_sampler-0.5.13}/ocf_data_sampler.egg-info/PKG-INFO +1 -1
- {ocf_data_sampler-0.5.11 → ocf_data_sampler-0.5.13}/LICENSE +0 -0
- {ocf_data_sampler-0.5.11 → ocf_data_sampler-0.5.13}/README.md +0 -0
- {ocf_data_sampler-0.5.11 → ocf_data_sampler-0.5.13}/ocf_data_sampler/__init__.py +0 -0
- {ocf_data_sampler-0.5.11 → ocf_data_sampler-0.5.13}/ocf_data_sampler/config/__init__.py +0 -0
- {ocf_data_sampler-0.5.11 → ocf_data_sampler-0.5.13}/ocf_data_sampler/config/load.py +0 -0
- {ocf_data_sampler-0.5.11 → ocf_data_sampler-0.5.13}/ocf_data_sampler/config/model.py +0 -0
- {ocf_data_sampler-0.5.11 → ocf_data_sampler-0.5.13}/ocf_data_sampler/config/save.py +0 -0
- {ocf_data_sampler-0.5.11 → ocf_data_sampler-0.5.13}/ocf_data_sampler/data/uk_gsp_locations_20220314.csv +0 -0
- {ocf_data_sampler-0.5.11 → ocf_data_sampler-0.5.13}/ocf_data_sampler/data/uk_gsp_locations_20250109.csv +0 -0
- {ocf_data_sampler-0.5.11 → ocf_data_sampler-0.5.13}/ocf_data_sampler/load/__init__.py +0 -0
- {ocf_data_sampler-0.5.11 → ocf_data_sampler-0.5.13}/ocf_data_sampler/load/gsp.py +0 -0
- {ocf_data_sampler-0.5.11 → ocf_data_sampler-0.5.13}/ocf_data_sampler/load/load_dataset.py +0 -0
- {ocf_data_sampler-0.5.11 → ocf_data_sampler-0.5.13}/ocf_data_sampler/load/nwp/__init__.py +0 -0
- {ocf_data_sampler-0.5.11 → ocf_data_sampler-0.5.13}/ocf_data_sampler/load/nwp/nwp.py +0 -0
- {ocf_data_sampler-0.5.11 → ocf_data_sampler-0.5.13}/ocf_data_sampler/load/nwp/providers/__init__.py +0 -0
- {ocf_data_sampler-0.5.11 → ocf_data_sampler-0.5.13}/ocf_data_sampler/load/nwp/providers/cloudcasting.py +0 -0
- {ocf_data_sampler-0.5.11 → ocf_data_sampler-0.5.13}/ocf_data_sampler/load/nwp/providers/ecmwf.py +0 -0
- {ocf_data_sampler-0.5.11 → ocf_data_sampler-0.5.13}/ocf_data_sampler/load/nwp/providers/gfs.py +0 -0
- {ocf_data_sampler-0.5.11 → ocf_data_sampler-0.5.13}/ocf_data_sampler/load/nwp/providers/icon.py +0 -0
- {ocf_data_sampler-0.5.11 → ocf_data_sampler-0.5.13}/ocf_data_sampler/load/nwp/providers/ukv.py +0 -0
- {ocf_data_sampler-0.5.11 → ocf_data_sampler-0.5.13}/ocf_data_sampler/load/nwp/providers/utils.py +0 -0
- {ocf_data_sampler-0.5.11 → ocf_data_sampler-0.5.13}/ocf_data_sampler/load/open_xarray_tensorstore.py +0 -0
- {ocf_data_sampler-0.5.11 → ocf_data_sampler-0.5.13}/ocf_data_sampler/load/satellite.py +0 -0
- {ocf_data_sampler-0.5.11 → ocf_data_sampler-0.5.13}/ocf_data_sampler/load/site.py +0 -0
- {ocf_data_sampler-0.5.11 → ocf_data_sampler-0.5.13}/ocf_data_sampler/load/utils.py +0 -0
- {ocf_data_sampler-0.5.11 → ocf_data_sampler-0.5.13}/ocf_data_sampler/numpy_sample/__init__.py +0 -0
- {ocf_data_sampler-0.5.11 → ocf_data_sampler-0.5.13}/ocf_data_sampler/numpy_sample/collate.py +0 -0
- {ocf_data_sampler-0.5.11 → ocf_data_sampler-0.5.13}/ocf_data_sampler/numpy_sample/common_types.py +0 -0
- {ocf_data_sampler-0.5.11 → ocf_data_sampler-0.5.13}/ocf_data_sampler/numpy_sample/datetime_features.py +0 -0
- {ocf_data_sampler-0.5.11 → ocf_data_sampler-0.5.13}/ocf_data_sampler/numpy_sample/gsp.py +0 -0
- {ocf_data_sampler-0.5.11 → ocf_data_sampler-0.5.13}/ocf_data_sampler/numpy_sample/nwp.py +0 -0
- {ocf_data_sampler-0.5.11 → ocf_data_sampler-0.5.13}/ocf_data_sampler/numpy_sample/satellite.py +0 -0
- {ocf_data_sampler-0.5.11 → ocf_data_sampler-0.5.13}/ocf_data_sampler/numpy_sample/site.py +0 -0
- {ocf_data_sampler-0.5.11 → ocf_data_sampler-0.5.13}/ocf_data_sampler/numpy_sample/sun_position.py +0 -0
- {ocf_data_sampler-0.5.11 → ocf_data_sampler-0.5.13}/ocf_data_sampler/select/__init__.py +0 -0
- {ocf_data_sampler-0.5.11 → ocf_data_sampler-0.5.13}/ocf_data_sampler/select/dropout.py +0 -0
- {ocf_data_sampler-0.5.11 → ocf_data_sampler-0.5.13}/ocf_data_sampler/select/fill_time_periods.py +0 -0
- {ocf_data_sampler-0.5.11 → ocf_data_sampler-0.5.13}/ocf_data_sampler/select/find_contiguous_time_periods.py +0 -0
- {ocf_data_sampler-0.5.11 → ocf_data_sampler-0.5.13}/ocf_data_sampler/select/geospatial.py +0 -0
- {ocf_data_sampler-0.5.11 → ocf_data_sampler-0.5.13}/ocf_data_sampler/select/location.py +0 -0
- {ocf_data_sampler-0.5.11 → ocf_data_sampler-0.5.13}/ocf_data_sampler/select/select_time_slice.py +0 -0
- {ocf_data_sampler-0.5.11 → ocf_data_sampler-0.5.13}/ocf_data_sampler/torch_datasets/datasets/__init__.py +0 -0
- {ocf_data_sampler-0.5.11 → ocf_data_sampler-0.5.13}/ocf_data_sampler/torch_datasets/datasets/pvnet_uk.py +0 -0
- {ocf_data_sampler-0.5.11 → ocf_data_sampler-0.5.13}/ocf_data_sampler/torch_datasets/datasets/site.py +0 -0
- {ocf_data_sampler-0.5.11 → ocf_data_sampler-0.5.13}/ocf_data_sampler/torch_datasets/sample/__init__.py +0 -0
- {ocf_data_sampler-0.5.11 → ocf_data_sampler-0.5.13}/ocf_data_sampler/torch_datasets/sample/base.py +0 -0
- {ocf_data_sampler-0.5.11 → ocf_data_sampler-0.5.13}/ocf_data_sampler/torch_datasets/sample/site.py +0 -0
- {ocf_data_sampler-0.5.11 → ocf_data_sampler-0.5.13}/ocf_data_sampler/torch_datasets/sample/uk_regional.py +0 -0
- {ocf_data_sampler-0.5.11 → ocf_data_sampler-0.5.13}/ocf_data_sampler/torch_datasets/utils/__init__.py +0 -0
- {ocf_data_sampler-0.5.11 → ocf_data_sampler-0.5.13}/ocf_data_sampler/torch_datasets/utils/add_alterate_coordinate_projections.py +0 -0
- {ocf_data_sampler-0.5.11 → ocf_data_sampler-0.5.13}/ocf_data_sampler/torch_datasets/utils/config_normalization_values_to_dicts.py +0 -0
- {ocf_data_sampler-0.5.11 → ocf_data_sampler-0.5.13}/ocf_data_sampler/torch_datasets/utils/merge_and_fill_utils.py +0 -0
- {ocf_data_sampler-0.5.11 → ocf_data_sampler-0.5.13}/ocf_data_sampler/torch_datasets/utils/spatial_slice_for_dataset.py +0 -0
- {ocf_data_sampler-0.5.11 → ocf_data_sampler-0.5.13}/ocf_data_sampler/torch_datasets/utils/time_slice_for_dataset.py +0 -0
- {ocf_data_sampler-0.5.11 → ocf_data_sampler-0.5.13}/ocf_data_sampler/torch_datasets/utils/valid_time_periods.py +0 -0
- {ocf_data_sampler-0.5.11 → ocf_data_sampler-0.5.13}/ocf_data_sampler/torch_datasets/utils/validation_utils.py +0 -0
- {ocf_data_sampler-0.5.11 → ocf_data_sampler-0.5.13}/ocf_data_sampler.egg-info/SOURCES.txt +0 -0
- {ocf_data_sampler-0.5.11 → ocf_data_sampler-0.5.13}/ocf_data_sampler.egg-info/dependency_links.txt +0 -0
- {ocf_data_sampler-0.5.11 → ocf_data_sampler-0.5.13}/ocf_data_sampler.egg-info/requires.txt +0 -0
- {ocf_data_sampler-0.5.11 → ocf_data_sampler-0.5.13}/ocf_data_sampler.egg-info/top_level.txt +0 -0
- {ocf_data_sampler-0.5.11 → ocf_data_sampler-0.5.13}/pyproject.toml +0 -0
- {ocf_data_sampler-0.5.11 → ocf_data_sampler-0.5.13}/scripts/download_gsp_location_data.py +0 -0
- {ocf_data_sampler-0.5.11 → ocf_data_sampler-0.5.13}/scripts/refactor_site.py +0 -0
- {ocf_data_sampler-0.5.11 → ocf_data_sampler-0.5.13}/setup.cfg +0 -0
- {ocf_data_sampler-0.5.11 → ocf_data_sampler-0.5.13}/tests/test_utils.py +0 -0
{ocf_data_sampler-0.5.11 → ocf_data_sampler-0.5.13}/ocf_data_sampler/select/select_spatial_slice.py
RENAMED
|
@@ -25,13 +25,13 @@ def _get_pixel_index_location(da: xr.DataArray, location: Location) -> tuple[int
|
|
|
25
25
|
x, y = location.in_coord_system(target_coords)
|
|
26
26
|
|
|
27
27
|
# Check that requested point lies within the data
|
|
28
|
-
if not (da[x_dim].
|
|
28
|
+
if not (da[x_dim].values[0] < x < da[x_dim].values[-1]):
|
|
29
29
|
raise ValueError(
|
|
30
|
-
f"{x} is not in the interval {da[x_dim].
|
|
30
|
+
f"{x} is not in the interval {da[x_dim].values[0]}: {da[x_dim].values[-1]}",
|
|
31
31
|
)
|
|
32
|
-
if not (da[y_dim].
|
|
32
|
+
if not (da[y_dim].values[0] < y < da[y_dim].values[-1]):
|
|
33
33
|
raise ValueError(
|
|
34
|
-
f"{y} is not in the interval {da[y_dim].
|
|
34
|
+
f"{y} is not in the interval {da[y_dim].values[0]}: {da[y_dim].values[-1]}",
|
|
35
35
|
)
|
|
36
36
|
|
|
37
37
|
x_index = da.get_index(x_dim)
|
|
@@ -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
|
|
|
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.11 → ocf_data_sampler-0.5.13}/ocf_data_sampler/load/nwp/providers/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{ocf_data_sampler-0.5.11 → ocf_data_sampler-0.5.13}/ocf_data_sampler/load/nwp/providers/ecmwf.py
RENAMED
|
File without changes
|
{ocf_data_sampler-0.5.11 → ocf_data_sampler-0.5.13}/ocf_data_sampler/load/nwp/providers/gfs.py
RENAMED
|
File without changes
|
{ocf_data_sampler-0.5.11 → ocf_data_sampler-0.5.13}/ocf_data_sampler/load/nwp/providers/icon.py
RENAMED
|
File without changes
|
{ocf_data_sampler-0.5.11 → ocf_data_sampler-0.5.13}/ocf_data_sampler/load/nwp/providers/ukv.py
RENAMED
|
File without changes
|
{ocf_data_sampler-0.5.11 → ocf_data_sampler-0.5.13}/ocf_data_sampler/load/nwp/providers/utils.py
RENAMED
|
File without changes
|
{ocf_data_sampler-0.5.11 → ocf_data_sampler-0.5.13}/ocf_data_sampler/load/open_xarray_tensorstore.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{ocf_data_sampler-0.5.11 → ocf_data_sampler-0.5.13}/ocf_data_sampler/numpy_sample/__init__.py
RENAMED
|
File without changes
|
{ocf_data_sampler-0.5.11 → ocf_data_sampler-0.5.13}/ocf_data_sampler/numpy_sample/collate.py
RENAMED
|
File without changes
|
{ocf_data_sampler-0.5.11 → ocf_data_sampler-0.5.13}/ocf_data_sampler/numpy_sample/common_types.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{ocf_data_sampler-0.5.11 → ocf_data_sampler-0.5.13}/ocf_data_sampler/numpy_sample/satellite.py
RENAMED
|
File without changes
|
|
File without changes
|
{ocf_data_sampler-0.5.11 → ocf_data_sampler-0.5.13}/ocf_data_sampler/numpy_sample/sun_position.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{ocf_data_sampler-0.5.11 → ocf_data_sampler-0.5.13}/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.11 → ocf_data_sampler-0.5.13}/ocf_data_sampler/select/select_time_slice.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{ocf_data_sampler-0.5.11 → ocf_data_sampler-0.5.13}/ocf_data_sampler/torch_datasets/datasets/site.py
RENAMED
|
File without changes
|
|
File without changes
|
{ocf_data_sampler-0.5.11 → ocf_data_sampler-0.5.13}/ocf_data_sampler/torch_datasets/sample/base.py
RENAMED
|
File without changes
|
{ocf_data_sampler-0.5.11 → ocf_data_sampler-0.5.13}/ocf_data_sampler/torch_datasets/sample/site.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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{ocf_data_sampler-0.5.11 → ocf_data_sampler-0.5.13}/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
|