ocf-data-sampler 0.5.24__tar.gz → 0.5.25__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.24 → ocf_data_sampler-0.5.25}/PKG-INFO +1 -1
- {ocf_data_sampler-0.5.24 → ocf_data_sampler-0.5.25}/ocf_data_sampler/load/nwp/providers/utils.py +1 -1
- {ocf_data_sampler-0.5.24 → ocf_data_sampler-0.5.25}/ocf_data_sampler/load/open_xarray_tensorstore.py +26 -7
- {ocf_data_sampler-0.5.24 → ocf_data_sampler-0.5.25}/ocf_data_sampler/load/satellite.py +1 -1
- {ocf_data_sampler-0.5.24 → ocf_data_sampler-0.5.25}/ocf_data_sampler.egg-info/PKG-INFO +1 -1
- {ocf_data_sampler-0.5.24 → ocf_data_sampler-0.5.25}/LICENSE +0 -0
- {ocf_data_sampler-0.5.24 → ocf_data_sampler-0.5.25}/README.md +0 -0
- {ocf_data_sampler-0.5.24 → ocf_data_sampler-0.5.25}/ocf_data_sampler/__init__.py +0 -0
- {ocf_data_sampler-0.5.24 → ocf_data_sampler-0.5.25}/ocf_data_sampler/config/__init__.py +0 -0
- {ocf_data_sampler-0.5.24 → ocf_data_sampler-0.5.25}/ocf_data_sampler/config/load.py +0 -0
- {ocf_data_sampler-0.5.24 → ocf_data_sampler-0.5.25}/ocf_data_sampler/config/model.py +0 -0
- {ocf_data_sampler-0.5.24 → ocf_data_sampler-0.5.25}/ocf_data_sampler/config/save.py +0 -0
- {ocf_data_sampler-0.5.24 → ocf_data_sampler-0.5.25}/ocf_data_sampler/data/uk_gsp_locations_20220314.csv +0 -0
- {ocf_data_sampler-0.5.24 → ocf_data_sampler-0.5.25}/ocf_data_sampler/data/uk_gsp_locations_20250109.csv +0 -0
- {ocf_data_sampler-0.5.24 → ocf_data_sampler-0.5.25}/ocf_data_sampler/load/__init__.py +0 -0
- {ocf_data_sampler-0.5.24 → ocf_data_sampler-0.5.25}/ocf_data_sampler/load/gsp.py +0 -0
- {ocf_data_sampler-0.5.24 → ocf_data_sampler-0.5.25}/ocf_data_sampler/load/load_dataset.py +0 -0
- {ocf_data_sampler-0.5.24 → ocf_data_sampler-0.5.25}/ocf_data_sampler/load/nwp/__init__.py +0 -0
- {ocf_data_sampler-0.5.24 → ocf_data_sampler-0.5.25}/ocf_data_sampler/load/nwp/nwp.py +0 -0
- {ocf_data_sampler-0.5.24 → ocf_data_sampler-0.5.25}/ocf_data_sampler/load/nwp/providers/__init__.py +0 -0
- {ocf_data_sampler-0.5.24 → ocf_data_sampler-0.5.25}/ocf_data_sampler/load/nwp/providers/cloudcasting.py +0 -0
- {ocf_data_sampler-0.5.24 → ocf_data_sampler-0.5.25}/ocf_data_sampler/load/nwp/providers/ecmwf.py +0 -0
- {ocf_data_sampler-0.5.24 → ocf_data_sampler-0.5.25}/ocf_data_sampler/load/nwp/providers/gfs.py +0 -0
- {ocf_data_sampler-0.5.24 → ocf_data_sampler-0.5.25}/ocf_data_sampler/load/nwp/providers/icon.py +0 -0
- {ocf_data_sampler-0.5.24 → ocf_data_sampler-0.5.25}/ocf_data_sampler/load/nwp/providers/ukv.py +0 -0
- {ocf_data_sampler-0.5.24 → ocf_data_sampler-0.5.25}/ocf_data_sampler/load/site.py +0 -0
- {ocf_data_sampler-0.5.24 → ocf_data_sampler-0.5.25}/ocf_data_sampler/load/utils.py +0 -0
- {ocf_data_sampler-0.5.24 → ocf_data_sampler-0.5.25}/ocf_data_sampler/numpy_sample/__init__.py +0 -0
- {ocf_data_sampler-0.5.24 → ocf_data_sampler-0.5.25}/ocf_data_sampler/numpy_sample/collate.py +0 -0
- {ocf_data_sampler-0.5.24 → ocf_data_sampler-0.5.25}/ocf_data_sampler/numpy_sample/common_types.py +0 -0
- {ocf_data_sampler-0.5.24 → ocf_data_sampler-0.5.25}/ocf_data_sampler/numpy_sample/datetime_features.py +0 -0
- {ocf_data_sampler-0.5.24 → ocf_data_sampler-0.5.25}/ocf_data_sampler/numpy_sample/gsp.py +0 -0
- {ocf_data_sampler-0.5.24 → ocf_data_sampler-0.5.25}/ocf_data_sampler/numpy_sample/nwp.py +0 -0
- {ocf_data_sampler-0.5.24 → ocf_data_sampler-0.5.25}/ocf_data_sampler/numpy_sample/satellite.py +0 -0
- {ocf_data_sampler-0.5.24 → ocf_data_sampler-0.5.25}/ocf_data_sampler/numpy_sample/site.py +0 -0
- {ocf_data_sampler-0.5.24 → ocf_data_sampler-0.5.25}/ocf_data_sampler/numpy_sample/sun_position.py +0 -0
- {ocf_data_sampler-0.5.24 → ocf_data_sampler-0.5.25}/ocf_data_sampler/select/__init__.py +0 -0
- {ocf_data_sampler-0.5.24 → ocf_data_sampler-0.5.25}/ocf_data_sampler/select/diff_channels.py +0 -0
- {ocf_data_sampler-0.5.24 → ocf_data_sampler-0.5.25}/ocf_data_sampler/select/dropout.py +0 -0
- {ocf_data_sampler-0.5.24 → ocf_data_sampler-0.5.25}/ocf_data_sampler/select/fill_time_periods.py +0 -0
- {ocf_data_sampler-0.5.24 → ocf_data_sampler-0.5.25}/ocf_data_sampler/select/find_contiguous_time_periods.py +0 -0
- {ocf_data_sampler-0.5.24 → ocf_data_sampler-0.5.25}/ocf_data_sampler/select/geospatial.py +0 -0
- {ocf_data_sampler-0.5.24 → ocf_data_sampler-0.5.25}/ocf_data_sampler/select/location.py +0 -0
- {ocf_data_sampler-0.5.24 → ocf_data_sampler-0.5.25}/ocf_data_sampler/select/select_spatial_slice.py +0 -0
- {ocf_data_sampler-0.5.24 → ocf_data_sampler-0.5.25}/ocf_data_sampler/select/select_time_slice.py +0 -0
- {ocf_data_sampler-0.5.24 → ocf_data_sampler-0.5.25}/ocf_data_sampler/torch_datasets/datasets/__init__.py +0 -0
- {ocf_data_sampler-0.5.24 → ocf_data_sampler-0.5.25}/ocf_data_sampler/torch_datasets/datasets/picklecache.py +0 -0
- {ocf_data_sampler-0.5.24 → ocf_data_sampler-0.5.25}/ocf_data_sampler/torch_datasets/datasets/pvnet_uk.py +0 -0
- {ocf_data_sampler-0.5.24 → ocf_data_sampler-0.5.25}/ocf_data_sampler/torch_datasets/datasets/site.py +0 -0
- {ocf_data_sampler-0.5.24 → ocf_data_sampler-0.5.25}/ocf_data_sampler/torch_datasets/sample/__init__.py +0 -0
- {ocf_data_sampler-0.5.24 → ocf_data_sampler-0.5.25}/ocf_data_sampler/torch_datasets/sample/base.py +0 -0
- {ocf_data_sampler-0.5.24 → ocf_data_sampler-0.5.25}/ocf_data_sampler/torch_datasets/sample/site.py +0 -0
- {ocf_data_sampler-0.5.24 → ocf_data_sampler-0.5.25}/ocf_data_sampler/torch_datasets/sample/uk_regional.py +0 -0
- {ocf_data_sampler-0.5.24 → ocf_data_sampler-0.5.25}/ocf_data_sampler/torch_datasets/utils/__init__.py +0 -0
- {ocf_data_sampler-0.5.24 → ocf_data_sampler-0.5.25}/ocf_data_sampler/torch_datasets/utils/add_alterate_coordinate_projections.py +0 -0
- {ocf_data_sampler-0.5.24 → ocf_data_sampler-0.5.25}/ocf_data_sampler/torch_datasets/utils/config_normalization_values_to_dicts.py +0 -0
- {ocf_data_sampler-0.5.24 → ocf_data_sampler-0.5.25}/ocf_data_sampler/torch_datasets/utils/diff_nwp_data.py +0 -0
- {ocf_data_sampler-0.5.24 → ocf_data_sampler-0.5.25}/ocf_data_sampler/torch_datasets/utils/merge_and_fill_utils.py +0 -0
- {ocf_data_sampler-0.5.24 → ocf_data_sampler-0.5.25}/ocf_data_sampler/torch_datasets/utils/spatial_slice_for_dataset.py +0 -0
- {ocf_data_sampler-0.5.24 → ocf_data_sampler-0.5.25}/ocf_data_sampler/torch_datasets/utils/time_slice_for_dataset.py +0 -0
- {ocf_data_sampler-0.5.24 → ocf_data_sampler-0.5.25}/ocf_data_sampler/torch_datasets/utils/valid_time_periods.py +0 -0
- {ocf_data_sampler-0.5.24 → ocf_data_sampler-0.5.25}/ocf_data_sampler/torch_datasets/utils/validation_utils.py +0 -0
- {ocf_data_sampler-0.5.24 → ocf_data_sampler-0.5.25}/ocf_data_sampler/utils.py +0 -0
- {ocf_data_sampler-0.5.24 → ocf_data_sampler-0.5.25}/ocf_data_sampler.egg-info/SOURCES.txt +0 -0
- {ocf_data_sampler-0.5.24 → ocf_data_sampler-0.5.25}/ocf_data_sampler.egg-info/dependency_links.txt +0 -0
- {ocf_data_sampler-0.5.24 → ocf_data_sampler-0.5.25}/ocf_data_sampler.egg-info/requires.txt +0 -0
- {ocf_data_sampler-0.5.24 → ocf_data_sampler-0.5.25}/ocf_data_sampler.egg-info/top_level.txt +0 -0
- {ocf_data_sampler-0.5.24 → ocf_data_sampler-0.5.25}/pyproject.toml +0 -0
- {ocf_data_sampler-0.5.24 → ocf_data_sampler-0.5.25}/scripts/download_gsp_location_data.py +0 -0
- {ocf_data_sampler-0.5.24 → ocf_data_sampler-0.5.25}/scripts/refactor_site.py +0 -0
- {ocf_data_sampler-0.5.24 → ocf_data_sampler-0.5.25}/setup.cfg +0 -0
- {ocf_data_sampler-0.5.24 → ocf_data_sampler-0.5.25}/tests/test_utils.py +0 -0
{ocf_data_sampler-0.5.24 → ocf_data_sampler-0.5.25}/ocf_data_sampler/load/nwp/providers/utils.py
RENAMED
|
@@ -75,7 +75,7 @@ def _tensostore_open_zarr_paths(zarr_path: str | list[str], time_dim: str) -> xr
|
|
|
75
75
|
zarr_path = sorted(glob(zarr_path))
|
|
76
76
|
|
|
77
77
|
if isinstance(zarr_path, list | tuple):
|
|
78
|
-
ds = open_zarrs(zarr_path, concat_dim=time_dim).sortby(time_dim)
|
|
78
|
+
ds = open_zarrs(zarr_path, concat_dim=time_dim, data_source="nwp").sortby(time_dim)
|
|
79
79
|
else:
|
|
80
80
|
ds = open_zarr(zarr_path)
|
|
81
81
|
return ds
|
{ocf_data_sampler-0.5.24 → ocf_data_sampler-0.5.25}/ocf_data_sampler/load/open_xarray_tensorstore.py
RENAMED
|
@@ -14,6 +14,7 @@ References:
|
|
|
14
14
|
[2] https://www.apache.org/licenses/LICENSE-2.0
|
|
15
15
|
"""
|
|
16
16
|
|
|
17
|
+
import logging
|
|
17
18
|
import os.path
|
|
18
19
|
import re
|
|
19
20
|
|
|
@@ -26,6 +27,7 @@ from xarray_tensorstore import (
|
|
|
26
27
|
_TensorStoreAdapter,
|
|
27
28
|
)
|
|
28
29
|
|
|
30
|
+
logger = logging.getLogger(__name__)
|
|
29
31
|
|
|
30
32
|
def _zarr_spec_from_path(path: str, zarr_format: int) -> ...:
|
|
31
33
|
if re.match(r"\w+\://", path): # path is a URI
|
|
@@ -127,6 +129,7 @@ def open_zarrs(
|
|
|
127
129
|
concat_dim: str,
|
|
128
130
|
context: ts.Context | None = None,
|
|
129
131
|
mask_and_scale: bool = True,
|
|
132
|
+
data_source: str = "unknown",
|
|
130
133
|
) -> xr.Dataset:
|
|
131
134
|
"""Open multiple zarrs with TensorStore.
|
|
132
135
|
|
|
@@ -135,6 +138,7 @@ def open_zarrs(
|
|
|
135
138
|
concat_dim: Dimension along which to concatenate the data variables.
|
|
136
139
|
context: TensorStore context.
|
|
137
140
|
mask_and_scale: Whether to mask and scale the data.
|
|
141
|
+
data_source: Which data source is being opened. Used for warning context.
|
|
138
142
|
|
|
139
143
|
Returns:
|
|
140
144
|
Concatenated Dataset with all data variables opened via TensorStore.
|
|
@@ -143,13 +147,28 @@ def open_zarrs(
|
|
|
143
147
|
context = ts.Context()
|
|
144
148
|
|
|
145
149
|
ds_list = [xr.open_zarr(p, mask_and_scale=mask_and_scale, decode_timedelta=True) for p in paths]
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
150
|
+
try:
|
|
151
|
+
ds = xr.concat(
|
|
152
|
+
ds_list,
|
|
153
|
+
dim=concat_dim,
|
|
154
|
+
data_vars="minimal",
|
|
155
|
+
compat="equals",
|
|
156
|
+
combine_attrs="drop_conflicts",
|
|
157
|
+
join="exact",
|
|
158
|
+
)
|
|
159
|
+
except ValueError:
|
|
160
|
+
logger.warning(f"Coordinate mismatch found in {data_source} input data. "
|
|
161
|
+
f"The coordinates will be overwritten! "
|
|
162
|
+
f"This might be fine for satellite data. "
|
|
163
|
+
f"Proceed with caution.")
|
|
164
|
+
ds = xr.concat(
|
|
165
|
+
ds_list,
|
|
166
|
+
dim=concat_dim,
|
|
167
|
+
data_vars="minimal",
|
|
168
|
+
compat="equals",
|
|
169
|
+
combine_attrs="drop_conflicts",
|
|
170
|
+
join="override",
|
|
171
|
+
)
|
|
153
172
|
|
|
154
173
|
if mask_and_scale:
|
|
155
174
|
_raise_if_mask_and_scale_used_for_data_vars(ds)
|
|
@@ -19,7 +19,7 @@ def open_sat_data(zarr_path: str | list[str]) -> xr.DataArray:
|
|
|
19
19
|
"""
|
|
20
20
|
# Open the data
|
|
21
21
|
if isinstance(zarr_path, list | tuple):
|
|
22
|
-
ds = open_zarrs(zarr_path, concat_dim="time")
|
|
22
|
+
ds = open_zarrs(zarr_path, concat_dim="time", data_source="satellite")
|
|
23
23
|
else:
|
|
24
24
|
ds = open_zarr(zarr_path)
|
|
25
25
|
|
|
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.24 → ocf_data_sampler-0.5.25}/ocf_data_sampler/load/nwp/providers/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{ocf_data_sampler-0.5.24 → ocf_data_sampler-0.5.25}/ocf_data_sampler/load/nwp/providers/ecmwf.py
RENAMED
|
File without changes
|
{ocf_data_sampler-0.5.24 → ocf_data_sampler-0.5.25}/ocf_data_sampler/load/nwp/providers/gfs.py
RENAMED
|
File without changes
|
{ocf_data_sampler-0.5.24 → ocf_data_sampler-0.5.25}/ocf_data_sampler/load/nwp/providers/icon.py
RENAMED
|
File without changes
|
{ocf_data_sampler-0.5.24 → ocf_data_sampler-0.5.25}/ocf_data_sampler/load/nwp/providers/ukv.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{ocf_data_sampler-0.5.24 → ocf_data_sampler-0.5.25}/ocf_data_sampler/numpy_sample/__init__.py
RENAMED
|
File without changes
|
{ocf_data_sampler-0.5.24 → ocf_data_sampler-0.5.25}/ocf_data_sampler/numpy_sample/collate.py
RENAMED
|
File without changes
|
{ocf_data_sampler-0.5.24 → ocf_data_sampler-0.5.25}/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.24 → ocf_data_sampler-0.5.25}/ocf_data_sampler/numpy_sample/satellite.py
RENAMED
|
File without changes
|
|
File without changes
|
{ocf_data_sampler-0.5.24 → ocf_data_sampler-0.5.25}/ocf_data_sampler/numpy_sample/sun_position.py
RENAMED
|
File without changes
|
|
File without changes
|
{ocf_data_sampler-0.5.24 → ocf_data_sampler-0.5.25}/ocf_data_sampler/select/diff_channels.py
RENAMED
|
File without changes
|
|
File without changes
|
{ocf_data_sampler-0.5.24 → ocf_data_sampler-0.5.25}/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.24 → ocf_data_sampler-0.5.25}/ocf_data_sampler/select/select_spatial_slice.py
RENAMED
|
File without changes
|
{ocf_data_sampler-0.5.24 → ocf_data_sampler-0.5.25}/ocf_data_sampler/select/select_time_slice.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{ocf_data_sampler-0.5.24 → ocf_data_sampler-0.5.25}/ocf_data_sampler/torch_datasets/datasets/site.py
RENAMED
|
File without changes
|
|
File without changes
|
{ocf_data_sampler-0.5.24 → ocf_data_sampler-0.5.25}/ocf_data_sampler/torch_datasets/sample/base.py
RENAMED
|
File without changes
|
{ocf_data_sampler-0.5.24 → ocf_data_sampler-0.5.25}/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
|
|
File without changes
|
|
File without changes
|
{ocf_data_sampler-0.5.24 → ocf_data_sampler-0.5.25}/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
|