From e2145f7506be5d520b20242e667f90105ff0562f Mon Sep 17 00:00:00 2001 From: Matt Craig Date: Tue, 25 Aug 2026 15:06:11 -0500 Subject: [PATCH 1/5] Normalise a raw array module passed as combine()'s array_package (#982) combine()'s handling of array_package tried to normalise it with array_api_compat.array_namespace(), which only accepts arrays, not modules; for a raw module (e.g. numpy or dask.array) it always raised TypeError, and the except branch passed the module through unnormalised instead. Combiner.__init__ already normalises its own xp argument with array_api_compat.array_namespace(xp.asarray(0)) (fixed for #976); do the same here so the two entry points agree on what a caller may pass. Investigation while adding regression tests found that combine()'s subsequent `xp = array_api_compat.array_namespace(ccd.data)` (run right after the first image's data is converted) already re-derives a correct namespace from the resulting concrete array, so the specific `from_array() got an unexpected keyword argument 'device'` failure from #982 no longer reproduces through combine() on current main -- this fix closes the gap in intent (and in Combiner/combine agreement) rather than an observed crash. Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01S36ZzAAVXVm32vuTdtCQME --- CHANGES.rst | 3 ++ ccdproc/combiner.py | 19 +++++++------ ccdproc/tests/test_combiner.py | 52 ++++++++++++++++++++++++++++++++++ 3 files changed, 66 insertions(+), 8 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index b3f19ff8..28408933 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -105,6 +105,9 @@ Bug Fixes - Compute the ``Combiner.clip_extrema`` mask with a rank comparison instead of scattering into the mask through per-pixel integer indices, which the array API standard does not support. [#994] +- Accept a plain module such as ``numpy`` or ``dask.array`` as ``array_package`` + in ``combine``, normalising it to its array-api-compat namespace the way + ``Combiner`` already does. [#NNN] 2.5.1 (2025-07-05) ------------------ diff --git a/ccdproc/combiner.py b/ccdproc/combiner.py index 2fb44158..eb01d3b6 100644 --- a/ccdproc/combiner.py +++ b/ccdproc/combiner.py @@ -1013,10 +1013,11 @@ def combine( If not specified, the array package used will be numpy. The array package can be specified either by passing in - an array namespace (e.g. output from ``array_api_compat.array_namespace``), - or an imported array package that follows the array API standard - (e.g. ``numpy`` or ``jax.numpy``), or an array whose namespace can be - determined (e.g. a `numpy.ndarray` or ``jax.numpy.ndarray``). + an array namespace (e.g. output from ``array_api_compat.array_namespace``) + or a plain, imported array module that follows the array API standard + (e.g. ``numpy`` or ``dask.array``); either is normalised to its + array-api-compat namespace before use, the same way + `~ccdproc.Combiner` normalises its ``xp`` argument. ccdkwargs : Other keyword arguments for `astropy.nddata.fits_ccddata_reader`. @@ -1069,10 +1070,12 @@ def combine( # The ccd object will always read as numpy, so convert it to the # requested namespace if there is one. if array_package is not None: - try: - xp = array_api_compat.array_namespace(array_package) - except TypeError: - xp = array_package + # ``array_package`` may be a raw module such as ``numpy`` or + # ``dask.array``; normalise it to the array-api-compat namespace + # the same way ``Combiner.__init__`` does, so the conversions + # below can rely on array-API features (e.g. the ``device`` + # keyword) that a raw module may not provide. + xp = array_api_compat.array_namespace(array_package.asarray(0)) # ccd.data (and its uncertainty, if any) were just read from a # FITS file, so they are NumPy arrays, possibly in big-endian diff --git a/ccdproc/tests/test_combiner.py b/ccdproc/tests/test_combiner.py index 983374ad..6b2db403 100644 --- a/ccdproc/tests/test_combiner.py +++ b/ccdproc/tests/test_combiner.py @@ -1518,3 +1518,55 @@ def sum_func(_, axis=axis): expected_result = xpx.at(expected_result)[5, 5].set(2) assert xp.all(xpx.isclose(expected_result, actual_result.data)) + + +# Regression tests for #982: combine()'s ``array_package`` only normalised +# an already-instantiated array (via array_api_compat.array_namespace), so a +# raw array module (e.g. plain ``numpy`` or ``dask.array``, as opposed to +# ``array_api_compat.numpy``/``array_api_compat.dask.array``) passed through +# unnormalised into code that relies on array-API features the raw module +# does not provide. +def test_combine_array_package_raw_module(tmp_path): + """A raw array module passed as ``array_package`` should be normalised + to its array-api-compat namespace, the same way ``Combiner`` normalises + its ``xp`` argument. + """ + ccd = CCDData(np.arange(9, dtype=float).reshape(3, 3), unit=u.adu) + files = [] + for i in range(3): + path = tmp_path / f"raw-module-{i}.fits" + ccd.write(path) + files.append(str(path)) + + result = combine(files, array_package=np, unit="adu") + assert array_api_compat.is_numpy_array(result.data) + + # On strict and jax, the suite's own ``xp`` fixture is itself a raw + # module (``array_api_strict``/``jax.numpy`` imported directly, not + # through array_api_compat), so this also exercises the raw-module + # path of #982 on those backends without a separate test case. + result = combine(files, array_package=xp, unit="adu") + expected_xp = array_api_compat.array_namespace(xp.asarray(0)) + assert array_api_compat.array_namespace(result.data) is expected_xp + + +def test_combine_array_package_dask_module(tmp_path): + """Regression test for #982. + + Passing the raw ``dask.array`` module (rather than its + array-api-compat wrapper, ``array_api_compat.dask.array``) as + ``array_package`` used to reach ``dask.array.from_array`` with an + unsupported ``device=`` keyword, raising ``TypeError: from_array() got + an unexpected keyword argument 'device'``. + """ + dask = pytest.importorskip("dask.array") + + ccd = CCDData(np.arange(9, dtype=float).reshape(3, 3), unit=u.adu) + files = [] + for i in range(3): + path = tmp_path / f"raw-dask-{i}.fits" + ccd.write(path) + files.append(str(path)) + + result = combine(files, array_package=dask, unit="adu") + assert array_api_compat.is_dask_array(result.data) From 7cd34d5607a45dd5de50f1aaa36d3f0ae3e128e1 Mon Sep 17 00:00:00 2001 From: Matt Craig Date: Tue, 25 Aug 2026 15:07:49 -0500 Subject: [PATCH 2/5] Keep correlated add/subtract uncertainty propagation in the array namespace _ArrayAPIPropagationMixin _propagate_add and _propagate_subtract delegated correlated-uncertainty math to astropy _VariancePropagationMixin _propagate_add_sub, whose correlation term (2 * correlation * np.sqrt(this * other)) is hardcoded to NumPy. That is fine when uncertainty_correlation is 0 (the term is never evaluated), but addition/subtraction with a nonzero correlation on strict fails with TypeError: Expected Array or Python scalar; got numpy.ndarray once the NumPy result is added to an array-API array. #993 already fixed the same class of leak for _propagate_multiply_divide; mirror it here by adding an array-namespace _propagate_add_sub to the mixin and calling it instead of the superclass version. Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01S36ZzAAVXVm32vuTdtCQME --- CHANGES.rst | 3 + ccdproc/_ccddata_wrapper_for_array_api.py | 74 ++++++++++++++++++- .../test_ccddata_wrapper_for_array_api.py | 2 +- 3 files changed, 76 insertions(+), 3 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index 28408933..f2ce1654 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -108,6 +108,9 @@ Bug Fixes - Accept a plain module such as ``numpy`` or ``dask.array`` as ``array_package`` in ``combine``, normalising it to its array-api-compat namespace the way ``Combiner`` already does. [#NNN] +- Keep the uncertainty propagation for correlated addition and subtraction + through ``_CCDDataWrapperForArrayAPI`` in the array namespace instead of + falling back to NumPy. [#NNN] 2.5.1 (2025-07-05) ------------------ diff --git a/ccdproc/_ccddata_wrapper_for_array_api.py b/ccdproc/_ccddata_wrapper_for_array_api.py index f6fe6ec3..28509ac9 100644 --- a/ccdproc/_ccddata_wrapper_for_array_api.py +++ b/ccdproc/_ccddata_wrapper_for_array_api.py @@ -281,7 +281,7 @@ def _variance_hooks(xp): def _propagate_add(self, other_uncert, result_data, correlation): xp = array_api_compat.array_namespace(self.array, other_uncert.array) to_variance, from_variance = self._variance_hooks(xp) - return super()._propagate_add_sub( + return self._propagate_add_sub( other_uncert, result_data, correlation, @@ -293,7 +293,7 @@ def _propagate_add(self, other_uncert, result_data, correlation): def _propagate_subtract(self, other_uncert, result_data, correlation): xp = array_api_compat.array_namespace(self.array, other_uncert.array) to_variance, from_variance = self._variance_hooks(xp) - return super()._propagate_add_sub( + return self._propagate_add_sub( other_uncert, result_data, correlation, @@ -302,6 +302,76 @@ def _propagate_subtract(self, other_uncert, result_data, correlation): from_variance=from_variance, ) + def _propagate_add_sub( + self, + other_uncert, + result_data, + correlation, + subtract=False, + to_variance=lambda x: x, + from_variance=lambda x: x, + ): + """ + Propagate uncertainty for addition or subtraction. + + This is astropy's ``_VariancePropagationMixin._propagate_add_sub`` + with the NumPy call replaced by its array-namespace equivalent; see + the astropy version for the derivation of the formulae. Unlike + astropy's version this does not convert the uncertainties between + units, because ``_CCDDataWrapperForArrayAPI._arithmetic_wrapper`` + removes the units from the uncertainties before doing the + arithmetic. + + Parameters + ---------- + other_uncert : `~astropy.nddata.NDUncertainty` + The uncertainty of the other operand. Its ``array`` must be in + the same array namespace as ``self.array``. + result_data : array-like + Accepted only for signature compatibility with astropy; the + formulae do not use it. + subtract : bool, optional + ``True`` for subtraction, ``False`` (default) for addition. + correlation : float or array-like + Correlation coefficient between the two operands, ``0`` for + uncorrelated. + to_variance : callable, optional + Converts the stored uncertainty array to a variance. Defaults to + the identity, i.e. the uncertainty is already a variance. + from_variance : callable, optional + Converts a variance back to the stored uncertainty type. Defaults + to the identity. + + Returns + ------- + array-like + The propagated uncertainty array, in the same array namespace and + on the same device as the inputs, in the representation of + ``self`` (as determined by ``from_variance``). + """ + del result_data # accepted only for compatibility with astropy + xp = array_api_compat.array_namespace(self.array, other_uncert.array) + + correlation_sign = -1 if subtract else 1 + + other = to_variance(other_uncert.array) if other_uncert.array is not None else 0 + this = to_variance(self.array) if self.array is not None else 0 + + # Formula: sigma**2 = dA + dB +/- 2*cor*sqrt(dA*dB) + # Only take the correlation term into account when both operands + # have an uncertainty; otherwise ``this`` or ``other`` is a bare + # Python ``0`` and ``xp.sqrt(0)`` is rejected on strict. The term is + # mathematically zero in that case regardless. + if (isinstance(correlation, np.ndarray) or correlation != 0) and ( + other_uncert.array is not None and self.array is not None + ): + corr = 2 * correlation * xp.sqrt(this * other) + result = this + other + correlation_sign * corr + else: + result = this + other + + return from_variance(result) + def _propagate_multiply(self, other_uncert, result_data, correlation): xp = array_api_compat.array_namespace(self.array, other_uncert.array) to_variance, from_variance = self._variance_hooks(xp) diff --git a/ccdproc/tests/test_ccddata_wrapper_for_array_api.py b/ccdproc/tests/test_ccddata_wrapper_for_array_api.py index 81efe603..d157139a 100644 --- a/ccdproc/tests/test_ccddata_wrapper_for_array_api.py +++ b/ccdproc/tests/test_ccddata_wrapper_for_array_api.py @@ -211,7 +211,7 @@ def make(asarray): @pytest.mark.parametrize( "uncertainty_type", [StdDevUncertainty, VarianceUncertainty, InverseVariance] ) -@pytest.mark.parametrize("operation", ["multiply", "divide"]) +@pytest.mark.parametrize("operation", ["add", "subtract", "multiply", "divide"]) def test_wrapped_arithmetic_correlated_uncertainty(uncertainty_type, operation): data1 = [[1.0, 2.0], [3.0, 4.0]] data2 = [[2.0, 2.0], [4.0, 8.0]] From 5acdf8c0ec1caf861b3991edb28c80667cc310fc Mon Sep 17 00:00:00 2001 From: Matt Craig Date: Tue, 25 Aug 2026 15:08:45 -0500 Subject: [PATCH 3/5] Fill in PR number in changelog entries Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01S36ZzAAVXVm32vuTdtCQME --- CHANGES.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index f2ce1654..192028b1 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -107,10 +107,10 @@ Bug Fixes array API standard does not support. [#994] - Accept a plain module such as ``numpy`` or ``dask.array`` as ``array_package`` in ``combine``, normalising it to its array-api-compat namespace the way - ``Combiner`` already does. [#NNN] + ``Combiner`` already does. [#997] - Keep the uncertainty propagation for correlated addition and subtraction through ``_CCDDataWrapperForArrayAPI`` in the array namespace instead of - falling back to NumPy. [#NNN] + falling back to NumPy. [#997] 2.5.1 (2025-07-05) ------------------ From fb9b4de957fd56ec47435263973eed169bfa1775 Mon Sep 17 00:00:00 2001 From: Matt Craig Date: Tue, 25 Aug 2026 15:11:59 -0500 Subject: [PATCH 4/5] Keep accepting an array as combine()'s array_package The previous commit normalised array_package with array_package.asarray(0), which raises AttributeError for the one input the old code (and its docstring) did support: an array standing in for its namespace. Route arrays through array_api_compat.array_namespace directly and only call .asarray(0) on modules, and restore the docstring sentence that mentions the array form. Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01S36ZzAAVXVm32vuTdtCQME --- ccdproc/combiner.py | 19 +++++++++++-------- ccdproc/tests/test_combiner.py | 4 ++++ 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/ccdproc/combiner.py b/ccdproc/combiner.py index eb01d3b6..f0e04d1b 100644 --- a/ccdproc/combiner.py +++ b/ccdproc/combiner.py @@ -1015,8 +1015,9 @@ def combine( be numpy. The array package can be specified either by passing in an array namespace (e.g. output from ``array_api_compat.array_namespace``) or a plain, imported array module that follows the array API standard - (e.g. ``numpy`` or ``dask.array``); either is normalised to its - array-api-compat namespace before use, the same way + (e.g. ``numpy`` or ``dask.array``), or an array whose namespace can be + determined (e.g. a `numpy.ndarray`). Whichever is given, it is + normalised to its array-api-compat namespace before use, the same way `~ccdproc.Combiner` normalises its ``xp`` argument. ccdkwargs : Other keyword arguments for `astropy.nddata.fits_ccddata_reader`. @@ -1070,12 +1071,14 @@ def combine( # The ccd object will always read as numpy, so convert it to the # requested namespace if there is one. if array_package is not None: - # ``array_package`` may be a raw module such as ``numpy`` or - # ``dask.array``; normalise it to the array-api-compat namespace - # the same way ``Combiner.__init__`` does, so the conversions - # below can rely on array-API features (e.g. the ``device`` - # keyword) that a raw module may not provide. - xp = array_api_compat.array_namespace(array_package.asarray(0)) + # ``array_package`` may be an array, or a raw module such as + # ``numpy`` or ``dask.array``; normalise either to the + # array-api-compat namespace the same way ``Combiner.__init__`` + # does, so the conversions below can rely on array-API features + # (e.g. the ``device`` keyword) that a raw module may not provide. + if not array_api_compat.is_array_api_obj(array_package): + array_package = array_package.asarray(0) + xp = array_api_compat.array_namespace(array_package) # ccd.data (and its uncertainty, if any) were just read from a # FITS file, so they are NumPy arrays, possibly in big-endian diff --git a/ccdproc/tests/test_combiner.py b/ccdproc/tests/test_combiner.py index 6b2db403..65da7713 100644 --- a/ccdproc/tests/test_combiner.py +++ b/ccdproc/tests/test_combiner.py @@ -1549,6 +1549,10 @@ def test_combine_array_package_raw_module(tmp_path): expected_xp = array_api_compat.array_namespace(xp.asarray(0)) assert array_api_compat.array_namespace(result.data) is expected_xp + # An array is also accepted, and stands in for its namespace. + result = combine(files, array_package=xp.asarray(0), unit="adu") + assert array_api_compat.array_namespace(result.data) is expected_xp + def test_combine_array_package_dask_module(tmp_path): """Regression test for #982. From 46b8c71f5e3b017bf053b04edbaaf9b20d5d9b01 Mon Sep 17 00:00:00 2001 From: Matt Craig Date: Tue, 25 Aug 2026 16:10:27 -0500 Subject: [PATCH 5/5] Address review on #997: Notes sections, shorter docstring, module-only array_package - Move the "this is astropy's ... " background paragraph in _propagate_add_sub and _propagate_multiply_divide out of the summary position into a numpydoc Notes section after Returns, so the two methods stay parallel. - Halve the combine() array_package docstring; it now matches the wording of the Combiner xp docstring. - Drop the array form of combine()'s array_package: it is normalised with the same one-liner Combiner.__init__ uses, array_namespace(array_package.asarray(0)), which accepts an array namespace or a plain module but no longer an array. Remove the test for the array form and note the change in CHANGES.rst. Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01S36ZzAAVXVm32vuTdtCQME --- CHANGES.rst | 2 ++ ccdproc/_ccddata_wrapper_for_array_api.py | 36 +++++++++++++---------- ccdproc/combiner.py | 34 ++++++++------------- ccdproc/tests/test_combiner.py | 4 --- 4 files changed, 35 insertions(+), 41 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index 192028b1..0132760e 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -20,6 +20,8 @@ Other Changes and Additions - Add a ``strict`` tox environment for running the ``array-api-strict`` test suite locally: ``tox -e strict`` reproduces the CI ``py313-strict`` job without having to name the interpreter. [#986] +- ``combine`` no longer accepts an array as its ``array_package`` argument; + pass the array namespace or module instead, as for ``Combiner``. [#997] Bug Fixes ^^^^^^^^^ diff --git a/ccdproc/_ccddata_wrapper_for_array_api.py b/ccdproc/_ccddata_wrapper_for_array_api.py index 28509ac9..b863a7d7 100644 --- a/ccdproc/_ccddata_wrapper_for_array_api.py +++ b/ccdproc/_ccddata_wrapper_for_array_api.py @@ -314,14 +314,6 @@ def _propagate_add_sub( """ Propagate uncertainty for addition or subtraction. - This is astropy's ``_VariancePropagationMixin._propagate_add_sub`` - with the NumPy call replaced by its array-namespace equivalent; see - the astropy version for the derivation of the formulae. Unlike - astropy's version this does not convert the uncertainties between - units, because ``_CCDDataWrapperForArrayAPI._arithmetic_wrapper`` - removes the units from the uncertainties before doing the - arithmetic. - Parameters ---------- other_uncert : `~astropy.nddata.NDUncertainty` @@ -348,6 +340,16 @@ def _propagate_add_sub( The propagated uncertainty array, in the same array namespace and on the same device as the inputs, in the representation of ``self`` (as determined by ``from_variance``). + + Notes + ----- + This is astropy's ``_VariancePropagationMixin._propagate_add_sub`` + with the NumPy call replaced by its array-namespace equivalent; see + the astropy version for the derivation of the formulae. Unlike + astropy's version this does not convert the uncertainties between + units, because ``_CCDDataWrapperForArrayAPI._arithmetic_wrapper`` + removes the units from the uncertainties before doing the + arithmetic. """ del result_data # accepted only for compatibility with astropy xp = array_api_compat.array_namespace(self.array, other_uncert.array) @@ -408,14 +410,6 @@ def _propagate_multiply_divide( """ Propagate uncertainty for multiplication or division. - This is astropy's - ``_VariancePropagationMixin._propagate_multiply_divide`` with the - NumPy calls replaced by their array-namespace equivalents; see the - astropy version for the derivation of the formulae. Unlike astropy's - version this does not convert the uncertainties between units, - because ``_CCDDataWrapperForArrayAPI._arithmetic_wrapper`` removes - the units from the uncertainties before doing the arithmetic. - Parameters ---------- other_uncert : `~astropy.nddata.NDUncertainty` @@ -443,6 +437,16 @@ def _propagate_multiply_divide( The propagated uncertainty array, in the same array namespace and on the same device as the inputs, in the representation of ``self`` (as determined by ``from_variance``). + + Notes + ----- + This is astropy's + ``_VariancePropagationMixin._propagate_multiply_divide`` with the + NumPy calls replaced by their array-namespace equivalents; see the + astropy version for the derivation of the formulae. Unlike astropy's + version this does not convert the uncertainties between units, + because ``_CCDDataWrapperForArrayAPI._arithmetic_wrapper`` removes + the units from the uncertainties before doing the arithmetic. """ del result_data # accepted only for compatibility with astropy xp = array_api_compat.array_namespace(self.array, other_uncert.array) diff --git a/ccdproc/combiner.py b/ccdproc/combiner.py index f0e04d1b..9030f16c 100644 --- a/ccdproc/combiner.py +++ b/ccdproc/combiner.py @@ -1006,19 +1006,13 @@ def combine( has no effect otherwise. Default is ``False``. - array_package : an array namespace, optional - The array package to use for the data if the data needs to be - read in from files. This argument is ignored if the input ``ccd_list`` - is already a list of `~astropy.nddata.CCDData` objects. - - If not specified, the array package used will - be numpy. The array package can be specified either by passing in - an array namespace (e.g. output from ``array_api_compat.array_namespace``) - or a plain, imported array module that follows the array API standard - (e.g. ``numpy`` or ``dask.array``), or an array whose namespace can be - determined (e.g. a `numpy.ndarray`). Whichever is given, it is - normalised to its array-api-compat namespace before use, the same way - `~ccdproc.Combiner` normalises its ``xp`` argument. + array_package : array namespace or module, optional + The array package to use for data read in from files; ignored if + ``ccd_list`` is already a list of `~astropy.nddata.CCDData` objects. + Either an array namespace or a plain module that follows the array + API standard (e.g. ``numpy`` or ``dask.array``); it is normalised to + its array-api-compat namespace the same way `~ccdproc.Combiner` + handles ``xp``. Default is NumPy. ccdkwargs : Other keyword arguments for `astropy.nddata.fits_ccddata_reader`. @@ -1071,14 +1065,12 @@ def combine( # The ccd object will always read as numpy, so convert it to the # requested namespace if there is one. if array_package is not None: - # ``array_package`` may be an array, or a raw module such as - # ``numpy`` or ``dask.array``; normalise either to the - # array-api-compat namespace the same way ``Combiner.__init__`` - # does, so the conversions below can rely on array-API features - # (e.g. the ``device`` keyword) that a raw module may not provide. - if not array_api_compat.is_array_api_obj(array_package): - array_package = array_package.asarray(0) - xp = array_api_compat.array_namespace(array_package) + # ``array_package`` may be a raw module such as ``numpy`` or + # ``dask.array``; normalise it to the array-api-compat namespace + # the same way ``Combiner.__init__`` does, so the conversions + # below can rely on array-API features (e.g. the ``device`` + # keyword) that a raw module may not provide. + xp = array_api_compat.array_namespace(array_package.asarray(0)) # ccd.data (and its uncertainty, if any) were just read from a # FITS file, so they are NumPy arrays, possibly in big-endian diff --git a/ccdproc/tests/test_combiner.py b/ccdproc/tests/test_combiner.py index 65da7713..6b2db403 100644 --- a/ccdproc/tests/test_combiner.py +++ b/ccdproc/tests/test_combiner.py @@ -1549,10 +1549,6 @@ def test_combine_array_package_raw_module(tmp_path): expected_xp = array_api_compat.array_namespace(xp.asarray(0)) assert array_api_compat.array_namespace(result.data) is expected_xp - # An array is also accepted, and stands in for its namespace. - result = combine(files, array_package=xp.asarray(0), unit="adu") - assert array_api_compat.array_namespace(result.data) is expected_xp - def test_combine_array_package_dask_module(tmp_path): """Regression test for #982.