ocf-data-sampler 0.0.35__tar.gz → 0.0.36__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.0.35/ocf_data_sampler.egg-info → ocf_data_sampler-0.0.36}/PKG-INFO +1 -1
- ocf_data_sampler-0.0.36/ocf_data_sampler/numpy_batch/site.py +29 -0
- {ocf_data_sampler-0.0.35 → ocf_data_sampler-0.0.36/ocf_data_sampler.egg-info}/PKG-INFO +1 -1
- {ocf_data_sampler-0.0.35 → ocf_data_sampler-0.0.36}/pyproject.toml +1 -1
- ocf_data_sampler-0.0.35/ocf_data_sampler/numpy_batch/site.py +0 -29
- {ocf_data_sampler-0.0.35 → ocf_data_sampler-0.0.36}/LICENSE +0 -0
- {ocf_data_sampler-0.0.35 → ocf_data_sampler-0.0.36}/MANIFEST.in +0 -0
- {ocf_data_sampler-0.0.35 → ocf_data_sampler-0.0.36}/README.md +0 -0
- {ocf_data_sampler-0.0.35 → ocf_data_sampler-0.0.36}/ocf_data_sampler/__init__.py +0 -0
- {ocf_data_sampler-0.0.35 → ocf_data_sampler-0.0.36}/ocf_data_sampler/config/__init__.py +0 -0
- {ocf_data_sampler-0.0.35 → ocf_data_sampler-0.0.36}/ocf_data_sampler/config/load.py +0 -0
- {ocf_data_sampler-0.0.35 → ocf_data_sampler-0.0.36}/ocf_data_sampler/config/model.py +0 -0
- {ocf_data_sampler-0.0.35 → ocf_data_sampler-0.0.36}/ocf_data_sampler/config/save.py +0 -0
- {ocf_data_sampler-0.0.35 → ocf_data_sampler-0.0.36}/ocf_data_sampler/constants.py +0 -0
- {ocf_data_sampler-0.0.35 → ocf_data_sampler-0.0.36}/ocf_data_sampler/data/uk_gsp_locations.csv +0 -0
- {ocf_data_sampler-0.0.35 → ocf_data_sampler-0.0.36}/ocf_data_sampler/load/__init__.py +0 -0
- {ocf_data_sampler-0.0.35 → ocf_data_sampler-0.0.36}/ocf_data_sampler/load/gsp.py +0 -0
- {ocf_data_sampler-0.0.35 → ocf_data_sampler-0.0.36}/ocf_data_sampler/load/load_dataset.py +0 -0
- {ocf_data_sampler-0.0.35 → ocf_data_sampler-0.0.36}/ocf_data_sampler/load/nwp/__init__.py +0 -0
- {ocf_data_sampler-0.0.35 → ocf_data_sampler-0.0.36}/ocf_data_sampler/load/nwp/nwp.py +0 -0
- {ocf_data_sampler-0.0.35 → ocf_data_sampler-0.0.36}/ocf_data_sampler/load/nwp/providers/__init__.py +0 -0
- {ocf_data_sampler-0.0.35 → ocf_data_sampler-0.0.36}/ocf_data_sampler/load/nwp/providers/ecmwf.py +0 -0
- {ocf_data_sampler-0.0.35 → ocf_data_sampler-0.0.36}/ocf_data_sampler/load/nwp/providers/ukv.py +0 -0
- {ocf_data_sampler-0.0.35 → ocf_data_sampler-0.0.36}/ocf_data_sampler/load/nwp/providers/utils.py +0 -0
- {ocf_data_sampler-0.0.35 → ocf_data_sampler-0.0.36}/ocf_data_sampler/load/satellite.py +0 -0
- {ocf_data_sampler-0.0.35 → ocf_data_sampler-0.0.36}/ocf_data_sampler/load/site.py +0 -0
- {ocf_data_sampler-0.0.35 → ocf_data_sampler-0.0.36}/ocf_data_sampler/load/utils.py +0 -0
- {ocf_data_sampler-0.0.35 → ocf_data_sampler-0.0.36}/ocf_data_sampler/numpy_batch/__init__.py +0 -0
- {ocf_data_sampler-0.0.35 → ocf_data_sampler-0.0.36}/ocf_data_sampler/numpy_batch/gsp.py +0 -0
- {ocf_data_sampler-0.0.35 → ocf_data_sampler-0.0.36}/ocf_data_sampler/numpy_batch/nwp.py +0 -0
- {ocf_data_sampler-0.0.35 → ocf_data_sampler-0.0.36}/ocf_data_sampler/numpy_batch/satellite.py +0 -0
- {ocf_data_sampler-0.0.35 → ocf_data_sampler-0.0.36}/ocf_data_sampler/numpy_batch/sun_position.py +0 -0
- {ocf_data_sampler-0.0.35 → ocf_data_sampler-0.0.36}/ocf_data_sampler/select/__init__.py +0 -0
- {ocf_data_sampler-0.0.35 → ocf_data_sampler-0.0.36}/ocf_data_sampler/select/dropout.py +0 -0
- {ocf_data_sampler-0.0.35 → ocf_data_sampler-0.0.36}/ocf_data_sampler/select/fill_time_periods.py +0 -0
- {ocf_data_sampler-0.0.35 → ocf_data_sampler-0.0.36}/ocf_data_sampler/select/find_contiguous_time_periods.py +0 -0
- {ocf_data_sampler-0.0.35 → ocf_data_sampler-0.0.36}/ocf_data_sampler/select/geospatial.py +0 -0
- {ocf_data_sampler-0.0.35 → ocf_data_sampler-0.0.36}/ocf_data_sampler/select/location.py +0 -0
- {ocf_data_sampler-0.0.35 → ocf_data_sampler-0.0.36}/ocf_data_sampler/select/select_spatial_slice.py +0 -0
- {ocf_data_sampler-0.0.35 → ocf_data_sampler-0.0.36}/ocf_data_sampler/select/select_time_slice.py +0 -0
- {ocf_data_sampler-0.0.35 → ocf_data_sampler-0.0.36}/ocf_data_sampler/select/spatial_slice_for_dataset.py +0 -0
- {ocf_data_sampler-0.0.35 → ocf_data_sampler-0.0.36}/ocf_data_sampler/select/time_slice_for_dataset.py +0 -0
- {ocf_data_sampler-0.0.35 → ocf_data_sampler-0.0.36}/ocf_data_sampler/torch_datasets/__init__.py +0 -0
- {ocf_data_sampler-0.0.35 → ocf_data_sampler-0.0.36}/ocf_data_sampler/torch_datasets/process_and_combine.py +0 -0
- {ocf_data_sampler-0.0.35 → ocf_data_sampler-0.0.36}/ocf_data_sampler/torch_datasets/pvnet_uk_regional.py +0 -0
- {ocf_data_sampler-0.0.35 → ocf_data_sampler-0.0.36}/ocf_data_sampler/torch_datasets/site.py +0 -0
- {ocf_data_sampler-0.0.35 → ocf_data_sampler-0.0.36}/ocf_data_sampler/torch_datasets/valid_time_periods.py +0 -0
- {ocf_data_sampler-0.0.35 → ocf_data_sampler-0.0.36}/ocf_data_sampler/utils.py +0 -0
- {ocf_data_sampler-0.0.35 → ocf_data_sampler-0.0.36}/ocf_data_sampler.egg-info/SOURCES.txt +0 -0
- {ocf_data_sampler-0.0.35 → ocf_data_sampler-0.0.36}/ocf_data_sampler.egg-info/dependency_links.txt +0 -0
- {ocf_data_sampler-0.0.35 → ocf_data_sampler-0.0.36}/ocf_data_sampler.egg-info/requires.txt +0 -0
- {ocf_data_sampler-0.0.35 → ocf_data_sampler-0.0.36}/ocf_data_sampler.egg-info/top_level.txt +0 -0
- {ocf_data_sampler-0.0.35 → ocf_data_sampler-0.0.36}/scripts/refactor_site.py +0 -0
- {ocf_data_sampler-0.0.35 → ocf_data_sampler-0.0.36}/setup.cfg +0 -0
- {ocf_data_sampler-0.0.35 → ocf_data_sampler-0.0.36}/tests/__init__.py +0 -0
- {ocf_data_sampler-0.0.35 → ocf_data_sampler-0.0.36}/tests/config/test_config.py +0 -0
- {ocf_data_sampler-0.0.35 → ocf_data_sampler-0.0.36}/tests/conftest.py +0 -0
- {ocf_data_sampler-0.0.35 → ocf_data_sampler-0.0.36}/tests/load/test_load_gsp.py +0 -0
- {ocf_data_sampler-0.0.35 → ocf_data_sampler-0.0.36}/tests/load/test_load_nwp.py +0 -0
- {ocf_data_sampler-0.0.35 → ocf_data_sampler-0.0.36}/tests/load/test_load_satellite.py +0 -0
- {ocf_data_sampler-0.0.35 → ocf_data_sampler-0.0.36}/tests/load/test_load_sites.py +0 -0
- {ocf_data_sampler-0.0.35 → ocf_data_sampler-0.0.36}/tests/numpy_batch/test_gsp.py +0 -0
- {ocf_data_sampler-0.0.35 → ocf_data_sampler-0.0.36}/tests/numpy_batch/test_nwp.py +0 -0
- {ocf_data_sampler-0.0.35 → ocf_data_sampler-0.0.36}/tests/numpy_batch/test_satellite.py +0 -0
- {ocf_data_sampler-0.0.35 → ocf_data_sampler-0.0.36}/tests/numpy_batch/test_sun_position.py +0 -0
- {ocf_data_sampler-0.0.35 → ocf_data_sampler-0.0.36}/tests/select/test_dropout.py +0 -0
- {ocf_data_sampler-0.0.35 → ocf_data_sampler-0.0.36}/tests/select/test_fill_time_periods.py +0 -0
- {ocf_data_sampler-0.0.35 → ocf_data_sampler-0.0.36}/tests/select/test_find_contiguous_time_periods.py +0 -0
- {ocf_data_sampler-0.0.35 → ocf_data_sampler-0.0.36}/tests/select/test_location.py +0 -0
- {ocf_data_sampler-0.0.35 → ocf_data_sampler-0.0.36}/tests/select/test_select_spatial_slice.py +0 -0
- {ocf_data_sampler-0.0.35 → ocf_data_sampler-0.0.36}/tests/select/test_select_time_slice.py +0 -0
- {ocf_data_sampler-0.0.35 → ocf_data_sampler-0.0.36}/tests/torch_datasets/test_pvnet_uk_regional.py +0 -0
- {ocf_data_sampler-0.0.35 → ocf_data_sampler-0.0.36}/tests/torch_datasets/test_site.py +0 -0
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"""Convert site to Numpy Batch"""
|
|
2
|
+
|
|
3
|
+
import xarray as xr
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class SiteBatchKey:
|
|
7
|
+
|
|
8
|
+
generation = "site"
|
|
9
|
+
capacity_kwp = "site_capacity_kwp"
|
|
10
|
+
time_utc = "site_time_utc"
|
|
11
|
+
t0_idx = "site_t0_idx"
|
|
12
|
+
solar_azimuth = "site_solar_azimuth"
|
|
13
|
+
solar_elevation = "site_solar_elevation"
|
|
14
|
+
id = "site_id"
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def convert_site_to_numpy_batch(da: xr.DataArray, t0_idx: int | None = None) -> dict:
|
|
18
|
+
"""Convert from Xarray to NumpyBatch"""
|
|
19
|
+
|
|
20
|
+
example = {
|
|
21
|
+
SiteBatchKey.generation: da.values,
|
|
22
|
+
SiteBatchKey.capacity_kwp: da.isel(time_utc=0)["capacity_kwp"].values,
|
|
23
|
+
SiteBatchKey.time_utc: da["time_utc"].values.astype(float),
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
if t0_idx is not None:
|
|
27
|
+
example[SiteBatchKey.t0_idx] = t0_idx
|
|
28
|
+
|
|
29
|
+
return example
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
"""Convert site to Numpy Batch"""
|
|
2
|
-
|
|
3
|
-
import xarray as xr
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
class SiteBatchKey:
|
|
7
|
-
|
|
8
|
-
generation = "site"
|
|
9
|
-
site_capacity_kwp = "site_capacity_kwp"
|
|
10
|
-
site_time_utc = "site_time_utc"
|
|
11
|
-
site_t0_idx = "site_t0_idx"
|
|
12
|
-
site_solar_azimuth = "site_solar_azimuth"
|
|
13
|
-
site_solar_elevation = "site_solar_elevation"
|
|
14
|
-
site_id = "site_id"
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
def convert_site_to_numpy_batch(da: xr.DataArray, t0_idx: int | None = None) -> dict:
|
|
18
|
-
"""Convert from Xarray to NumpyBatch"""
|
|
19
|
-
|
|
20
|
-
example = {
|
|
21
|
-
SiteBatchKey.generation: da.values,
|
|
22
|
-
SiteBatchKey.site_capacity_kwp: da.isel(time_utc=0)["capacity_kwp"].values,
|
|
23
|
-
SiteBatchKey.site_time_utc: da["time_utc"].values.astype(float),
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
if t0_idx is not None:
|
|
27
|
-
example[SiteBatchKey.site_t0_idx] = t0_idx
|
|
28
|
-
|
|
29
|
-
return example
|
|
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.0.35 → ocf_data_sampler-0.0.36}/ocf_data_sampler/data/uk_gsp_locations.csv
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{ocf_data_sampler-0.0.35 → ocf_data_sampler-0.0.36}/ocf_data_sampler/load/nwp/providers/__init__.py
RENAMED
|
File without changes
|
{ocf_data_sampler-0.0.35 → ocf_data_sampler-0.0.36}/ocf_data_sampler/load/nwp/providers/ecmwf.py
RENAMED
|
File without changes
|
{ocf_data_sampler-0.0.35 → ocf_data_sampler-0.0.36}/ocf_data_sampler/load/nwp/providers/ukv.py
RENAMED
|
File without changes
|
{ocf_data_sampler-0.0.35 → ocf_data_sampler-0.0.36}/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.0.35 → ocf_data_sampler-0.0.36}/ocf_data_sampler/numpy_batch/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{ocf_data_sampler-0.0.35 → ocf_data_sampler-0.0.36}/ocf_data_sampler/numpy_batch/satellite.py
RENAMED
|
File without changes
|
{ocf_data_sampler-0.0.35 → ocf_data_sampler-0.0.36}/ocf_data_sampler/numpy_batch/sun_position.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{ocf_data_sampler-0.0.35 → ocf_data_sampler-0.0.36}/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.0.35 → ocf_data_sampler-0.0.36}/ocf_data_sampler/select/select_spatial_slice.py
RENAMED
|
File without changes
|
{ocf_data_sampler-0.0.35 → ocf_data_sampler-0.0.36}/ocf_data_sampler/select/select_time_slice.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{ocf_data_sampler-0.0.35 → ocf_data_sampler-0.0.36}/ocf_data_sampler/torch_datasets/__init__.py
RENAMED
|
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.0.35 → ocf_data_sampler-0.0.36}/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
|
|
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.0.35 → ocf_data_sampler-0.0.36}/tests/select/test_select_spatial_slice.py
RENAMED
|
File without changes
|
|
File without changes
|
{ocf_data_sampler-0.0.35 → ocf_data_sampler-0.0.36}/tests/torch_datasets/test_pvnet_uk_regional.py
RENAMED
|
File without changes
|
|
File without changes
|