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

@@ -1,5 +1,6 @@
1
1
  """Utility functions for working with xarray objects."""
2
2
 
3
+ import numpy as np
3
4
  import pandas as pd
4
5
  import xarray as xr
5
6
 
@@ -22,8 +23,12 @@ def make_spatial_coords_increasing(ds: xr.Dataset, x_coord: str, y_coord: str) -
22
23
  # Make sure the coords are in increasing order
23
24
  if ds[x_coord][0] > ds[x_coord][-1]:
24
25
  ds = ds.isel({x_coord: slice(None, None, -1)})
26
+ # Below we the coord values so we don't have numpy array with negative strides
27
+ # Numpy arrays with negative strides cannot be converted to torch Tensor
28
+ ds[x_coord] = np.ascontiguousarray(ds[x_coord].values)
25
29
  if ds[y_coord][0] > ds[y_coord][-1]:
26
30
  ds = ds.isel({y_coord: slice(None, None, -1)})
31
+ ds[y_coord] = np.ascontiguousarray(ds[y_coord].values)
27
32
 
28
33
  # Check the coords are all increasing now
29
34
  if not (ds[x_coord].diff(dim=x_coord) > 0).all():
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: ocf-data-sampler
3
- Version: 0.2.4
3
+ Version: 0.2.5
4
4
  Author: James Fulton, Peter Dudfield
5
5
  Author-email: Open Climate Fix team <info@openclimatefix.org>
6
6
  License: MIT License
@@ -10,7 +10,7 @@ ocf_data_sampler/load/gsp.py,sha256=keB3Nv_CNK1P6pS9Kdfc8PoZXTI1_YFN-spsvEv_Ewc,
10
10
  ocf_data_sampler/load/load_dataset.py,sha256=0NyDxCDfgE_esKVW3s-rZEe16WB30FQ74ClWlrIo72M,1602
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
- ocf_data_sampler/load/utils.py,sha256=Jwbr1rpEa3cefjw-OTVRaxnIHyGixYB3TlTlta0BOdU,1727
13
+ ocf_data_sampler/load/utils.py,sha256=sZ0-zzconcLkVQwAkCYrqKDo98Hrh5ChdiQJv5Bh91g,2040
14
14
  ocf_data_sampler/load/nwp/__init__.py,sha256=SmcrnbygO5xtCKmGR4wtHrj-HI7nOAvnAtfuvRufBGQ,25
15
15
  ocf_data_sampler/load/nwp/nwp.py,sha256=OUK6thsKfEcqGUj4WoxDiyqGcVwwoujePdmQRis8H8I,1076
16
16
  ocf_data_sampler/load/nwp/providers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -52,7 +52,7 @@ ocf_data_sampler/torch_datasets/utils/merge_and_fill_utils.py,sha256=we7BTxRH7B7
52
52
  ocf_data_sampler/torch_datasets/utils/valid_time_periods.py,sha256=xcy75cVxl0WrglnX5YUAFjXXlO2GwEBHWyqo8TDuiOA,4714
53
53
  scripts/refactor_site.py,sha256=skzvsPP0Cn9yTKndzkilyNcGz4DZ88ctvCJ0XrBdc2A,3135
54
54
  utils/compute_icon_mean_stddev.py,sha256=a1oWMRMnny39rV-dvu8rcx85sb4bXzPFrR1gkUr4Jpg,2296
55
- ocf_data_sampler-0.2.4.dist-info/METADATA,sha256=FC4sEcGWlkOdXRxqoiln0f-aYqXa5c9bRt7nVeNVuBI,11594
56
- ocf_data_sampler-0.2.4.dist-info/WHEEL,sha256=52BFRY2Up02UkjOa29eZOS2VxUrpPORXg1pkohGGUS8,91
57
- ocf_data_sampler-0.2.4.dist-info/top_level.txt,sha256=LEFU4Uk-PEo72QGLAfnVZIUEm37Q8mKuMeg_Xk-p33g,31
58
- ocf_data_sampler-0.2.4.dist-info/RECORD,,
55
+ ocf_data_sampler-0.2.5.dist-info/METADATA,sha256=1UkNAa8EWbFSGJZT8GHg6ZzhxaPmaNJRXFEsA9yJals,11594
56
+ ocf_data_sampler-0.2.5.dist-info/WHEEL,sha256=52BFRY2Up02UkjOa29eZOS2VxUrpPORXg1pkohGGUS8,91
57
+ ocf_data_sampler-0.2.5.dist-info/top_level.txt,sha256=LEFU4Uk-PEo72QGLAfnVZIUEm37Q8mKuMeg_Xk-p33g,31
58
+ ocf_data_sampler-0.2.5.dist-info/RECORD,,