Skip to content

CI failing due to expired deprecations in numpy #273

@jlenain

Description

@jlenain

Describe the bug
CI tests are currently failing, because np.trapz and np.in1d, used within nectarchain, are expired deprecations in numpy >=2.4.0 (see e.g. https://numpy.org/devdocs/release/2.4.0-notes.html#removal-of-deprecated-functions-and-arguments and https://numpy.org/devdocs/release/2.4.0-notes.html#removed-numpy-in1d).

To Reproduce
Open a pull request and contemplate the CI tests failing with errors like:

=========================== short test summary info ============================
FAILED src/nectarchain/makers/component/tests/test_flatfield_spe_component.py::TestFlatFieldSingleNominalSPENectarCAMComponent::test_finish_multiproc - AttributeError: module 'numpy' has no attribute 'trapz'
FAILED src/nectarchain/makers/component/tests/test_flatfield_spe_component.py::TestFlatFieldSingleNominalSPENectarCAMComponent::test_finish_singleproc - AttributeError: module 'numpy' has no attribute 'trapz'

Expected behavior
CI tests should not fail for such reasons.

Possible solution
It should be straightforward to update calls to np.trapz to np.trapezoid, without the need to pin numpy to versions <2.4.0 in our recipes. The same applies to np.in1d, to be replaced by np.isin.

Supporting information
See e.g. the results of the following action: https://github.com/cta-observatory/nectarchain/actions/runs/22218928329/job/64269252257

Additional context
numpy has been announcing the deprecation of np.trapz and np.in1d since 2023 (https://numpy.org/devdocs/release/2.4.0-notes.html#removal-of-deprecated-functions-and-arguments and https://numpy.org/devdocs/release/2.4.0-notes.html#removed-numpy-in1d).

Several open PR are currently affected, e.g.:

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No fields configured for Bug.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions