NREL / PVDegradationTools

Set of tools to calculate degradation responses and degradation related parameters for PV.
https://pvdegradationtools.readthedocs.io/
Other
26 stars 7 forks source link

Dev scenario geospatial #97

Closed tobin-ford closed 1 month ago

tobin-ford commented 3 months ago

Describe your changes

Initial Scenario Analysis Integration. Sweeping scenario changes. New temperature function temperature.temperature that combines all temperature calculations (cell and module) into one function with support for all pvlib temperature models. All pvdeg functions preforming temperature calculations have been updated accordingly.

Additionally

Type of change

Please delete options that are not relevant.

Checklist before requesting a review

codecov-commenter commented 3 months ago

Codecov Report

Attention: Patch coverage is 45.34884% with 564 lines in your changes missing coverage. Please review.

Project coverage is 62.83%. Comparing base (57cb222) to head (5e5d514).

Files Patch % Lines
pvdeg/scenario.py 31.38% 341 Missing :warning:
pvdeg/geospatial.py 11.71% 113 Missing :warning:
pvdeg/utilities.py 28.76% 104 Missing :warning:
pvdeg/standards.py 71.42% 2 Missing :warning:
pvdeg/temperature.py 96.77% 2 Missing :warning:
pvdeg/degradation.py 94.44% 1 Missing :warning:
pvdeg/weather.py 66.66% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## development #97 +/- ## =============================================== - Coverage 67.02% 62.83% -4.20% =============================================== Files 29 30 +1 Lines 2111 3024 +913 =============================================== + Hits 1415 1900 +485 - Misses 696 1124 +428 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

tobin-ford commented 3 months ago

Not sure if we've run into this before @martin-springer

Pvlib=0.11.0 appears to be problematic. As installed on a local environment with python=3.9.19 and numpy=2.0.0 it caused test_calc_injection_outdoors to fail. The test failes because the series values are similar to the saved values but slightly different. index=88 was NaN when it should not have been but a plot of the series reveals that the series are very similar anyways. This could just be an implementation change/update in the newer pvlib versions. This is caused by the effective irradiance from the modelchain instance being varying across these versions which is then used in the subsequent test calculation. image Orange are test calculated values and blue is stored test values.

When running with pvlib=0.10.3 and numpy=1.26.4 it will pass the test on python=3.9.19. This may be indicative of some other issues but we should restrict the github automations to using a working pvlib version.

Note: we could also upgrade the pvlib version and change the test check values.

Edit: Pvlib 0.11.0 released on June 21, 2024, which was after the last test passed on commit be577c2 (over 2 weeks ago) so if we are always using the most recent version we should apply the change i mentioned above ^

Edit: this appears to be the only test affected by the pvlib version so it would make sense to update the stored testing values rather than restricting ourselves to an older pvlib version.

tobin-ford commented 2 months ago

Dependency versioning issue again. This might be better as its own PR as it will affect all users with the newest scipy version.

scipy 1.14.0 changed the function signatures for many of the quadrature integration functions.

scipy < 1.14.0: scipy.integrate.simpson(y, *, x=None, dx=1.0, axis=-1, even=<object object>)[source]

scipy 1.14.0 simpson(y, *, x=None, dx=1.0, axis=-1)[source]

Edit: My changes seem to have not propagated correctly during the testing. My branch is synced with the head and passes locally.