Skip to content

[ENH] Add primitive type hints to segmentation module#3252

Merged
SebastianSchmidl merged 10 commits intoaeon-toolkit:mainfrom
vickysharma-prog:add-type-hints-segmentation
Mar 1, 2026
Merged

[ENH] Add primitive type hints to segmentation module#3252
SebastianSchmidl merged 10 commits intoaeon-toolkit:mainfrom
vickysharma-prog:add-type-hints-segmentation

Conversation

@vickysharma-prog
Copy link
Copy Markdown
Contributor

Reference Issues / PRs

Relates to #1454


What does this implement / fix?

This PR adds type hints for primitive and string parameters (int, float, bool, str) in the segmentation module, following the scope defined in issue #1454.

Files modified:

  • aeon/segmentation/_clasp.py
  • aeon/segmentation/_fluss.py
  • aeon/segmentation/_binseg.py
  • aeon/segmentation/_random.py
  • aeon/segmentation/_eagglo.py

Changes made:

  • Added type hints to function and constructor parameters with primitive defaults.
  • Complex types (e.g., NumPy arrays, unions, optional types) were intentionally left unchanged to align with project guidance.
  • No logic or behavior was modified.

Testing:

  • All segmentation tests were executed locally and passed successfully ✅
  • No new warnings introduced

Does your contribution introduce a new dependency?

No. This change does not introduce any new dependencies.


Additional comments

Please let me know if you'd prefer the scope to be split into smaller PRs or adjusted further.


PR Checklist

For all contributions

  • I've added myself to the list of contributors (can be done after merge).
  • The PR title starts with [ENH].

For new estimators and functions

  • Not applicable — no new estimators or functions were added.

@aeon-actions-bot aeon-actions-bot bot added enhancement New feature, improvement request or other non-bug code enhancement segmentation Segmentation package labels Jan 19, 2026
@aeon-actions-bot
Copy link
Copy Markdown
Contributor

Thank you for contributing to aeon

I have added the following labels to this PR based on the title: [ enhancement ].
I have added the following labels to this PR based on the changes made: [ segmentation ]. Feel free to change these if they do not properly represent the PR.

The Checks tab will show the status of our automated tests. You can click on individual test runs in the tab or "Details" in the panel below to see more information if there is a failure.

If our pre-commit code quality check fails, any trivial fixes will automatically be pushed to your PR unless it is a draft.

Don't hesitate to ask questions on the aeon Discord channel if you have any.

PR CI actions

These checkboxes will add labels to enable/disable CI functionality for this PR. This may not take effect immediately, and a new commit may be required to run the new configuration.

  • Run pre-commit checks for all files
  • Run mypy typecheck tests
  • Run all pytest tests and configurations
  • Run all notebook example tests
  • Run numba-disabled codecov tests
  • Stop automatic pre-commit fixes (always disabled for drafts)
  • Disable numba cache loading
  • Regenerate expected results for testing
  • Push an empty commit to re-run CI checks

@vickysharma-prog vickysharma-prog force-pushed the add-type-hints-segmentation branch from 1b4a105 to 0be2244 Compare January 20, 2026 04:59
@vickysharma-prog
Copy link
Copy Markdown
Contributor Author

Hi maintainers
Just a gentle ping on this PR.
CI is now passing successfully
The earlier failure was related to the shallow clone / merge-base issue and is resolved.
PR is ready for review whenever convenient.
Thanks!

@vickysharma-prog
Copy link
Copy Markdown
Contributor Author

Hi @MatthewMiddlehurst 👋
I’ve submitted PR #3252 adding type hints in segmentation — thanks for reviewing when you get a chance.
I’m looking to make my next contribution but finding it a bit hard to identify unclaimed issues that would be suitable for someone getting familiar with the codebase.
If you have any suggestions for good starter or medium-sized issues (bugs, enhancements, docs, or tests), I’d be happy to take them on.
Thanks!

@MatthewMiddlehurst
Copy link
Copy Markdown
Member

Thank you for addressing the comments. Please view the failing test output.

@vickysharma-prog vickysharma-prog force-pushed the add-type-hints-segmentation branch from 70b9a4e to e62caea Compare February 15, 2026 05:06
@vickysharma-prog vickysharma-prog force-pushed the add-type-hints-segmentation branch from e62caea to a4f6833 Compare February 15, 2026 05:30
@vickysharma-prog vickysharma-prog force-pushed the add-type-hints-segmentation branch from 3da366f to 55fff46 Compare February 15, 2026 05:40
@vickysharma-prog
Copy link
Copy Markdown
Contributor Author

All checks passing now! Fixed the doctest issues in _random.py and resolved merge conflicts.
Ready for review whenever you get a chance. Thanks!

Copy link
Copy Markdown
Member

@MatthewMiddlehurst MatthewMiddlehurst left a comment

Choose a reason for hiding this comment

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

Please avoid force pushing in the future is makes reviewing more difficult.

@vickysharma-prog
Copy link
Copy Markdown
Contributor Author

Hi @SebastianSchmidl
I've addressed all the feedback from your earlier review.
Could you please take another look when you get a chance?
Thanks!

@MatthewMiddlehurst MatthewMiddlehurst changed the title ENH: Add primitive type hints to segmentation module [ENH] Add primitive type hints to segmentation module Feb 16, 2026
@vickysharma-prog vickysharma-prog force-pushed the add-type-hints-segmentation branch from 0968b43 to 44444fb Compare February 18, 2026 11:55
@vickysharma-prog
Copy link
Copy Markdown
Contributor Author

@MatthewMiddlehurst @SebastianSchmidl
Apologies for the force push - I had accidentally merged upstream/main
which added unrelated files to the PR. Force pushed to restore the
original clean state with only the 5 segmentation file changes.

The pre-commit CI is failing due to a shallow clone/merge-base issue
caused by the force push (Unable to locate commit sha: ae3293...).
This is not a code issue - all pre-commit checks pass locally.
All other 16 checks (pytest, ReadTheDocs, examples, imports) are passing.

Ready for re-review whenever you get a chance. Thanks and again apologies for my mistake!

@vickysharma-prog
Copy link
Copy Markdown
Contributor Author

@MatthewMiddlehurst The failing test (test_kshapes in aeon/clustering/) is unrelated to my type hint changes in the segmentation module.
All segmentation tests pass locally (31 passed, 2 skipped).
This looks like an upstream issue or flaky test - happy to rebase once it's resolved!

@SebastianSchmidl SebastianSchmidl merged commit 553ade3 into aeon-toolkit:main Mar 1, 2026
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature, improvement request or other non-bug code enhancement segmentation Segmentation package

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants