BigArray: Fix API deviation with ndarray (shape)
The 'shape' argument of 'numpy.ndarray's initialization method accepts integer and sequences of integers. But the 'shape' property of 'numpy.ndarray' always returns tuple[int, ...], so numpy manually casts any legal argument into tuple[int, ...]. In 'BigArray' and 'ZBigArray' this internal casting didn't exist yet. This patch adds the casting. Before: ZBigArray(shape=[1, 2, 3], dtype=float).shape == [1, 2, 3] After: ZBigArray(shape=[1, 2, 3], dtype=float).shape == (1, 2, 3) In this way BigArray and ZBigArray API behaves closer to numpy.ndaray, which should help avoiding confusion when people are using BigArray / ZBigArray. ----- See issue nexedi/wendelin.core#9 and MR nexedi/wendelin.core!14 for additional context. /reviewed-by @kirr /reviewed-on nexedi/wendelin.core!14
Showing
lib/tests/test_utils.py
0 → 100644
lib/utils.py
0 → 100644
Please register or sign in to comment