NREL / PVDegradationTools

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

Geo bug fix #112

Closed tobin-ford closed 3 weeks ago

tobin-ford commented 4 weeks ago

Describe your changes

Geospatial analysis on chunked weather datasets was failing due to incorrectly shaped templates. We didn't catch this because there is no testing for it. #111 (still need to add this).

pvdeg.geospatial.output_template would always produce an output with a single chunk along the gid axis. This was fine when the input was not chunked because it is treated as 1 block, similar to how we would treat the input if it had a single chunk. The problem comes when the input xr.Dataset was chunked with more than one chunk along the gid axis. See the screenshot below, there was one chunk along the time axis (irrelevant) and many chunks along the gid axis. image

This issue affected every geospatial.analysis call because the issue was the geospatial.output_template function incorrectly chunking the template, this caused geospatial.autotemplate to be broken, as well as the hard coded cases within the geospatial.analysis function. Both of the previous functions utilize the output_template function. This highlights the need for chunked templating testing as well.

Issue ticket number and link

Type of change

Please delete options that are not relevant.

Checklist before requesting a review

tobin-ford commented 4 weeks ago

This likely happened because of a change I made in the last set of PR's.