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

PVLib_clearsky requires more detailed test cases #376

Open
cdeline opened this issue May 26, 2023 · 2 comments
Open

PVLib_clearsky requires more detailed test cases #376

cdeline opened this issue May 26, 2023 · 2 comments

Comments

@cdeline
Copy link
Collaborator

cdeline commented May 26, 2023

In the 'aggregated_filters_for_trials' branch we've started prototyping the pvlib_clearsky filter option. As opposed to the 'dumb' csi_filter approach, there are some sophisticated analyses included in pvlib_clearsky that don't like our current test cases. To review, our degradation timeseries has a 3-year period of linear decline in power and POA irradiance from 1000 to 850 over 3 years. We might need to read in a TMY file, use that for GHI in order to allow us to use the pvlib implementation of clearsky detection...

@mdeceglie
Copy link
Collaborator

@cdeline
Copy link
Collaborator Author

cdeline commented Oct 23, 2024

No, this is still broken. In analysis_chains_test,py, any time you search for a {"model": "csi"} and replace it with a {"model": "pvlib"} the tests will break. To my knowledge we do not have coverage of our pvlib clearsky preferred methodology in our TrendAnalysis integrated testing.

For instance if I set model:pvlib on line 375 of analysis_chains_test.py, I'll get the following traceback:

rdtools\test\analysis_chains_test.py:385:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
rdtools\analysis_chains.py:994: in clearsky_analysis
    self._clearsky_preprocess()
rdtools\analysis_chains.py:902: in _clearsky_preprocess
    self._filter(cs_normalized, "clearsky")
rdtools\analysis_chains.py:543: in _filter
    filter_components["clearsky_filter"] = _call_clearsky_filter(
rdtools\analysis_chains.py:475: in _call_clearsky_filter
    f = filtering.clearsky_filter(
rdtools\filtering.py:136: in clearsky_filter
    clearsky_mask = pvlib_clearsky_filter(poa_global_measured, poa_global_clearsky, **kwargs)
rdtools\filtering.py:279: in pvlib_clearsky_filter
    mask = pvlib.clearsky.detect_clearsky(
..\..\..\.conda\envs\py313\Lib\site-packages\pvlib\clearsky.py:857: in detect_clearsky
    slope_max_diff = _max_diff_windowed(
..\..\..\.conda\envs\py313\Lib\site-packages\pvlib\clearsky.py:605: in _max_diff_windowed
    raw = np.abs(raw[H[:-1, ]]).max(axis=0)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

a = array([], shape=(0, 26305), dtype=float64), axis = 0, out = None, keepdims = False
initial = <no value>, where = True

    def _amax(a, axis=None, out=None, keepdims=False,
              initial=_NoValue, where=True):
>       return umr_maximum(a, axis, None, out, keepdims, initial, where)
E       ValueError: zero-size array to reduction operation maximum which has no identity

..\..\..\.conda\envs\py313\Lib\site-packages\numpy\_core\_methods.py:45: ValueError

It's likely that we're doing unit testing of the pvlib clearsky method elsewhere, we just don't have coverage of it in the TA integration test. It seems that we could come up with a pretty simple test case to throw at it that won't barf. Since this is now our default filtering approach, I'd like to see it included in this integration test if at all possible. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants