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

Adding type hints for segmentation #351

Merged

Conversation

freemansw1
Copy link
Member

As part of my broader type hinting efforts (see #74, #341, #337), I've gone through quickly and added type hints to Segmentation. I have avoided type hints on the wrapper functions, as I think we need to ultimately decide what to do with them at some later stage.

As an aside (and I should make an issue for this), Segmentation (especially after the PBC changes, sorry about that) is in desperate need of a deep refactor.

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

@codecov
Copy link

codecov bot commented Oct 5, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (85f8f3a) 56.35% compared to head (a635af8) 56.40%.

Additional details and impacted files
@@              Coverage Diff              @@
##           RC_v1.5.x     #351      +/-   ##
=============================================
+ Coverage      56.35%   56.40%   +0.05%     
=============================================
  Files             16       16              
  Lines           3384     3388       +4     
=============================================
+ Hits            1907     1911       +4     
  Misses          1477     1477              
Flag Coverage Δ
unittests 56.40% <100.00%> (+0.05%) ⬆️

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

Files Coverage Δ
tobac/segmentation.py 92.89% <100.00%> (+0.07%) ⬆️

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

@freemansw1 freemansw1 marked this pull request as ready for review October 5, 2023 18:11
@w-k-jones
Copy link
Member

As an aside (and I should make an issue for this), Segmentation (especially after the PBC changes, sorry about that) is in desperate need of a deep refactor.

I agree, and although we will definitely do this as part of the conversion to xarray it may be worthwhile to do a couple of passes first, both to fix the worst code smells and break things down into more manageable sized functions

@w-k-jones w-k-jones added this to the Version 1.5.x milestone Oct 8, 2023
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.

Looks good!

@freemansw1 freemansw1 merged commit 5f096e3 into tobac-project:RC_v1.5.x Nov 8, 2023
8 checks passed
@JuliaKukulies JuliaKukulies mentioned this pull request Nov 8, 2023
8 tasks
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.

3 participants