Under CCDPROC_ARRAY_LIBRARY=array-api-strict, ccdproc/tests/test_ccdproc.py::test_create_deviation_from_negative_2 fails because create_deviation multiplies a float array by a bool mask array. (The #941 table estimated ~2 failures for this site; at branch tip d329ac5 the dedupe report shows exactly 1.)
ccdproc/core.py:459: in create_deviation
data = data * ~mask
array_api_strict/_array_object.py:842: in __mul__
other = self._check_allowed_dtypes(other, "numeric", "__mul__")
E TypeError: Only numeric dtypes are allowed in __mul__
Offending code — ccdproc/core.py (branch array-api-strict-triage-tooling), inside create_deviation:
data = gain_value * ccd_data.data
mask = data < 0 # bool-dtype Array
if disregard_nan:
data = data * ~mask # line 459: float64 * bool -> TypeError
Root cause: the Array API spec treats bool as a dtype category disjoint from numeric, and arithmetic dunders reject non-numeric operands — there is no implicit bool→int promotion the way numpy does it. So the numpy idiom of multiplying by a boolean mask to zero out values is not portable.
Suggested fix: use xp.where(mask, xp.asarray(0.0, dtype=data.dtype, device=...), data), or cast explicitly with xp.astype(~mask, data.dtype) before multiplying.
Note this does not overlap the _arithmetic_wrapper row of the #941 table (possibly related to #927) — this is a direct escape via the plain * operator inside create_deviation and dedupes separately.
Part of the array-API triage in #941; found with the array-api-strict tooling from #937/#939. Verified at branch tip d329ac5 (2026-08-01).
🤖 Generated with Claude Code
Under
CCDPROC_ARRAY_LIBRARY=array-api-strict,ccdproc/tests/test_ccdproc.py::test_create_deviation_from_negative_2fails becausecreate_deviationmultiplies a float array by a bool mask array. (The #941 table estimated ~2 failures for this site; at branch tip d329ac5 the dedupe report shows exactly 1.)Offending code —
ccdproc/core.py(brancharray-api-strict-triage-tooling), insidecreate_deviation:Root cause: the Array API spec treats
boolas a dtype category disjoint fromnumeric, and arithmetic dunders reject non-numeric operands — there is no implicit bool→int promotion the way numpy does it. So the numpy idiom of multiplying by a boolean mask to zero out values is not portable.Suggested fix: use
xp.where(mask, xp.asarray(0.0, dtype=data.dtype, device=...), data), or cast explicitly withxp.astype(~mask, data.dtype)before multiplying.Note this does not overlap the
_arithmetic_wrapperrow of the #941 table (possibly related to #927) — this is a direct escape via the plain*operator insidecreate_deviationand dedupes separately.Part of the array-API triage in #941; found with the array-api-strict tooling from #937/#939. Verified at branch tip d329ac5 (2026-08-01).
🤖 Generated with Claude Code