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

Change isbi_utils from writing files to comparing in memory #67

Merged
merged 8 commits into from
Aug 5, 2021

Conversation

R-Ding
Copy link
Contributor

@R-Ding R-Ding commented Aug 3, 2021

What

  • Replace writing to GT and result ISBI-style .txt files with saving an array of ISBI-style dictionaries and comparing those.
  • Modifying isbi_utils_tests to test the new approach

Why

  • Comparing in memory is quicker and allows for less chances of error

@MekWarrior
Copy link
Collaborator

Code changes looks good. Seems to run a bit slower, which is surprising but in my one live test it did replicate the results of the original code.

Copy link
Contributor

@willgraf willgraf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm hoping we can make this backwards compatible to prevent having to update any miscellaneous code that may break.

Ideally the functions that used to exist will still exist by name and do what they are supposed to do. Internally those functions can change and call other/new functions to keep them short.

Keep old parameters but just default them to None so they do nothing. If users try to use them, please warn that the arg is deprecated.

deepcell_tracking/isbi_utils.py Outdated Show resolved Hide resolved
deepcell_tracking/isbi_utils.py Show resolved Hide resolved
deepcell_tracking/isbi_utils.py Outdated Show resolved Hide resolved
deepcell_tracking/isbi_utils_test.py Outdated Show resolved Hide resolved
deepcell_tracking/isbi_utils_test.py Outdated Show resolved Hide resolved
@willgraf
Copy link
Contributor

willgraf commented Aug 3, 2021

If you could also add a test for benchmark_division_performance, that would be very helpful. It's the last function in the file that is untested.

@MekWarrior MekWarrior self-requested a review August 4, 2021 18:40
Copy link
Contributor

@willgraf willgraf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apologies for my confusing statements earlier, I got mixed up on the different functions.

I left a bunch of comments, please follow up if anything isn't clear.

deepcell_tracking/isbi_utils.py Outdated Show resolved Hide resolved
deepcell_tracking/isbi_utils.py Outdated Show resolved Hide resolved
deepcell_tracking/isbi_utils.py Outdated Show resolved Hide resolved
deepcell_tracking/isbi_utils.py Outdated Show resolved Hide resolved
deepcell_tracking/isbi_utils.py Outdated Show resolved Hide resolved
deepcell_tracking/isbi_utils.py Outdated Show resolved Hide resolved
Copy link
Contributor

@willgraf willgraf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! Very pleased with where it is - just one last small change for deprecation warning.

deepcell_tracking/isbi_utils.py Outdated Show resolved Hide resolved
Co-authored-by: willgraf <7930703+willgraf@users.noreply.github.com>
@R-Ding
Copy link
Contributor Author

R-Ding commented Aug 5, 2021

Looks great! Very pleased with where it is - just one last small change for deprecation warning.

Thanks for all the help!

@willgraf willgraf self-requested a review August 5, 2021 19:59
Copy link
Contributor

@willgraf willgraf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, good changes and well tested.

The only failing checks are for Python 3.5 coverage, which does not seem like a blocker to me.

Copy link
Collaborator

@MekWarrior MekWarrior left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Would just like clarification on one thing.

deepcell_tracking/isbi_utils.py Outdated Show resolved Hide resolved
@MekWarrior MekWarrior self-requested a review August 5, 2021 22:59
Copy link
Collaborator

@MekWarrior MekWarrior left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work!

@willgraf willgraf added enhancement New feature or request fix Fixes a bug labels Aug 5, 2021
@willgraf willgraf merged commit cd8eea4 into master Aug 5, 2021
@willgraf willgraf deleted the benchmarking branch August 5, 2021 23:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request fix Fixes a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants