ocf-data-sampler 0.2.14__py3-none-any.whl → 0.2.15__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.

@@ -6,20 +6,28 @@ from ocf_data_sampler.config import InputData
6
6
  from ocf_data_sampler.load import open_gsp, open_nwp, open_sat_data, open_site
7
7
 
8
8
 
9
- def get_dataset_dict(input_config: InputData) -> dict[str, dict[xr.DataArray] | xr.DataArray]:
9
+ def get_dataset_dict(input_config: InputData, gsp_ids: list[int] | None = None)\
10
+ -> dict[str, dict[xr.DataArray] | xr.DataArray]:
10
11
  """Construct dictionary of all of the input data sources.
11
12
 
12
13
  Args:
13
14
  input_config: InputData configuration object
15
+ gsp_ids: List of GSP IDs to load. If None, all GSPs are loaded (not National).
14
16
  """
15
17
  datasets_dict = {}
16
18
 
17
19
  # Load GSP data unless the path is None
18
20
  if input_config.gsp and input_config.gsp.zarr_path:
21
+
19
22
  da_gsp = open_gsp(zarr_path=input_config.gsp.zarr_path).compute()
20
23
 
21
- # Remove national GSP
22
- datasets_dict["gsp"] = da_gsp.sel(gsp_id=slice(1, None))
24
+ if gsp_ids is None:
25
+ # Remove national (gsp_id=0)
26
+ da_gsp = da_gsp.sel(gsp_id=slice(1, None))
27
+ else:
28
+ da_gsp = da_gsp.sel(gsp_id=gsp_ids)
29
+
30
+ datasets_dict["gsp"] = da_gsp
23
31
 
24
32
  # Load NWP data if in config
25
33
  if input_config.nwp:
@@ -95,7 +95,7 @@ class AbstractPVNetUKDataset(Dataset):
95
95
  gsp_ids: List of GSP IDs to create samples for. Defaults to all
