You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I have been facing an error while analyzing for 'Turbine Ideal Energy'. I'm facing this error if I have less than 2 years of SCADA data. Even if I have data which is short by a day, it throws the error. I'm wondering if we have to use 2 years or more data or it's just a bug. Could you look into this issue please? I have pasted the entire error for reference. Also, I have similar error with other codes as well except AEP when I used data less than 2 years. Thank you very much for consideration.
ValueErrorTraceback (mostrecentcalllast)
CellIn[15], line61# We can choose to save key plots to a file by setting enable_plotting=True and 2# specifying a directory to save the images. For now we turn off this feature. 3# ta.run(reanalysis_subset=['era5', 'merra2'], enable_plotting=False, plot_dir=None,4# wind_bin_thresh=wind_bin_thresh, max_power_filter=max_power_filter,5# correction_threshold=correction_threshold)---->6ta.run(reanalysis_products=['era5', 'merra2'])
File~\AppData\Local\anaconda3\envs\openoa-env\lib\site-packages\openoa\logging.py:33, inlogged_method_call.<locals>._wrapper(self, *args, **kwargs)
31logger=logging.getLogger(the_method.__module__)
32logger.debug(f"{self.__class__.__name__}#{id(self)}.{the_method.__name__}: {msg}")
--->33returnthe_method(self, *args, **kwargs)
File~\AppData\Local\anaconda3\envs\openoa-env\lib\site-packages\openoa\analysis\turbine_long_term_gross_energy.py:255, inTurbineLongTermGrossEnergy.run(self, num_sim, reanalysis_products, uncertainty_scada, wind_bin_threshold, max_power_filter, correction_threshold)
253self.filter_sum_impute_scada() # Setup daily scada data254self.setupturbine_model_dict() # Setup daily data to be fit using the GAM-->255self.fit_model() # Fit daily turbine energy to atmospheric data256self.apply_model(i) # Apply fitting result to long-term reanalysis data258# Log the completion of the runFile~\AppData\Local\anaconda3\envs\openoa-env\lib\site-packages\openoa\logging.py:33, inlogged_method_call.<locals>._wrapper(self, *args, **kwargs)
31logger=logging.getLogger(the_method.__module__)
32logger.debug(f"{self.__class__.__name__}#{id(self)}.{the_method.__name__}: {msg}")
--->33returnthe_method(self, *args, **kwargs)
File~\AppData\Local\anaconda3\envs\openoa-env\lib\site-packages\openoa\analysis\turbine_long_term_gross_energy.py:519, inTurbineLongTermGrossEnergy.fit_model(self)
516df["energy_imputed"] =df["energy_imputed"] *self._run.scada_data_fraction518# Consider wind speed, wind direction, and air density as features-->519mod_results[t] =functions.gam_3param(
520windspeed_col="WMETR_HorWdSpd",
521wind_direction_col="WMETR_HorWdDir",
522air_density_col="WMETR_AirDen",
523power_col="energy_imputed",
524data=df,
525 )
526self._model_results=mod_resultsFile~\AppData\Local\anaconda3\envs\openoa-env\lib\site-packages\openoa\utils\_converters.py:294, indataframe_method.<locals>.decorator.<locals>.wrapper(*args, **kwargs)
292# Update the args and kwargs as need and call the function293args, kwargs=_update_arguments(args, kwargs, arg_ix_list, data_cols, arg_list)
-->294returnfunc(*args, **kwargs)
296# When no data is provided, then convert the Series arguments, update args and kwargs,297# appropriately, then call the function298df, arg_list=series_to_df(*arg_list, names=data_cols)
File~\AppData\Local\anaconda3\envs\openoa-env\lib\site-packages\openoa\utils\power_curve\functions.py:187, ingam_3param(windspeed_col, wind_direction_col, air_density_col, power_col, n_splines, data)
184y=data[power_col]
186# Fit the model-->187model=LinearGAM(n_splines=n_splines).fit(X, y)
189# Wrap the prediction function in a closure to pack input variables190 @dataframe_method(data_cols=["windspeed_col", "wind_direction_col", "air_density_col"])
191defpredict(
192windspeed_col: str|pd.Series,
(...)
195data: pd.DataFrame=None,
196 ):
File~\AppData\Local\anaconda3\envs\openoa-env\lib\site-packages\pygam\pygam.py:887, inGAM.fit(self, X, y, weights)
884self._validate_params()
886# validate data-->887y=check_y(y, self.link, self.distribution, verbose=self.verbose)
888X=check_X(X, verbose=self.verbose)
889check_X_y(X, y)
File~\AppData\Local\anaconda3\envs\openoa-env\lib\site-packages\pygam\utils.py:234, incheck_y(y, link, dist, min_samples, verbose)
212""" 213 tool to ensure that the targets: 214 - are in the domain of the link function (...) 230 y : array containing validated y-data 231 """232y=np.ravel(y)
-->234y=check_array(
235y,
236force_2d=False,
237min_samples=min_samples,
238ndim=1,
239name='y data',
240verbose=verbose,
241 )
243withwarnings.catch_warnings():
244warnings.simplefilter("ignore")
File~\AppData\Local\anaconda3\envs\openoa-env\lib\site-packages\pygam\utils.py:203, incheck_array(array, force_2d, n_feats, ndim, min_samples, name, verbose)
201n=array.shape[0]
202ifn<min_samples:
-->203raiseValueError(
204'{} should have at least {} samples, '205'but found {}'.format(name, min_samples, n)
206 )
208returnarrayValueError: ydatashouldhaveatleast1samples, butfound0
EDIT: I put the traceback in python code bracket to make it easier for me to read.
The text was updated successfully, but these errors were encountered:
Hi @ajayxcel, would you be able to share the first timestamp, last timestamp, and the frequency of your data? I'd like to be able to recreate this to a certain extent to understand the nature of the issue.
Hi @RHammond2, for the la_haute_borne data, I used between the timestamps 2014-01-02T00:00:00+01:00 and 2016-01-01T00:50:00+01:00. So, I deleted the data for the day 2014-01-01 for all the 4 turbines and ran the code. Thanks for looking into this @RHammond2. I appreciate it.
Hi, I have been facing an error while analyzing for 'Turbine Ideal Energy'. I'm facing this error if I have less than 2 years of SCADA data. Even if I have data which is short by a day, it throws the error. I'm wondering if we have to use 2 years or more data or it's just a bug. Could you look into this issue please? I have pasted the entire error for reference. Also, I have similar error with other codes as well except AEP when I used data less than 2 years. Thank you very much for consideration.
EDIT: I put the traceback in python code bracket to make it easier for me to read.
The text was updated successfully, but these errors were encountered: