Skip to content

Fix for normalize function in thresh_utility.py #13

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

KainRasleafar
Copy link

@KainRasleafar KainRasleafar commented Jun 4, 2025

Submissions Basics:

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?
  • Have you checked all Issues to tie the PR to a specific one?
    Yes – fixes #12

Type of Change:

  • Bug fix
  • New feature
  • Documentation update

All Submissions Cores:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
    Yes. This PR improves the normalize function to ensure the output is strictly clipped to the [0, 1] range. This prevents unexpected behavior when input values fall outside the defined min_val/max_val bounds.
  • Have you written new unit tests for your changes?
    No new tests added yet – existing usage will benefit from safer behavior, but tests could be extended in a separate PR if needed.
  • Do all new and existing unit tests pass locally?

New Thresholder Submissions:

  • Have you created a .py in ~/pythresh/thresholds/?
  • Have you created a _example.py in ~/examples/?
  • Have you created a test_.py in ~/pythresh/test/?
  • Have you lint your code locally prior to submission?
  • Have you added a reference of the new thresholder in your explanation?

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.

normalize function can produce out-of-bound values without proper clipping
2 participants