ocf-data-sampler 0.2.22__tar.gz → 0.2.24__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.2.22 → ocf_data_sampler-0.2.24}/PKG-INFO +1 -1
- {ocf_data_sampler-0.2.22 → ocf_data_sampler-0.2.24}/ocf_data_sampler/config/model.py +3 -0
- {ocf_data_sampler-0.2.22 → ocf_data_sampler-0.2.24}/ocf_data_sampler/load/gsp.py +12 -2
- {ocf_data_sampler-0.2.22 → ocf_data_sampler-0.2.24}/ocf_data_sampler/load/load_dataset.py +1 -0
- {ocf_data_sampler-0.2.22 → ocf_data_sampler-0.2.24}/ocf_data_sampler/load/nwp/nwp.py +1 -1
- {ocf_data_sampler-0.2.22 → ocf_data_sampler-0.2.24}/ocf_data_sampler.egg-info/PKG-INFO +1 -1
- {ocf_data_sampler-0.2.22 → ocf_data_sampler-0.2.24}/LICENSE +0 -0
- {ocf_data_sampler-0.2.22 → ocf_data_sampler-0.2.24}/README.md +0 -0
- {ocf_data_sampler-0.2.22 → ocf_data_sampler-0.2.24}/ocf_data_sampler/__init__.py +0 -0
- {ocf_data_sampler-0.2.22 → ocf_data_sampler-0.2.24}/ocf_data_sampler/config/__init__.py +0 -0
- {ocf_data_sampler-0.2.22 → ocf_data_sampler-0.2.24}/ocf_data_sampler/config/load.py +0 -0
- {ocf_data_sampler-0.2.22 → ocf_data_sampler-0.2.24}/ocf_data_sampler/config/save.py +0 -0
- {ocf_data_sampler-0.2.22 → ocf_data_sampler-0.2.24}/ocf_data_sampler/data/uk_gsp_locations_20220314.csv +0 -0
- {ocf_data_sampler-0.2.22 → ocf_data_sampler-0.2.24}/ocf_data_sampler/data/uk_gsp_locations_20250109.csv +0 -0
- {ocf_data_sampler-0.2.22 → ocf_data_sampler-0.2.24}/ocf_data_sampler/load/__init__.py +0 -0
- {ocf_data_sampler-0.2.22 → ocf_data_sampler-0.2.24}/ocf_data_sampler/load/nwp/__init__.py +0 -0
- {ocf_data_sampler-0.2.22 → ocf_data_sampler-0.2.24}/ocf_data_sampler/load/nwp/providers/__init__.py +0 -0
- {ocf_data_sampler-0.2.22 → ocf_data_sampler-0.2.24}/ocf_data_sampler/load/nwp/providers/cloudcasting.py +0 -0
- {ocf_data_sampler-0.2.22 → ocf_data_sampler-0.2.24}/ocf_data_sampler/load/nwp/providers/ecmwf.py +0 -0
- {ocf_data_sampler-0.2.22 → ocf_data_sampler-0.2.24}/ocf_data_sampler/load/nwp/providers/gfs.py +0 -0
- {ocf_data_sampler-0.2.22 → ocf_data_sampler-0.2.24}/ocf_data_sampler/load/nwp/providers/icon.py +0 -0
- {ocf_data_sampler-0.2.22 → ocf_data_sampler-0.2.24}/ocf_data_sampler/load/nwp/providers/ukv.py +0 -0
- {ocf_data_sampler-0.2.22 → ocf_data_sampler-0.2.24}/ocf_data_sampler/load/nwp/providers/utils.py +0 -0
- {ocf_data_sampler-0.2.22 → ocf_data_sampler-0.2.24}/ocf_data_sampler/load/satellite.py +0 -0
- {ocf_data_sampler-0.2.22 → ocf_data_sampler-0.2.24}/ocf_data_sampler/load/site.py +0 -0
- {ocf_data_sampler-0.2.22 → ocf_data_sampler-0.2.24}/ocf_data_sampler/load/utils.py +0 -0
- {ocf_data_sampler-0.2.22 → ocf_data_sampler-0.2.24}/ocf_data_sampler/numpy_sample/__init__.py +0 -0
- {ocf_data_sampler-0.2.22 → ocf_data_sampler-0.2.24}/ocf_data_sampler/numpy_sample/collate.py +0 -0
- {ocf_data_sampler-0.2.22 → ocf_data_sampler-0.2.24}/ocf_data_sampler/numpy_sample/common_types.py +0 -0
- {ocf_data_sampler-0.2.22 → ocf_data_sampler-0.2.24}/ocf_data_sampler/numpy_sample/datetime_features.py +0 -0
- {ocf_data_sampler-0.2.22 → ocf_data_sampler-0.2.24}/ocf_data_sampler/numpy_sample/gsp.py +0 -0
- {ocf_data_sampler-0.2.22 → ocf_data_sampler-0.2.24}/ocf_data_sampler/numpy_sample/nwp.py +0 -0
- {ocf_data_sampler-0.2.22 → ocf_data_sampler-0.2.24}/ocf_data_sampler/numpy_sample/satellite.py +0 -0
- {ocf_data_sampler-0.2.22 → ocf_data_sampler-0.2.24}/ocf_data_sampler/numpy_sample/site.py +0 -0
- {ocf_data_sampler-0.2.22 → ocf_data_sampler-0.2.24}/ocf_data_sampler/numpy_sample/sun_position.py +0 -0
- {ocf_data_sampler-0.2.22 → ocf_data_sampler-0.2.24}/ocf_data_sampler/select/__init__.py +0 -0
- {ocf_data_sampler-0.2.22 → ocf_data_sampler-0.2.24}/ocf_data_sampler/select/dropout.py +0 -0
- {ocf_data_sampler-0.2.22 → ocf_data_sampler-0.2.24}/ocf_data_sampler/select/fill_time_periods.py +0 -0
- {ocf_data_sampler-0.2.22 → ocf_data_sampler-0.2.24}/ocf_data_sampler/select/find_contiguous_time_periods.py +0 -0
- {ocf_data_sampler-0.2.22 → ocf_data_sampler-0.2.24}/ocf_data_sampler/select/geospatial.py +0 -0
- {ocf_data_sampler-0.2.22 → ocf_data_sampler-0.2.24}/ocf_data_sampler/select/location.py +0 -0
- {ocf_data_sampler-0.2.22 → ocf_data_sampler-0.2.24}/ocf_data_sampler/select/select_spatial_slice.py +0 -0
- {ocf_data_sampler-0.2.22 → ocf_data_sampler-0.2.24}/ocf_data_sampler/select/select_time_slice.py +0 -0
- {ocf_data_sampler-0.2.22 → ocf_data_sampler-0.2.24}/ocf_data_sampler/torch_datasets/datasets/__init__.py +0 -0
- {ocf_data_sampler-0.2.22 → ocf_data_sampler-0.2.24}/ocf_data_sampler/torch_datasets/datasets/pvnet_uk.py +0 -0
- {ocf_data_sampler-0.2.22 → ocf_data_sampler-0.2.24}/ocf_data_sampler/torch_datasets/datasets/site.py +0 -0
- {ocf_data_sampler-0.2.22 → ocf_data_sampler-0.2.24}/ocf_data_sampler/torch_datasets/sample/__init__.py +0 -0
- {ocf_data_sampler-0.2.22 → ocf_data_sampler-0.2.24}/ocf_data_sampler/torch_datasets/sample/base.py +0 -0
- {ocf_data_sampler-0.2.22 → ocf_data_sampler-0.2.24}/ocf_data_sampler/torch_datasets/sample/site.py +0 -0
- {ocf_data_sampler-0.2.22 → ocf_data_sampler-0.2.24}/ocf_data_sampler/torch_datasets/sample/uk_regional.py +0 -0
- {ocf_data_sampler-0.2.22 → ocf_data_sampler-0.2.24}/ocf_data_sampler/torch_datasets/utils/__init__.py +0 -0
- {ocf_data_sampler-0.2.22 → ocf_data_sampler-0.2.24}/ocf_data_sampler/torch_datasets/utils/channel_dict_to_dataarray.py +0 -0
- {ocf_data_sampler-0.2.22 → ocf_data_sampler-0.2.24}/ocf_data_sampler/torch_datasets/utils/merge_and_fill_utils.py +0 -0
- {ocf_data_sampler-0.2.22 → ocf_data_sampler-0.2.24}/ocf_data_sampler/torch_datasets/utils/spatial_slice_for_dataset.py +0 -0
- {ocf_data_sampler-0.2.22 → ocf_data_sampler-0.2.24}/ocf_data_sampler/torch_datasets/utils/time_slice_for_dataset.py +0 -0
- {ocf_data_sampler-0.2.22 → ocf_data_sampler-0.2.24}/ocf_data_sampler/torch_datasets/utils/valid_time_periods.py +0 -0
- {ocf_data_sampler-0.2.22 → ocf_data_sampler-0.2.24}/ocf_data_sampler/torch_datasets/utils/validation_utils.py +0 -0
- {ocf_data_sampler-0.2.22 → ocf_data_sampler-0.2.24}/ocf_data_sampler/utils.py +0 -0
- {ocf_data_sampler-0.2.22 → ocf_data_sampler-0.2.24}/ocf_data_sampler.egg-info/SOURCES.txt +0 -0
- {ocf_data_sampler-0.2.22 → ocf_data_sampler-0.2.24}/ocf_data_sampler.egg-info/dependency_links.txt +0 -0
- {ocf_data_sampler-0.2.22 → ocf_data_sampler-0.2.24}/ocf_data_sampler.egg-info/requires.txt +0 -0
- {ocf_data_sampler-0.2.22 → ocf_data_sampler-0.2.24}/ocf_data_sampler.egg-info/top_level.txt +0 -0
- {ocf_data_sampler-0.2.22 → ocf_data_sampler-0.2.24}/pyproject.toml +0 -0
- {ocf_data_sampler-0.2.22 → ocf_data_sampler-0.2.24}/scripts/download_gsp_location_data.py +0 -0
- {ocf_data_sampler-0.2.22 → ocf_data_sampler-0.2.24}/scripts/refactor_site.py +0 -0
- {ocf_data_sampler-0.2.22 → ocf_data_sampler-0.2.24}/setup.cfg +0 -0
- {ocf_data_sampler-0.2.22 → ocf_data_sampler-0.2.24}/utils/compute_icon_mean_stddev.py +0 -0
|
@@ -13,6 +13,7 @@ from typing_extensions import override
|
|
|
13
13
|
NWP_PROVIDERS = [
|
|
14
14
|
"ukv",
|
|
15
15
|
"ecmwf",
|
|
16
|
+
"mo_global",
|
|
16
17
|
"gfs",
|
|
17
18
|
"icon_eu",
|
|
18
19
|
"cloudcasting",
|
|
@@ -290,6 +291,8 @@ class GSP(TimeWindowMixin, DropoutMixin):
|
|
|
290
291
|
description="Version of the GSP boundaries to use. Options are '20220314' or '20250109'.",
|
|
291
292
|
)
|
|
292
293
|
|
|
294
|
+
public: bool = Field(False, description="Whether the NWP data is public or private")
|
|
295
|
+
|
|
293
296
|
|
|
294
297
|
class Site(TimeWindowMixin, DropoutMixin):
|
|
295
298
|
"""Site configuration model."""
|
|
@@ -26,13 +26,17 @@ def get_gsp_boundaries(version: str) -> pd.DataFrame:
|
|
|
26
26
|
)
|
|
27
27
|
|
|
28
28
|
|
|
29
|
-
def open_gsp(zarr_path: str,
|
|
29
|
+
def open_gsp(zarr_path: str,
|
|
30
|
+
boundaries_version: str = "20220314",
|
|
31
|
+
public: bool = False,
|
|
32
|
+
) -> xr.DataArray:
|
|
30
33
|
"""Open the GSP data.
|
|
31
34
|
|
|
32
35
|
Args:
|
|
33
36
|
zarr_path: Path to the GSP zarr data
|
|
34
37
|
boundaries_version: Version of the GSP boundaries to use. Options are "20220314" or
|
|
35
38
|
"20250109".
|
|
39
|
+
public: Whether the data is public or private.
|
|
36
40
|
|
|
37
41
|
Returns:
|
|
38
42
|
xr.DataArray: The opened GSP data
|
|
@@ -40,12 +44,18 @@ def open_gsp(zarr_path: str, boundaries_version: str = "20220314") -> xr.DataArr
|
|
|
40
44
|
# Load UK GSP locations
|
|
41
45
|
df_gsp_loc = get_gsp_boundaries(boundaries_version)
|
|
42
46
|
|
|
47
|
+
backend_kwargs ={}
|
|
43
48
|
# Open the GSP generation data
|
|
49
|
+
if public:
|
|
50
|
+
backend_kwargs ={"storage_options":{"anon": True}}
|
|
51
|
+
# Currently only compatible with S3 bucket.
|
|
52
|
+
|
|
44
53
|
ds = (
|
|
45
|
-
xr.
|
|
54
|
+
xr.open_dataset(zarr_path,engine="zarr",backend_kwargs=backend_kwargs)
|
|
46
55
|
.rename({"datetime_gmt": "time_utc"})
|
|
47
56
|
)
|
|
48
57
|
|
|
58
|
+
|
|
49
59
|
if not (ds.gsp_id.isin(df_gsp_loc.index)).all():
|
|
50
60
|
raise ValueError(
|
|
51
61
|
"Some GSP IDs in the GSP generation data are not available in the locations file.",
|
|
@@ -28,7 +28,7 @@ def open_nwp(zarr_path: str | list[str], provider: str, public: bool = False) ->
|
|
|
28
28
|
|
|
29
29
|
if provider == "ukv":
|
|
30
30
|
_open_nwp = open_ukv
|
|
31
|
-
elif provider
|
|
31
|
+
elif provider in ["ecmwf", "mo_global"]:
|
|
32
32
|
_open_nwp = open_ifs
|
|
33
33
|
elif provider == "icon-eu":
|
|
34
34
|
_open_nwp = open_icon_eu
|
|
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.2.22 → ocf_data_sampler-0.2.24}/ocf_data_sampler/load/nwp/providers/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{ocf_data_sampler-0.2.22 → ocf_data_sampler-0.2.24}/ocf_data_sampler/load/nwp/providers/ecmwf.py
RENAMED
|
File without changes
|
{ocf_data_sampler-0.2.22 → ocf_data_sampler-0.2.24}/ocf_data_sampler/load/nwp/providers/gfs.py
RENAMED
|
File without changes
|
{ocf_data_sampler-0.2.22 → ocf_data_sampler-0.2.24}/ocf_data_sampler/load/nwp/providers/icon.py
RENAMED
|
File without changes
|
{ocf_data_sampler-0.2.22 → ocf_data_sampler-0.2.24}/ocf_data_sampler/load/nwp/providers/ukv.py
RENAMED
|
File without changes
|
{ocf_data_sampler-0.2.22 → ocf_data_sampler-0.2.24}/ocf_data_sampler/load/nwp/providers/utils.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{ocf_data_sampler-0.2.22 → ocf_data_sampler-0.2.24}/ocf_data_sampler/numpy_sample/__init__.py
RENAMED
|
File without changes
|
{ocf_data_sampler-0.2.22 → ocf_data_sampler-0.2.24}/ocf_data_sampler/numpy_sample/collate.py
RENAMED
|
File without changes
|
{ocf_data_sampler-0.2.22 → ocf_data_sampler-0.2.24}/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.2.22 → ocf_data_sampler-0.2.24}/ocf_data_sampler/numpy_sample/satellite.py
RENAMED
|
File without changes
|
|
File without changes
|
{ocf_data_sampler-0.2.22 → ocf_data_sampler-0.2.24}/ocf_data_sampler/numpy_sample/sun_position.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{ocf_data_sampler-0.2.22 → ocf_data_sampler-0.2.24}/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.2.22 → ocf_data_sampler-0.2.24}/ocf_data_sampler/select/select_spatial_slice.py
RENAMED
|
File without changes
|
{ocf_data_sampler-0.2.22 → ocf_data_sampler-0.2.24}/ocf_data_sampler/select/select_time_slice.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{ocf_data_sampler-0.2.22 → ocf_data_sampler-0.2.24}/ocf_data_sampler/torch_datasets/datasets/site.py
RENAMED
|
File without changes
|
|
File without changes
|
{ocf_data_sampler-0.2.22 → ocf_data_sampler-0.2.24}/ocf_data_sampler/torch_datasets/sample/base.py
RENAMED
|
File without changes
|
{ocf_data_sampler-0.2.22 → ocf_data_sampler-0.2.24}/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.2.22 → ocf_data_sampler-0.2.24}/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
|