Skip to content

Conversation

@ajpotts
Copy link
Contributor

@ajpotts ajpotts commented Jan 9, 2026

Add NumPy alignment tests for Arkouda Strings

Summary

This PR introduces a comprehensive NumPy-alignment test suite for ak.Strings
and wires it into the existing NumPy test runs. The goal is to explicitly
document, enforce, and track parity (and known divergence) between Arkouda
Strings and NumPy/Python string semantics.

What’s included

  • New test file:
    • tests/numpy/alignment_verification/strings_alignment.py
  • Added to pytest.ini so it runs with the rest of the NumPy alignment suite
  • Coverage for:
    • Case operations (lower, upper, title, capitalize)
    • Predicate methods (isdigit, isalpha, isalnum, etc.)
    • Binary comparisons (==, !=, scalar comparisons)
    • Indexing and slicing
    • Regex-based operations (contains)
    • Error semantics (size mismatch, invalid regex)

Handling known divergences

Several behaviors currently differ from NumPy/Python semantics. These are
intentionally captured using xfail(strict=True) so that:

  • CI stays green today
  • Tests automatically fail once Arkouda semantics are updated

Tracked divergences:

Why this matters

  • Makes Arkouda’s string semantics explicit and testable
  • Aligns with the existing NumPy alignment philosophy used for pdarray
  • Provides a clear roadmap for future semantic fixes without losing signal

Reviewer notes

  • xfail(strict=True) is used deliberately to ensure future fixes are detected
  • Unicode characters in reasons are escaped to satisfy Ruff (RUF001)
  • Regex error tests expect re.error / PatternError (Python 3.13+ behavior)

Closes #5287: alignment tests for arkouda.numpy.strings

@codecov-commenter
Copy link

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (main@8a95e0c). Learn more about missing BASE report.
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@           Coverage Diff            @@
##             main     #5291   +/-   ##
========================================
  Coverage        ?   100.00%           
========================================
  Files           ?        45           
  Lines           ?      1301           
  Branches        ?         0           
========================================
  Hits            ?      1301           
  Misses          ?         0           
  Partials        ?         0           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ajpotts ajpotts marked this pull request as ready for review January 16, 2026 21:35
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.strings

2 participants