ocf-data-sampler 0.2.23__py3-none-any.whl → 0.2.24__py3-none-any.whl
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/config/model.py +2 -0
- ocf_data_sampler/load/gsp.py +12 -2
- ocf_data_sampler/load/load_dataset.py +1 -0
- {ocf_data_sampler-0.2.23.dist-info → ocf_data_sampler-0.2.24.dist-info}/METADATA +1 -1
- {ocf_data_sampler-0.2.23.dist-info → ocf_data_sampler-0.2.24.dist-info}/RECORD +7 -7
- {ocf_data_sampler-0.2.23.dist-info → ocf_data_sampler-0.2.24.dist-info}/WHEEL +1 -1
- {ocf_data_sampler-0.2.23.dist-info → ocf_data_sampler-0.2.24.dist-info}/top_level.txt +0 -0
ocf_data_sampler/config/model.py
CHANGED
|
@@ -291,6 +291,8 @@ class GSP(TimeWindowMixin, DropoutMixin):
|
|
|
291
291
|
description="Version of the GSP boundaries to use. Options are '20220314' or '20250109'.",
|
|
292
292
|
)
|
|
293
293
|
|
|
294
|
+
public: bool = Field(False, description="Whether the NWP data is public or private")
|
|
295
|
+
|
|
294
296
|
|
|
295
297
|
class Site(TimeWindowMixin, DropoutMixin):
|
|
296
298
|
"""Site configuration model."""
|
ocf_data_sampler/load/gsp.py
CHANGED
|
@@ -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.",
|
|
@@ -2,13 +2,13 @@ ocf_data_sampler/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,
|
|
|
2
2
|
ocf_data_sampler/utils.py,sha256=DjuneGGisl08ENvPZV_lrcX4b2NCKJC1ZpXgIpxuQi4,290
|
|
3
3
|
ocf_data_sampler/config/__init__.py,sha256=O29mbH0XG2gIY1g3BaveGCnpBO2SFqdu-qzJ7a6evl0,223
|
|
4
4
|
ocf_data_sampler/config/load.py,sha256=LL-7wemI8o4KPkx35j-wQ3HjsMvDgqXr7G46IcASfnU,632
|
|
5
|
-
ocf_data_sampler/config/model.py,sha256=
|
|
5
|
+
ocf_data_sampler/config/model.py,sha256=UwVQOjRBthbwhAWR5Rcs5cSXG3imLZ5pnd8vBeFseLE,10623
|
|
6
6
|
ocf_data_sampler/config/save.py,sha256=m8SPw5rXjkMm1rByjh3pK5StdBi4e8ysnn3jQopdRaI,1064
|
|
7
7
|
ocf_data_sampler/data/uk_gsp_locations_20220314.csv,sha256=RSh7DRh55E3n8lVAaWXGTaXXHevZZtI58td4d4DhGos,10415772
|
|
8
8
|
ocf_data_sampler/data/uk_gsp_locations_20250109.csv,sha256=XZISFatnbpO9j8LwaxNKFzQSjs6hcHFsV8a9uDDpy2E,9055334
|
|
9
9
|
ocf_data_sampler/load/__init__.py,sha256=-vQP9g0UOWdVbjEGyVX_ipa7R1btmiETIKAf6aw4d78,201
|
|
10
|
-
ocf_data_sampler/load/gsp.py,sha256=
|
|
11
|
-
ocf_data_sampler/load/load_dataset.py,sha256=
|
|
10
|
+
ocf_data_sampler/load/gsp.py,sha256=winSW3ibFbpsOr0ZRIjYUlqSW5C6SUb0dxkRZm3E8GI,2195
|
|
11
|
+
ocf_data_sampler/load/load_dataset.py,sha256=WjB3DvHbDQQYYnPmDFOWg_TQPgARZ5pu8fiRZSGtIg0,2099
|
|
12
12
|
ocf_data_sampler/load/satellite.py,sha256=E7Ln7Y60Qr1RTV-_R71YoxXQM-Ca7Y1faIo3oKB2eFk,2292
|
|
13
13
|
ocf_data_sampler/load/site.py,sha256=zOzlWk6pYZBB5daqG8URGksmDXWKrkutUvN8uALAIh8,1468
|
|
14
14
|
ocf_data_sampler/load/utils.py,sha256=sZ0-zzconcLkVQwAkCYrqKDo98Hrh5ChdiQJv5Bh91g,2040
|
|
@@ -55,7 +55,7 @@ ocf_data_sampler/torch_datasets/utils/validation_utils.py,sha256=YqmT-lExWlI8_ul
|
|
|
55
55
|
scripts/download_gsp_location_data.py,sha256=rRDXMoqX-RYY4jPdxhdlxJGhWdl6r245F5UARgKV6P4,3121
|
|
56
56
|
scripts/refactor_site.py,sha256=skzvsPP0Cn9yTKndzkilyNcGz4DZ88ctvCJ0XrBdc2A,3135
|
|
57
57
|
utils/compute_icon_mean_stddev.py,sha256=a1oWMRMnny39rV-dvu8rcx85sb4bXzPFrR1gkUr4Jpg,2296
|
|
58
|
-
ocf_data_sampler-0.2.
|
|
59
|
-
ocf_data_sampler-0.2.
|
|
60
|
-
ocf_data_sampler-0.2.
|
|
61
|
-
ocf_data_sampler-0.2.
|
|
58
|
+
ocf_data_sampler-0.2.24.dist-info/METADATA,sha256=rPJ5HMrKkE6dQwew9Z6n8cUpTCfq-egffPAh8Dic49w,11581
|
|
59
|
+
ocf_data_sampler-0.2.24.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
60
|
+
ocf_data_sampler-0.2.24.dist-info/top_level.txt,sha256=LEFU4Uk-PEo72QGLAfnVZIUEm37Q8mKuMeg_Xk-p33g,31
|
|
61
|
+
ocf_data_sampler-0.2.24.dist-info/RECORD,,
|
|
File without changes
|