NREL / rdtools

PV Analysis Tools in Python
https://rdtools.readthedocs.io/
MIT License
153 stars 65 forks source link

CODS bootstrapping returns None when soiling signal is small #396

Closed martin-springer closed 10 months ago

martin-springer commented 11 months ago

Describe the bug CODS - run_bootstrap returns None when 'Soiling signal is small relative to the noise.' The error message is printed but an exception is not raised. In a successful run, three arguments are returned. In the case of a small soiling signal only one argument (None) is returned, which causes an exception when three arguments are expected from the function as is the case in the tutorial example results_df, degradation, soiling_loss = CODS.run_bootstrap(reps=16, verbose=True).

Here is a link to the return statement that causes the exception: https://github.com/NREL/rdtools/blob/20bc73ce7af485a0eca6d0a063ca0a324978340b/rdtools/soiling.py#L1769

Full error message and traceback TypeError: cannot unpack non-iterable NoneType object

To Reproduce Run CODS bootstrapping on: 5169 | ac_power_inv_2831 with result_df, degradation, soiling_loss = CODS.run_bootstrap(**params_CODS)

Expected behavior Raise exception instead of printing error or return the correct number of arguments.

martin-springer commented 10 months ago

Closing as duplicate of #369