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

Fix minimum distance filtering for varying vertical coordinates #452

Merged
merged 9 commits into from
Oct 17, 2024

Conversation

w-k-jones
Copy link
Member

@w-k-jones w-k-jones commented Sep 25, 2024

Resolves #430 and #413

The order of coordinate interpolation and minimum distance filtering has been swapped, so that the z coordinate can be used for finding the spacing of features rather than assuming a fixed vertical grid spacing. The filter_min_distance has also been fixed so that the provided z coordinate will be used, rather than always using dz. Incidentally, another bug was fixed in feature_detection_multithreshold_timestep was fixed, in which statistics were being recalculated at each threshold value, rather than once at the end.

Ideally, I would like to move adding coordinates and distance filtering inside feature_detection_multithreshold_timestep, but at the moment we are not passing through the required info to do this. As the feature detection code is in need of refactoring, I'll leave this until after v1.6 to avoid conflicts with the switch to xarray

  • 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?

@w-k-jones w-k-jones self-assigned this Sep 25, 2024
@w-k-jones w-k-jones added the bug Code that is failing or producing the wrong result label Sep 25, 2024
@w-k-jones
Copy link
Member Author

@freemansw1 are you happy to review this?

Copy link

codecov bot commented Sep 25, 2024

Codecov Report

Attention: Patch coverage is 68.96552% with 9 lines in your changes missing coverage. Please review.

Project coverage is 61.14%. Comparing base (d9f2df8) to head (bea540c).
Report is 41 commits behind head on RC_v1.5.x.

Files with missing lines Patch % Lines
tobac/feature_detection.py 68.96% 9 Missing ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##           RC_v1.5.x     #452      +/-   ##
=============================================
+ Coverage      60.81%   61.14%   +0.32%     
=============================================
  Files             23       23              
  Lines           3527     3580      +53     
=============================================
+ Hits            2145     2189      +44     
- Misses          1382     1391       +9     
Flag Coverage Δ
unittests 61.14% <68.96%> (+0.32%) ⬆️

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.

Copy link

github-actions bot commented Sep 25, 2024

Linting results by Pylint:

Your code has been rated at 8.74/10 (previous run: 8.74/10, +0.00)
The linting score is an indicator that reflects how well your code version follows Pylint’s coding standards and quality metrics with respect to the RC_v1.5.x branch.
A decrease usually indicates your new code does not fully meet style guidelines or has potential errors.

@w-k-jones w-k-jones added this to the Version 1.5.4 milestone Sep 25, 2024
@w-k-jones w-k-jones linked an issue Sep 25, 2024 that may be closed by this pull request
4 tasks
@w-k-jones w-k-jones linked an issue Oct 1, 2024 that may be closed by this pull request
4 tasks
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.

Thanks, @w-k-jones . Checks out on my end.

Copy link
Member

@JuliaKukulies JuliaKukulies left a comment

Choose a reason for hiding this comment

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

Looking good @w-k-jones! Thanks for also fixing the statistics issue. Just one thing I am wondering with regard to #449

tobac/feature_detection.py Show resolved Hide resolved
@w-k-jones
Copy link
Member Author

I have re-added the unsmoothed statistics functionally which was removed by mistake. The remaining failing tests and the formatting and one of the matrix tests which has the sporadic spectral filtering test bug. @JuliaKukulies & @freemansw1 are you happy for me to merge?

@JuliaKukulies
Copy link
Member

Yes, ready to merge from my side! Thanks @w-k-jones !

@w-k-jones w-k-jones merged commit a987435 into RC_v1.5.x Oct 17, 2024
41 of 44 checks passed
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
Projects
None yet
3 participants