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: Assure that feature dataframe indices are unique #187

Merged

Conversation

JuliaKukulies
Copy link
Member

@JuliaKukulies JuliaKukulies commented Oct 21, 2022

The feature detection does currently not work when min_distance is not 0. An exception is raised in filter_min_distance() , because the input feature dataframe for this function can contain index values that are double-defined as a consequence of concatenating dataframes in feature_detection_multithreshold_timestep(). This PR solves #184 by assuring that the feature dataframe that is created in feature_detection_multithreshold_timestep() gets unique indices.

I also added a test for filter_min_distance() to test if features are removed as expected within a specified minimum distance and I removed redundant imports from test_feature_detection.py.

  • Have you followed our guidelines in CONTRIBUTING.md?
  • Have you self-reviewed your code and corrected any misspellings?
  • Have you written documentation that is easy to understand?
  • Have you written descriptive commit messages?
  • Have you added NumPy docstrings for newly added functions?
  • Have you formatted your code using black?
  • If you have introduced a new functionality, have you added adequate unit tests?
  • Have all tests passed in your local clone?
  • If you have introduced a new functionality, have you added an example notebook?
  • Have you kept your pull request small and limited so that it is easy to review?
  • Have the newest changes from this branch been merged?

@JuliaKukulies JuliaKukulies added the bug Code that is failing or producing the wrong result label Oct 21, 2022
@JuliaKukulies JuliaKukulies added this to the Version 1.4 milestone Oct 21, 2022
@JuliaKukulies JuliaKukulies added the enhancement Addition of new features, or improved functionality of existing features label Oct 21, 2022
@codecov
Copy link

codecov bot commented Oct 21, 2022

Codecov Report

Base: 35.06% // Head: 35.68% // Increases project coverage by +0.61% 🎉

Coverage data is based on head (8f9ae47) compared to base (dfe3b38).
Patch coverage: 100.00% of modified lines in pull request are covered.

❗ Current head 8f9ae47 differs from pull request most recent head 7291228. Consider uploading reports for the commit 7291228 to get more accurate results

Additional details and impacted files
@@              Coverage Diff              @@
##           RC_v1.4.0     #187      +/-   ##
=============================================
+ Coverage      35.06%   35.68%   +0.61%     
=============================================
  Files             10       10              
  Lines           2099     2099              
=============================================
+ Hits             736      749      +13     
+ Misses          1363     1350      -13     
Flag Coverage Δ
unittests 35.68% <100.00%> (+0.61%) ⬆️

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

Impacted Files Coverage Δ
tobac/feature_detection.py 77.90% <100.00%> (+7.18%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Member

@freemansw1 freemansw1 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 and glad that we can quickly address #184!

)
def test_filter_min_distance(test_threshs, min_distance, dxy):
"""
Tests ```tobac.feature_detection.filter_min_distance
Copy link
Member

Choose a reason for hiding this comment

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

needs closing ```

Copy link
Collaborator

@snilsn snilsn left a comment

Choose a reason for hiding this comment

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

Good job @JuliaKukulies ! Nothing to complain about in this quick bug fix and great that the code coverage is increased at the same time!

@JuliaKukulies
Copy link
Member Author

Thanks for the quick review! I will merge after #186 has been merged

@JuliaKukulies JuliaKukulies merged commit e43536c into tobac-project:RC_v1.4.0 Oct 21, 2022
@JuliaKukulies JuliaKukulies deleted the bugfix_unique_values_fd branch February 22, 2023 10:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Code that is failing or producing the wrong result enhancement Addition of new features, or improved functionality of existing features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feature_detection_multithreshold crashes when "min_distance" argument is not 0
3 participants