Skip to content

Conversation

@ajpotts
Copy link
Contributor

@ajpotts ajpotts commented Jan 6, 2026

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
ArkoudaTrue

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

1 participant