Skip to content

Conversation

@ajpotts
Copy link
Contributor

@ajpotts ajpotts commented Jan 8, 2026

Add NumPy alignment verification for array creation APIs

Summary

This PR introduces a comprehensive NumPy alignment verification test suite for Arkouda’s
array-creation APIs (pdarraycreation) and wires it into CI. The intent is to make NumPy
compatibility explicit, testable, and continuously enforced, while clearly documenting
known and intentional divergences.

What’s included

  • New test suite

    • tests/numpy/alignment_verification/pdarraycreation_alignment.py
    • Covers:
      • ak.array
      • zeros, ones, full
      • *_like
      • arange
      • linspace
      • logspace
    • Validates alignment with NumPy for:
      • values
      • shapes
      • dtypes
      • error semantics (when NumPy raises)
  • Robust exception alignment

    • Tests assert that when NumPy raises, Arkouda raises as well
    • Avoids silent skips; mismatches are explicit and actionable
  • Targeted xfails for known Arkouda issues

  • CI integration

    • Adds the new alignment file to pytest.ini

Why this matters

  • Establishes a clear contract for NumPy compatibility
  • Prevents regressions as Arkouda evolves
  • Makes edge-case behavior (errors, dtype handling, strings) visible and reviewable
  • Provides a concrete roadmap of alignment gaps to fix next

Non-goals

  • Changing Arkouda runtime behavior
  • Fixing known alignment bugs (handled in follow-up PRs)
  • Expanding coverage beyond array creation APIs

Follow-up work

  • Fix ak.linspace handling for num == 1 and remove xfail
  • Fix non-BMP Unicode handling in ak.Strings

Testing

pytest tests/numpy/alignment_verification/pdarraycreation_alignment.py

Full CI run includes the new alignment verification tests.

Closes #5261: alignment tests for arkouda.numpy.pdarraycreation

@ajpotts ajpotts force-pushed the 5261_alignment_tests_for_arkouda.numpy.pdarraycreation branch 2 times, most recently from b7add26 to e1f0adf Compare January 8, 2026 23:31
@ajpotts ajpotts force-pushed the 5261_alignment_tests_for_arkouda.numpy.pdarraycreation branch from 94d3221 to ea6b4b8 Compare January 9, 2026 13:03
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.pdarraycreation

1 participant