ocf-data-sampler 0.5.31__tar.gz → 0.5.32__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.31 → ocf_data_sampler-0.5.32}/PKG-INFO +1 -1
- {ocf_data_sampler-0.5.31 → ocf_data_sampler-0.5.32}/ocf_data_sampler/torch_datasets/datasets/site.py +0 -23
- {ocf_data_sampler-0.5.31 → ocf_data_sampler-0.5.32}/ocf_data_sampler.egg-info/PKG-INFO +1 -1
- {ocf_data_sampler-0.5.31 → ocf_data_sampler-0.5.32}/LICENSE +0 -0
- {ocf_data_sampler-0.5.31 → ocf_data_sampler-0.5.32}/README.md +0 -0
- {ocf_data_sampler-0.5.31 → ocf_data_sampler-0.5.32}/ocf_data_sampler/__init__.py +0 -0
- {ocf_data_sampler-0.5.31 → ocf_data_sampler-0.5.32}/ocf_data_sampler/config/__init__.py +0 -0
- {ocf_data_sampler-0.5.31 → ocf_data_sampler-0.5.32}/ocf_data_sampler/config/load.py +0 -0
- {ocf_data_sampler-0.5.31 → ocf_data_sampler-0.5.32}/ocf_data_sampler/config/model.py +0 -0
- {ocf_data_sampler-0.5.31 → ocf_data_sampler-0.5.32}/ocf_data_sampler/config/save.py +0 -0
- {ocf_data_sampler-0.5.31 → ocf_data_sampler-0.5.32}/ocf_data_sampler/data/uk_gsp_locations_20220314.csv +0 -0
- {ocf_data_sampler-0.5.31 → ocf_data_sampler-0.5.32}/ocf_data_sampler/data/uk_gsp_locations_20250109.csv +0 -0
- {ocf_data_sampler-0.5.31 → ocf_data_sampler-0.5.32}/ocf_data_sampler/load/__init__.py +0 -0
- {ocf_data_sampler-0.5.31 → ocf_data_sampler-0.5.32}/ocf_data_sampler/load/gsp.py +0 -0
- {ocf_data_sampler-0.5.31 → ocf_data_sampler-0.5.32}/ocf_data_sampler/load/load_dataset.py +0 -0
- {ocf_data_sampler-0.5.31 → ocf_data_sampler-0.5.32}/ocf_data_sampler/load/nwp/__init__.py +0 -0
- {ocf_data_sampler-0.5.31 → ocf_data_sampler-0.5.32}/ocf_data_sampler/load/nwp/nwp.py +0 -0
- {ocf_data_sampler-0.5.31 → ocf_data_sampler-0.5.32}/ocf_data_sampler/load/nwp/providers/__init__.py +0 -0
- {ocf_data_sampler-0.5.31 → ocf_data_sampler-0.5.32}/ocf_data_sampler/load/nwp/providers/cloudcasting.py +0 -0
- {ocf_data_sampler-0.5.31 → ocf_data_sampler-0.5.32}/ocf_data_sampler/load/nwp/providers/ecmwf.py +0 -0
- {ocf_data_sampler-0.5.31 → ocf_data_sampler-0.5.32}/ocf_data_sampler/load/nwp/providers/gfs.py +0 -0
- {ocf_data_sampler-0.5.31 → ocf_data_sampler-0.5.32}/ocf_data_sampler/load/nwp/providers/icon.py +0 -0
- {ocf_data_sampler-0.5.31 → ocf_data_sampler-0.5.32}/ocf_data_sampler/load/nwp/providers/ukv.py +0 -0
- {ocf_data_sampler-0.5.31 → ocf_data_sampler-0.5.32}/ocf_data_sampler/load/nwp/providers/utils.py +0 -0
- {ocf_data_sampler-0.5.31 → ocf_data_sampler-0.5.32}/ocf_data_sampler/load/open_xarray_tensorstore.py +0 -0
- {ocf_data_sampler-0.5.31 → ocf_data_sampler-0.5.32}/ocf_data_sampler/load/satellite.py +0 -0
- {ocf_data_sampler-0.5.31 → ocf_data_sampler-0.5.32}/ocf_data_sampler/load/site.py +0 -0
- {ocf_data_sampler-0.5.31 → ocf_data_sampler-0.5.32}/ocf_data_sampler/load/utils.py +0 -0
- {ocf_data_sampler-0.5.31 → ocf_data_sampler-0.5.32}/ocf_data_sampler/numpy_sample/__init__.py +0 -0
- {ocf_data_sampler-0.5.31 → ocf_data_sampler-0.5.32}/ocf_data_sampler/numpy_sample/collate.py +0 -0
- {ocf_data_sampler-0.5.31 → ocf_data_sampler-0.5.32}/ocf_data_sampler/numpy_sample/common_types.py +0 -0
- {ocf_data_sampler-0.5.31 → ocf_data_sampler-0.5.32}/ocf_data_sampler/numpy_sample/datetime_features.py +0 -0
- {ocf_data_sampler-0.5.31 → ocf_data_sampler-0.5.32}/ocf_data_sampler/numpy_sample/gsp.py +0 -0
- {ocf_data_sampler-0.5.31 → ocf_data_sampler-0.5.32}/ocf_data_sampler/numpy_sample/nwp.py +0 -0
- {ocf_data_sampler-0.5.31 → ocf_data_sampler-0.5.32}/ocf_data_sampler/numpy_sample/satellite.py +0 -0
- {ocf_data_sampler-0.5.31 → ocf_data_sampler-0.5.32}/ocf_data_sampler/numpy_sample/site.py +0 -0
- {ocf_data_sampler-0.5.31 → ocf_data_sampler-0.5.32}/ocf_data_sampler/numpy_sample/sun_position.py +0 -0
- {ocf_data_sampler-0.5.31 → ocf_data_sampler-0.5.32}/ocf_data_sampler/select/__init__.py +0 -0
- {ocf_data_sampler-0.5.31 → ocf_data_sampler-0.5.32}/ocf_data_sampler/select/diff_channels.py +0 -0
- {ocf_data_sampler-0.5.31 → ocf_data_sampler-0.5.32}/ocf_data_sampler/select/dropout.py +0 -0
- {ocf_data_sampler-0.5.31 → ocf_data_sampler-0.5.32}/ocf_data_sampler/select/fill_time_periods.py +0 -0
- {ocf_data_sampler-0.5.31 → ocf_data_sampler-0.5.32}/ocf_data_sampler/select/find_contiguous_time_periods.py +0 -0
- {ocf_data_sampler-0.5.31 → ocf_data_sampler-0.5.32}/ocf_data_sampler/select/geospatial.py +0 -0
- {ocf_data_sampler-0.5.31 → ocf_data_sampler-0.5.32}/ocf_data_sampler/select/location.py +0 -0
- {ocf_data_sampler-0.5.31 → ocf_data_sampler-0.5.32}/ocf_data_sampler/select/select_spatial_slice.py +0 -0
- {ocf_data_sampler-0.5.31 → ocf_data_sampler-0.5.32}/ocf_data_sampler/select/select_time_slice.py +0 -0
- {ocf_data_sampler-0.5.31 → ocf_data_sampler-0.5.32}/ocf_data_sampler/torch_datasets/datasets/__init__.py +0 -0
- {ocf_data_sampler-0.5.31 → ocf_data_sampler-0.5.32}/ocf_data_sampler/torch_datasets/datasets/picklecache.py +0 -0
- {ocf_data_sampler-0.5.31 → ocf_data_sampler-0.5.32}/ocf_data_sampler/torch_datasets/datasets/pvnet_uk.py +0 -0
- {ocf_data_sampler-0.5.31 → ocf_data_sampler-0.5.32}/ocf_data_sampler/torch_datasets/sample/__init__.py +0 -0
- {ocf_data_sampler-0.5.31 → ocf_data_sampler-0.5.32}/ocf_data_sampler/torch_datasets/sample/base.py +0 -0
- {ocf_data_sampler-0.5.31 → ocf_data_sampler-0.5.32}/ocf_data_sampler/torch_datasets/sample/site.py +0 -0
- {ocf_data_sampler-0.5.31 → ocf_data_sampler-0.5.32}/ocf_data_sampler/torch_datasets/sample/uk_regional.py +0 -0
- {ocf_data_sampler-0.5.31 → ocf_data_sampler-0.5.32}/ocf_data_sampler/torch_datasets/utils/__init__.py +0 -0
- {ocf_data_sampler-0.5.31 → ocf_data_sampler-0.5.32}/ocf_data_sampler/torch_datasets/utils/add_alterate_coordinate_projections.py +0 -0
- {ocf_data_sampler-0.5.31 → ocf_data_sampler-0.5.32}/ocf_data_sampler/torch_datasets/utils/config_normalization_values_to_dicts.py +0 -0
- {ocf_data_sampler-0.5.31 → ocf_data_sampler-0.5.32}/ocf_data_sampler/torch_datasets/utils/diff_nwp_data.py +0 -0
- {ocf_data_sampler-0.5.31 → ocf_data_sampler-0.5.32}/ocf_data_sampler/torch_datasets/utils/merge_and_fill_utils.py +0 -0
- {ocf_data_sampler-0.5.31 → ocf_data_sampler-0.5.32}/ocf_data_sampler/torch_datasets/utils/spatial_slice_for_dataset.py +0 -0
- {ocf_data_sampler-0.5.31 → ocf_data_sampler-0.5.32}/ocf_data_sampler/torch_datasets/utils/time_slice_for_dataset.py +0 -0
- {ocf_data_sampler-0.5.31 → ocf_data_sampler-0.5.32}/ocf_data_sampler/torch_datasets/utils/valid_time_periods.py +0 -0
- {ocf_data_sampler-0.5.31 → ocf_data_sampler-0.5.32}/ocf_data_sampler/torch_datasets/utils/validation_utils.py +0 -0
- {ocf_data_sampler-0.5.31 → ocf_data_sampler-0.5.32}/ocf_data_sampler/utils.py +0 -0
- {ocf_data_sampler-0.5.31 → ocf_data_sampler-0.5.32}/ocf_data_sampler.egg-info/SOURCES.txt +0 -0
- {ocf_data_sampler-0.5.31 → ocf_data_sampler-0.5.32}/ocf_data_sampler.egg-info/dependency_links.txt +0 -0
- {ocf_data_sampler-0.5.31 → ocf_data_sampler-0.5.32}/ocf_data_sampler.egg-info/requires.txt +0 -0
- {ocf_data_sampler-0.5.31 → ocf_data_sampler-0.5.32}/ocf_data_sampler.egg-info/top_level.txt +0 -0
- {ocf_data_sampler-0.5.31 → ocf_data_sampler-0.5.32}/pyproject.toml +0 -0
- {ocf_data_sampler-0.5.31 → ocf_data_sampler-0.5.32}/scripts/download_gsp_location_data.py +0 -0
- {ocf_data_sampler-0.5.31 → ocf_data_sampler-0.5.32}/scripts/refactor_site.py +0 -0
- {ocf_data_sampler-0.5.31 → ocf_data_sampler-0.5.32}/setup.cfg +0 -0
- {ocf_data_sampler-0.5.31 → ocf_data_sampler-0.5.32}/tests/test_utils.py +0 -0
{ocf_data_sampler-0.5.31 → ocf_data_sampler-0.5.32}/ocf_data_sampler/torch_datasets/datasets/site.py
RENAMED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"""Torch dataset for sites."""
|
|
2
2
|
|
|
3
|
-
import numpy as np
|
|
4
3
|
import pandas as pd
|
|
5
4
|
import xarray as xr
|
|
6
5
|
from torch.utils.data import Dataset
|
|
@@ -436,25 +435,3 @@ class SitesDatasetConcurrent(PickleCacheMixin, Dataset):
|
|
|
436
435
|
site_samples.append(site_numpy_sample)
|
|
437
436
|
|
|
438
437
|
return stack_np_samples_into_batch(site_samples)
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
def coarsen_data(xr_data: xr.Dataset, coarsen_to_deg: float = 0.1) -> xr.Dataset:
|
|
442
|
-
"""Coarsen the data to a specified resolution in degrees.
|
|
443
|
-
|
|
444
|
-
Args:
|
|
445
|
-
xr_data: xarray dataset to coarsen
|
|
446
|
-
coarsen_to_deg: resolution to coarsen to in degrees
|
|
447
|
-
"""
|
|
448
|
-
if "latitude" in xr_data.coords and "longitude" in xr_data.coords:
|
|
449
|
-
step = np.abs(xr_data.latitude.values[1] - xr_data.latitude.values[0])
|
|
450
|
-
step = np.round(step, 4)
|
|
451
|
-
coarsen_factor = int(coarsen_to_deg / step)
|
|
452
|
-
if coarsen_factor > 1:
|
|
453
|
-
xr_data = xr_data.coarsen(
|
|
454
|
-
latitude=coarsen_factor,
|
|
455
|
-
longitude=coarsen_factor,
|
|
456
|
-
boundary="pad",
|
|
457
|
-
coord_func="min",
|
|
458
|
-
).mean()
|
|
459
|
-
|
|
460
|
-
return xr_data
|
|
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.31 → ocf_data_sampler-0.5.32}/ocf_data_sampler/load/nwp/providers/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{ocf_data_sampler-0.5.31 → ocf_data_sampler-0.5.32}/ocf_data_sampler/load/nwp/providers/ecmwf.py
RENAMED
|
File without changes
|
{ocf_data_sampler-0.5.31 → ocf_data_sampler-0.5.32}/ocf_data_sampler/load/nwp/providers/gfs.py
RENAMED
|
File without changes
|
{ocf_data_sampler-0.5.31 → ocf_data_sampler-0.5.32}/ocf_data_sampler/load/nwp/providers/icon.py
RENAMED
|
File without changes
|
{ocf_data_sampler-0.5.31 → ocf_data_sampler-0.5.32}/ocf_data_sampler/load/nwp/providers/ukv.py
RENAMED
|
File without changes
|
{ocf_data_sampler-0.5.31 → ocf_data_sampler-0.5.32}/ocf_data_sampler/load/nwp/providers/utils.py
RENAMED
|
File without changes
|
{ocf_data_sampler-0.5.31 → ocf_data_sampler-0.5.32}/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.31 → ocf_data_sampler-0.5.32}/ocf_data_sampler/numpy_sample/__init__.py
RENAMED
|
File without changes
|
{ocf_data_sampler-0.5.31 → ocf_data_sampler-0.5.32}/ocf_data_sampler/numpy_sample/collate.py
RENAMED
|
File without changes
|
{ocf_data_sampler-0.5.31 → ocf_data_sampler-0.5.32}/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.31 → ocf_data_sampler-0.5.32}/ocf_data_sampler/numpy_sample/satellite.py
RENAMED
|
File without changes
|
|
File without changes
|
{ocf_data_sampler-0.5.31 → ocf_data_sampler-0.5.32}/ocf_data_sampler/numpy_sample/sun_position.py
RENAMED
|
File without changes
|
|
File without changes
|
{ocf_data_sampler-0.5.31 → ocf_data_sampler-0.5.32}/ocf_data_sampler/select/diff_channels.py
RENAMED
|
File without changes
|
|
File without changes
|
{ocf_data_sampler-0.5.31 → ocf_data_sampler-0.5.32}/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.31 → ocf_data_sampler-0.5.32}/ocf_data_sampler/select/select_spatial_slice.py
RENAMED
|
File without changes
|
{ocf_data_sampler-0.5.31 → ocf_data_sampler-0.5.32}/ocf_data_sampler/select/select_time_slice.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{ocf_data_sampler-0.5.31 → ocf_data_sampler-0.5.32}/ocf_data_sampler/torch_datasets/sample/base.py
RENAMED
|
File without changes
|
{ocf_data_sampler-0.5.31 → ocf_data_sampler-0.5.32}/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.31 → ocf_data_sampler-0.5.32}/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
|