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

Bug fix: ignore 0 in TDaTing cell match #350

Merged
merged 1 commit into from
Apr 24, 2024

Conversation

ritvje
Copy link
Contributor

@ritvje ritvje commented Mar 14, 2024

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.

Since 0 in labels means that no cell was identified in that pixel, we need to
ignore 0 when matching. Otherwise we could have a situation where e.g the
cell overlaps 0.55 with 0 and 0.45 with some cell and it would end up unmatched
(`ID_coverage` would be 0 and a new track would be initialized)
Copy link

codecov bot commented Mar 14, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

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

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #350   +/-   ##
=======================================
  Coverage   83.32%   83.33%           
=======================================
  Files         161      161           
  Lines       12363    12368    +5     
=======================================
+ Hits        10302    10307    +5     
  Misses       2061     2061           
Flag Coverage Δ
unit_tests 83.33% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@dnerini
Copy link
Member

dnerini commented Apr 23, 2024

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

@dnerini dnerini merged commit 5e0ee92 into pySTEPS:master Apr 24, 2024
10 checks passed
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

Successfully merging this pull request may close these issues.

2 participants