pySTEPS / pysteps

Python framework for short-term ensemble prediction systems.
https://pysteps.github.io/
BSD 3-Clause "New" or "Revised" License
441 stars 160 forks source link

Bug fix: ignore 0 in TDaTing cell match #350

Closed ritvje closed 3 months ago

ritvje commented 5 months ago

This PR fixes a bug in the pysteps.tracking.tdating.match function. As far as I can tell, in this bug the label 0 was included in possible match IDs, even though 0 denotes pixels that are not part of any cell. So there could be cases, where the advected cell would have e.g. 55% of 0 and 45% of some cell and it would not be matched to that cell. So this fix will first check if the advected cell contains only 0-labeled pixels, it is initiated as a new track. If not, then 0 is removed from the possible ID labels and the matching is done as previously.

codecov[bot] commented 5 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 83.33%. Comparing base (a471d49) to head (f84da89). Report is 1 commits behind head on master.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #350 +/- ## ======================================= Coverage 83.32% 83.33% ======================================= Files 161 161 Lines 12363 12368 +5 ======================================= + Hits 10302 10307 +5 Misses 2061 2061 ``` | [Flag](https://app.codecov.io/gh/pySTEPS/pysteps/pull/350/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pySTEPS) | Coverage Δ | | |---|---|---| | [unit_tests](https://app.codecov.io/gh/pySTEPS/pysteps/pull/350/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pySTEPS) | `83.33% <100.00%> (+<0.01%)` | :arrow_up: | 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=pySTEPS#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.

dnerini commented 3 months ago

sorry for taking so long, I think we can merge this bugfix if @feldmann-m has no objections to this?