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

@@ -25,11 +25,20 @@ def open_site(generation_file_path: str, metadata_file_path: str) -> xr.DataArra
25
25
  metadata_df = metadata_df.reindex(generation_ds.site_id.values)
26
26
 
27
27
  # Assign coordinates to the Dataset using the aligned metadata
28
- generation_ds = generation_ds.assign_coords(
29
- latitude=("site_id", metadata_df["latitude"].values),
30
- longitude=("site_id", metadata_df["longitude"].values),
31
- capacity_kwp=("site_id", metadata_df["capacity_kwp"].values),
32
- )
28
+ # Check if variable capacity was passed with the generation data
29
+ # If not assign static capacity from metadata
30
+ if hasattr(generation_ds,"capacity_kwp"):
31
+ generation_ds = generation_ds.assign_coords(
32
+ latitude=(metadata_df.latitude.to_xarray()),
33
+ longitude=(metadata_df.longitude.to_xarray()),
34
+ capacity_kwp=generation_ds.capacity_kwp,
35
+ )
36
+ else:
37
+ generation_ds = generation_ds.assign_coords(
38
+ latitude=(metadata_df.latitude.to_xarray()),
39
+ longitude=(metadata_df.longitude.to_xarray()),
40
+ capacity_kwp=(metadata_df.capacity_kwp.to_xarray()),
41
+ )
33
42
 
34
43
  # Sanity checks, to prevent inf or negative values
35
44
  # Note NaNs are allowed in generation_kw as can have non overlapping time periods for sites
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ocf-data-sampler
3
- Version: 0.6.0
3
+ Version: 0.6.1
4
4
  Author: James Fulton, Peter Dudfield
5
5
  Author-email: Open Climate Fix team <info@openclimatefix.org>
6
6
  License: MIT License
@@ -11,7 +11,7 @@ ocf_data_sampler/load/gsp.py,sha256=zsQ39dZBS45qd86lGfCZUjheLRTtMzIUozj-j8c87UQ,
11
11
  ocf_data_sampler/load/load_dataset.py,sha256=K8rWykjII-3g127If7WRRFivzHNx3SshCvZj4uQlf28,2089
12
12
  ocf_data_sampler/load/open_xarray_tensorstore.py,sha256=YglCBeKa4mSjUU5qlcMOLZXUtFrPFWVKDeKHLjs_YbA,6353
13
13
  ocf_data_sampler/load/satellite.py,sha256=5o5SfcplQfZFlm3JJq73j8_m_cWKpFtKk0tTKGjjCuE,1856
14
- ocf_data_sampler/load/site.py,sha256=bpFABjpvlstn6yJ6OPVlPZms-CjJdxNwCkQafpnj0Ik,2539
14
+ ocf_data_sampler/load/site.py,sha256=ZH85pgLTXTxa8zPHdJ-Y9Yy2ORDc3vRX2uD1I6uDI6g,2939
15
15
  ocf_data_sampler/load/utils.py,sha256=AGL0aOOQPrgqNBTjlBtR7Qg1PyQov3DFJo-y198u8pY,2044
16
16
  ocf_data_sampler/load/nwp/__init__.py,sha256=SmcrnbygO5xtCKmGR4wtHrj-HI7nOAvnAtfuvRufBGQ,25
17
17
  ocf_data_sampler/load/nwp/nwp.py,sha256=3nAsbw2yjmaF0YEHbCDciPLuIRBGxGuvixlMgKNc3zU,3570
@@ -56,7 +56,7 @@ ocf_data_sampler/torch_datasets/utils/valid_time_periods.py,sha256=xcy75cVxl0Wrg
56
56
  ocf_data_sampler/torch_datasets/utils/validation_utils.py,sha256=YqmT-lExWlI8_ul3l0EP73Ik002fStr_bhsZh9mQqEU,4735
57
57
  scripts/download_gsp_location_data.py,sha256=rRDXMoqX-RYY4jPdxhdlxJGhWdl6r245F5UARgKV6P4,3121
58
58
  scripts/refactor_site.py,sha256=skzvsPP0Cn9yTKndzkilyNcGz4DZ88ctvCJ0XrBdc2A,3135
59
- ocf_data_sampler-0.6.0.dist-info/METADATA,sha256=63oH1Bpoqx_nYHbHuqv4LYcnHBln8o3ixBDLV9hnmOo,13540
60
- ocf_data_sampler-0.6.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
61
- ocf_data_sampler-0.6.0.dist-info/top_level.txt,sha256=deUxqmsONNAGZDNbsntbXH7BRA1MqWaUeAJrCo6q_xA,25
62
- ocf_data_sampler-0.6.0.dist-info/RECORD,,
59
+ ocf_data_sampler-0.6.1.dist-info/METADATA,sha256=w0MKJCWR-a9VPWtGxWVP3_h2t5-V4ny1PiofevouGHY,13540
60
+ ocf_data_sampler-0.6.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
61
+ ocf_data_sampler-0.6.1.dist-info/top_level.txt,sha256=deUxqmsONNAGZDNbsntbXH7BRA1MqWaUeAJrCo6q_xA,25
62
+ ocf_data_sampler-0.6.1.dist-info/RECORD,,