Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add resource length warning for easier debugging #457

Merged
merged 5 commits into from
Jun 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading