Skip to content

Conversation

@ajpotts
Copy link
Contributor

@ajpotts ajpotts commented Jan 9, 2026

Add NumPy Alignment Tests for Utility Functions

Summary

This PR adds a new NumPy-alignment test suite for Arkouda utility functions that have clear NumPy equivalents. The goal is to explicitly verify behavioral parity with NumPy, including correct handling of shapes, broadcasting semantics, and error cases.

Key Changes

  • New alignment test suite
    • Added tests/numpy/alignment_verification/utils_alignment.py
    • Covers:
      • ak.shape
      • ak.broadcast_shapes
      • ak.broadcast_dims
      • ak.broadcast.broadcast_to
      • ak.broadcast_arrays
      • ak.invert_permutation
    • Tests both successful cases and expected failures, matching NumPy semantics
  • Test discovery
    • Registered the new alignment test file in pytest.ini

Design Notes

  • Tests intentionally focus only on functions with direct NumPy analogues
  • Arkouda-specific concepts (registration, server buffer identity, etc.) are excluded by design
  • Where NumPy raises ValueError for incompatible shapes, tests assert Arkouda raises as well
  • Rank-gated tests (@skip_if_rank_not_compiled) ensure compatibility with build configurations

Why This Matters

  • Establishes executable contracts between Arkouda and NumPy behavior
  • Prevents silent semantic drift in broadcasting and shape logic
  • Provides a reusable pattern for future NumPy-alignment tests

Closes #5292: alignment tests for arkouda.numpy.utils

@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@168089e). 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     #5293   +/-   ##
========================================
  Coverage        ?   100.00%           
========================================
  Files           ?         4           
  Lines           ?        63           
  Branches        ?         0           
========================================
  Hits            ?        63           
  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:18
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.utils

2 participants