-
Notifications
You must be signed in to change notification settings - Fork 50
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
Add PBC capability to merge_split_MEST
#372
base: RC_v1.5.x
Are you sure you want to change the base?
Conversation
Keeping as draft until #368 is merged as this contains the same commits |
…ew test for frame_len parameter
Oh this looks really interesting @w-k-jones I'll get started on it! |
Ok, I ended up going down a bit of a rabbit hole there. I found that because the filtering for |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## RC_v1.5.x #372 +/- ##
=============================================
- Coverage 56.79% 56.61% -0.18%
=============================================
Files 20 20
Lines 3435 3407 -28
=============================================
- Hits 1951 1929 -22
+ Misses 1484 1478 -6
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
I haven't started reviewing this yet, but I wonder if we shouldn't try to push this to v1.5.3? I'm starting to get antsy about v1.5.2 coming out. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for doing this, @w-k-jones; a critical improvement to an important piece of code.
I'm not that familiar with this code, but I've added in some thoughts here in a few places. Probably would be good to get a review in from @kelcyno.
@@ -1461,7 +1461,7 @@ def filter_min_distance( | |||
target: {'maximum', 'minimum'}, optional | |||
Flag to determine if tracking is targetting minima or maxima in | |||
the data. Default is 'maximum'. | |||
PBC_flag : str('none', 'hdim_1', 'hdim_2', 'both') | |||
PBC_flag : str('none', 'hdim_1', 'hdim_2', 'both'), optional |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure what style is required here, but I think we should move from optional
to say that the default is none
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking through the main functions, I think we need to standardise a way of highlighting optional keywords and their default values. I'll update this for now by stating the default at the end of the description
@@ -22,6 +44,8 @@ def merge_split_MEST(TRACK, dxy, distance=None, frame_len=5): | |||
The x/y grid spacing of the data. | |||
Should be in meters. | |||
|
|||
dz : float, optional |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the rest of the 3D code, we support both constant vertical grid spacing and user-specified varying vertical grid spacing. We can either require constant vertical grid spacing for this code (less ideal) and check that the user didn't pass in an array-like, or update the code to support both (if it doesn't already). I'm happy enough with either outcome.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I overlooked that functionality in the rest of the code before. I'll see if a similar system to that used in tracking can be used here. I think the same restriction as here may exist in the filtering of features by proximity in feature detection so I'll also look into resolving that
cell_number_unassigned: int, optional | ||
Value given tp unassigned/non-tracked cells by tracking. Default is -1 | ||
|
||
PBC_flag : str('none', 'hdim_1', 'hdim_2', 'both'), optional |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment on optional as above.
Reminder to myself: currently the PBC handling requires all of |
This turned into a general refactor of
merge_split_MEST
, with the following changes and additions:BallTree
distance search approach as used in feature detection.frame_len
before calculating the minimum spanning tree, improving the number of merging/splitting cells linked particularly for long tracking time periods.track
id from 1 rather than 0I'm also going to look into adding a flag for whether a cell started with a split or ended with a merge, and which object it was merged into/split from