96
96
  """
97
97
  config = load_yaml_configuration(config_filename)
98
- datasets_dict = get_dataset_dict(config.input_data)
98
+ datasets_dict = get_dataset_dict(config.input_data, gsp_ids=gsp_ids)
99
99
 
100
100
  # Get t0 times where all input data is available
101
101
  valid_t0_times = self.find_valid_t0_times(datasets_dict, config)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ocf-data-sampler
3
- Version: 0.2.14
3
+ Version: 0.2.15
4
4
  Author: James Fulton, Peter Dudfield
5
5
  Author-email: Open Climate Fix team <info@openclimatefix.org>
6
6
  License: MIT License
@@ -7,7 +7,7 @@ ocf_data_sampler/config/save.py,sha256=m8SPw5rXjkMm1rByjh3pK5StdBi4e8ysnn3jQopdR
7
7
  ocf_data_sampler/data/uk_gsp_locations.csv,sha256=RSh7DRh55E3n8lVAaWXGTaXXHevZZtI58td4d4DhGos,10415772
8
8
  ocf_data_sampler/load/__init__.py,sha256=-vQP9g0UOWdVbjEGyVX_ipa7R1btmiETIKAf6aw4d78,201
9
9
  ocf_data_sampler/load/gsp.py,sha256=keB3Nv_CNK1P6pS9Kdfc8PoZXTI1_YFN-spsvEv_Ewc,899
10
- ocf_data_sampler/load/load_dataset.py,sha256=0NyDxCDfgE_esKVW3s-rZEe16WB30FQ74ClWlrIo72M,1602
10
+ ocf_data_sampler/load/load_dataset.py,sha256=Cn-yz7RgHR2HkH3xQM1njivVEkp8rZC3KXXgcidwuME,1863
11
11
  ocf_data_sampler/load/satellite.py,sha256=E7Ln7Y60Qr1RTV-_R71YoxXQM-Ca7Y1faIo3oKB2eFk,2292
12
12
  ocf_data_sampler/load/site.py,sha256=zOzlWk6pYZBB5daqG8URGksmDXWKrkutUvN8uALAIh8,1468
13
13
  ocf_data_sampler/load/utils.py,sha256=sZ0-zzconcLkVQwAkCYrqKDo98Hrh5ChdiQJv5Bh91g,2040
@@ -38,7 +38,7 @@ ocf_data_sampler/select/location.py,sha256=AZvGR8y62opiW7zACGXjoOtBEWRfSLOZIA73O
38
38
  ocf_data_sampler/select/select_spatial_slice.py,sha256=liAqIa-Amj58pOqx5r16i99HURj9oQ41j7gnPgRDQP4,8201
39
39
  ocf_data_sampler/select/select_time_slice.py,sha256=HeHbwZ0CP03x0-LaJtpbSdtpLufwVTR73p6wH6O_PS8,5513
40
40
  ocf_data_sampler/torch_datasets/datasets/__init__.py,sha256=jfJSFcR0eO1AqeH7S3KnGjsBqVZT5w3oyi784PUR6Q0,146
41
- ocf_data_sampler/torch_datasets/datasets/pvnet_uk.py,sha256=tx5Sg64eknhU6VIcONiAaG2PurN6Y8Te6rE3AaWg8t4,12338
41
+ ocf_data_sampler/torch_datasets/datasets/pvnet_uk.py,sha256=9BJ4wVcZUMEzStVCbbWrf2eK8WPpV9SoeOQviZktHAc,12355
42
42
  ocf_data_sampler/torch_datasets/datasets/site.py,sha256=nRUlhXQQGVrTuBmE1QnwXAUsPTXz0dsezlQjwK71jIQ,17641
43
43
  ocf_data_sampler/torch_datasets/sample/__init__.py,sha256=GL84vdZl_SjHDGVyh9Uekx2XhPYuZ0dnO3l6f6KXnHI,100
44
44
  ocf_data_sampler/torch_datasets/sample/base.py,sha256=cQ1oIyhdmlotejZK8B3Cw6MNvpdnBPD8G_o2h7Ye4Vc,2206
@@ -53,7 +53,7 @@ ocf_data_sampler/torch_datasets/utils/valid_time_periods.py,sha256=xcy75cVxl0Wrg
53
53
  ocf_data_sampler/torch_datasets/utils/validation_utils.py,sha256=2fwW-kpsMM2a-FWBG0YBT_r2LDIhhn7WokQ7GWvgx6U,3504
54
54
  scripts/refactor_site.py,sha256=skzvsPP0Cn9yTKndzkilyNcGz4DZ88ctvCJ0XrBdc2A,3135
55
55
  utils/compute_icon_mean_stddev.py,sha256=a1oWMRMnny39rV-dvu8rcx85sb4bXzPFrR1gkUr4Jpg,2296
56
- ocf_data_sampler-0.2.14.dist-info/METADATA,sha256=fb2tvDSt9FrsJBD8mZvjJ8YwTgp3OfUjavuZda3cblA,11581
57
- ocf_data_sampler-0.2.14.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
58
- ocf_data_sampler-0.2.14.dist-info/top_level.txt,sha256=LEFU4Uk-PEo72QGLAfnVZIUEm37Q8mKuMeg_Xk-p33g,31
59
- ocf_data_sampler-0.2.14.dist-info/RECORD,,
56
+ ocf_data_sampler-0.2.15.dist-info/METADATA,sha256=tg-DIt5MElINQMTTHFhKuzAbgUB9slyRCDDE-xzaDkc,11581
57
+ ocf_data_sampler-0.2.15.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
58
+ ocf_data_sampler-0.2.15.dist-info/top_level.txt,sha256=LEFU4Uk-PEo72QGLAfnVZIUEm37Q8mKuMeg_Xk-p33g,31
59
+ ocf_data_sampler-0.2.15.dist-info/RECORD,,