Skip to content

Commit

Permalink
mlclouds version bump. warning in collection
Browse files Browse the repository at this point in the history
  • Loading branch information
bnb32 committed Oct 28, 2024
1 parent 50a59bd commit e815c42
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
12 changes: 11 additions & 1 deletion nsrdb/file_handlers/collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import logging
import os
from concurrent.futures import as_completed
from warnings import warn

import numpy as np
import pandas as pd
Expand Down Expand Up @@ -207,7 +208,16 @@ def get_slices(final_time_index, final_meta, new_time_index, new_meta):
row_slice = slice(np.min(row_loc), np.max(row_loc) + 1)
col_slice = slice(np.min(col_loc), np.max(col_loc) + 1)

return row_slice, col_slice
if col_slice.stop - col_slice.start != len(col_loc):
msg = (
'Indices for coordinates are not ascending and / or '
'contiguous.'
)
logger.warning(msg)
warn(msg)
col_slice = col_loc

return row_slice, col_loc

@staticmethod
def get_data(
Expand Down
2 changes: 1 addition & 1 deletion nsrdb/gap_fill/mlclouds_fill.py
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@ def archive_cld_properties(self):
'cld_press_acha',
'cloud_type',
]
for dset in cld_dsets:
for dset in [ds for ds in cld_dsets if ds in self.dset_map]:
src_fpath = self.dset_map[dset]
src_dir, f_name = os.path.split(src_fpath)
dst_dir = os.path.join(src_dir, 'raw')
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ dependencies = [
"NREL-farms>=1.0.6",
"scikit-learn>=1.0",
"NREL-rest2>=1.0.2",
"NREL-mlclouds>=0.0.4",
"NREL-mlclouds>=0.0.5",
"dask>=2024.8.0"
]

Expand Down

0 comments on commit e815c42

Please sign in to comment.