diff --git a/reV/SAM/generation.py b/reV/SAM/generation.py index e2187f7f2..ed2c3ab08 100644 --- a/reV/SAM/generation.py +++ b/reV/SAM/generation.py @@ -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 " + f"{len(resource)}, which is less than 8760. This may " + f"yeild unexpected results or fail altogether. If this " + f"is not intentional, try setting 'time_index_step: 1' " + f"in your SAM config") + logger.warning(msg) + warn(msg) + @abstractmethod def set_resource_data(self, resource, meta): """Placeholder for resource data setting (nsrdb or wtk)""" @@ -851,6 +860,8 @@ def set_resource_data(self, resource, meta): time_index, resource.pop("albedo") ) + pd.DataFrame(resource).to_csv("/scratch/ppinchuk/test_pvwatts.csv", index=False) + self["solar_resource_data"] = resource diff --git a/reV/bespoke/bespoke.py b/reV/bespoke/bespoke.py index 3632dfbe9..f0042f614 100644 --- a/reV/bespoke/bespoke.py +++ b/reV/bespoke/bespoke.py @@ -912,6 +912,15 @@ def res_df(self): ti_step = self.original_sam_sys_inputs["time_index_step"] self._res_df = self._res_df.iloc[::ti_step] + if len(self._res_df) < 8760: + msg = (f"Detected resource time series of length " + f"{len(self._res_df)}, which is less than 8760. This may " + f"yeild unexpected results or fail altogether. If this " + f"is not intentional, try setting 'time_index_step: 1' " + f"in your SAM config") + logger.warning(msg) + warn(msg) + return self._res_df @property