SalishSeaCast / SalishSeaNowcast

Python package associated with running the SalishSeaCast NEMO and other ocean models in near-real-time to produce daily nowcasts/forecasts
https://salishsea.eos.ubc.ca/nemo/
Apache License 2.0
4 stars 3 forks source link

Handle ValueError in get_onc_ctd salinity resampling #278

Closed douglatornell closed 3 months ago

douglatornell commented 3 months ago

xarray version 2023.05.0 introduced a ValueError exception raised when a DataArray being resampled is empty. We previously handled that condition by catching an IndexError. Now we catch ValueError too.

The change to ValueError for an empty salinity DataArray didn't show up in production until the 14jun24 update of the production environment brought xarray version 2024.06.0 into use.

codecov[bot] commented 3 months ago

Codecov Report

Attention: Patch coverage is 0% with 1 line in your changes missing coverage. Please review.

Project coverage is 77.65%. Comparing base (f191688) to head (2a3b6c8). Report is 19 commits behind head on main.

Files with missing lines Patch % Lines
nowcast/workers/get_onc_ctd.py 0.00% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #278 +/- ## ======================================= Coverage 77.65% 77.65% ======================================= Files 133 133 Lines 18695 18695 Branches 1910 1910 ======================================= Hits 14517 14517 Misses 4111 4111 Partials 67 67 ``` | [Flag](https://app.codecov.io/gh/SalishSeaCast/SalishSeaNowcast/pull/278/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=SalishSeaCast) | Coverage Δ | | |---|---|---| | [unittests](https://app.codecov.io/gh/SalishSeaCast/SalishSeaNowcast/pull/278/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=SalishSeaCast) | `77.65% <0.00%> (ø)` | | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=SalishSeaCast#carryforward-flags-in-the-pull-request-comment) to find out more.

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