Skip to content

Commit

Permalink
Merge pull request #457 from NREL/pp/resource_len_warnings
Browse files Browse the repository at this point in the history
Add resource length warning for easier debugging
  • Loading branch information
ppinchuk authored Jun 24, 2024
2 parents e92af3a + dc969d9 commit 75ccf41
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions reV/SAM/generation.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,15 @@ def check_resource_data(self, resource):
logger.error(msg)
raise InputError(msg)

if len(resource) < 8760:
msg = (f"Detected resource time series of length {len(resource)}, "
"which is less than 8760. This may yield unexpected "
"results or fail altogether. If this is not intentional, "
"try setting 'time_index_step: 1' in your SAM config or "
"double check the resource input you're using.")
logger.warning(msg)
warn(msg)

@abstractmethod
def set_resource_data(self, resource, meta):
"""Placeholder for resource data setting (nsrdb or wtk)"""
Expand Down

0 comments on commit 75ccf41

Please sign in to comment.