Skip to content

Closes #5242: alignment tests for arkouda.numpy.char - #5244

Merged
ajpotts merged 2 commits into
Bears-R-Us:mainfrom
ajpotts:5242_alignment_tests_for_arkouda.numpy.char
Feb 10, 2026
Merged

ajpotts merged 2 commits into
Bears-R-Us:mainfrom
ajpotts:5242_alignment_tests_for_arkouda.numpy.char

Conversation

@ajpotts

@ajpotts ajpotts commented Jan 6, 2026 •

Copy link
Copy Markdown
Contributor

Add NumPy-alignment tests for arkouda.numpy.char.isnumeric

Summary

This PR introduces a new NumPy-alignment test suite for arkouda.numpy.char, with an initial focus on isnumeric.
The tests explicitly compare Arkouda behavior against Python and NumPy semantics and surface a known mismatch for empty strings.


What’s Included

  • New test module: tests/numpy/alignment_verification/char_alignment.py
  • Registration of the new test module in pytest.ini
  • Coverage for:
    • Public API re-exports (bool_, int_, str_, etc.)
    • Type validation errors
    • Exact result parity with np.char.isnumeric
    • Unicode numeric edge cases
    • Deterministic randomized testing against Python + NumPy

Known Failure (Documented)

Two tests are marked xfail due to a known semantic mismatch:

"".isnumeric()          # Python / NumPy → False
Arkouda → True

This is a known issue where empty strings are treated as numeric due to a vacuous
"all characters are numeric" check.

Tracked separately (Issue #5243).


Why This Matters

  • Establishes a reusable pattern for NumPy-alignment verification
  • Prevents silent divergence in string semantics
  • Strengthens pandas / NumPy compatibility guarantees
  • Makes current behavior differences explicit and test-documented

Follow-up Work

  • Fix Strings.isnumeric() to treat empty strings as non-numeric
  • Remove xfail markers once behavior matches NumPy

Diff Summary

  • pytest.ini: include new alignment test module
  • tests/numpy/alignment_verification/char_alignment.py: new tests

Notes

  • Unicode numeric literals are intentional; # noqa: RUF001 is used where appropriate
  • Randomized test is deterministic and low-cost

Closes #5242: alignment tests for arkouda.numpy.char

@ajpotts
ajpotts marked this pull request as ready for review January 7, 2026 12:19
@ajpotts
ajpotts marked this pull request as draft January 9, 2026 16:26
@ajpotts
ajpotts force-pushed the 5242_alignment_tests_for_arkouda.numpy.char branch from f010612 to 001a2b0 Compare February 10, 2026 12:23
@ajpotts
ajpotts marked this pull request as ready for review February 10, 2026 12:27
@ajpotts
ajpotts merged commit 07a14ff into Bears-R-Us:main Feb 10, 2026
19 checks passed
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.

alignment tests for arkouda.numpy.char

2 participants