arkouda icon indicating copy to clipboard operation
arkouda copied to clipboard

Increase multidimensional testing for client_dtypes module

Open ajpotts opened this issue 11 months ago • 1 comments

Increase multidimensional testing for client_dtypes module

ajpotts avatar Jan 30 '25 23:01 ajpotts

In client_dtypes.py

  1. BitVector

Current: init takes any pdarray of ints and forwards values.ndim, values.shape up to ClientDType.

Problem: Will happily accept 2-D/3-D pdarray.

Tests: client_dtypes_test.py only covers 1-D creation, ops, round-trips. No tests for N-D rejection/behavior.

✅ Action: add if values.ndim != 1: raise ValueError(...) or add negative tests.

  1. Fields

Current: Similar to BitVector, calls super().init with values.ndim.

Problem: Will accept N-D.

Tests: Only 1-D coverage. No N-D tests.

✅ Action: same as above.

  1. IPv4

Current: Wraps integer pdarray, casts to uint32. No ndim restriction.

Problem: N-D allowed.

Tests: Only 1-D addresses. No N-D rejection tests.

✅ Action: enforce ndim == 1 or add tests.

  1. ip_address function

Current: wraps input into IPv4 (which accepts N-D).

Problem: by proxy, N-D is accepted.

Tests: only 1-D examples.

✅ Action: enforce or add tests.

  1. is_ipv4 / is_ipv6

Current: elementwise comparison of integer bit width. Accepts ip as pdarray or IPv4.

Problem: With 2-D pdarray, returns a flat or incorrectly shaped boolean array. Shape semantics not pinned.

Tests: only 1-D arrays tested.

✅ Action: either (a) add ndim == 1 guard, or (b) fix to preserve shape and add 2-D tests.

✅ Summary for client_dtypes

Functions/classes that need action because they allow N-D but aren’t guarded or tested:

BitVector.init

Fields.init

IPv4.init

ip_address

is_ipv4

is_ipv6

ajpotts avatar Oct 02 '25 14:10 ajpotts