Repository navigation
Conversation
Author
AI review — GPT-6.1 Sol via OpenAI Codex
|
evadiva3
marked this pull request as ready for review
November 17, 2026 03:58
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Some valid NumPy scalar inputs get rejected by the entropy and Hjorth functions because the type checks only look for Python
intandfloatvalues. This usesnumbers.Realso NumPy real scalars are accepted too. The added tests cover those inputs and make sure invalid strings still raise an error.Reproduction
Before: the first call raises
TypeError: tolerance must be a float or int, got float32.After, with the seed above:
The regression tests also compare NumPy scalar results with equivalent Python scalar arguments and retain the invalid-string checks.
Impact
Rating: P2
Why: Valid NumPy real scalar tolerances and sampling frequencies are rejected in otherwise supported calls. This affects scientific-code inputs such as a tolerance computed from float32 data; the fix changes validation, not the entropy or Hjorth formulas.
Testing
python -m pytest -q: 34 passed. Ruff lint and format checks pass acrosssrcandtests. The three affected regression tests fail against the original implementation and pass with the patch.AI assistance
Model used: GPT-6.1 Sol via OpenAI Codex.
I used it to inspect the saved patch, review the code, run the reported checks, and help with this description. The contribution starts from an existing saved patch.
Checklist
If AI-assisted: