Skip to content

Fix numpy DeprecationWarning for generic timedelta unit in tests - #592

Merged
MridulS merged 2 commits into
scipp:mainfrom
doronbehar:numpy.timedelta64-pytest-fix
Jul 29, 2026
Merged

Fix numpy DeprecationWarning for generic timedelta unit in tests#592
MridulS merged 2 commits into
scipp:mainfrom
doronbehar:numpy.timedelta64-pytest-fix

Conversation

@doronbehar

Copy link
Copy Markdown
Contributor

Fixes pytest failures we encountered with Nix:

=================================== FAILURES ===================================
_________ test_line_datetime_binedges_with_errorbars[mpl-static-band] __________

mode = 'band'

    @pytest.mark.parametrize("mode", ['band', 'bar', True])
    def test_line_datetime_binedges_with_errorbars(mode):
>       t = np.arange(
            np.datetime64('2017-03-16T20:58:17'), np.datetime64('2017-03-16T21:15:17'), 20
        )
E       DeprecationWarning: The 'generic' unit for NumPy timedelta is deprecated, and will raise an error in the future. This includes implicit conversion of bare integers (e.g. `+ 1`).Please use a specific unit instead.

tests/backends/matplotlib/mpl_line_test.py:136: DeprecationWarning
__________ test_line_datetime_binedges_with_errorbars[mpl-static-bar] __________

mode = 'bar'

    @pytest.mark.parametrize("mode", ['band', 'bar', True])
    def test_line_datetime_binedges_with_errorbars(mode):
>       t = np.arange(
            np.datetime64('2017-03-16T20:58:17'), np.datetime64('2017-03-16T21:15:17'), 20
        )
E       DeprecationWarning: The 'generic' unit for NumPy timedelta is deprecated, and will raise an error in the future. This includes implicit conversion of bare integers (e.g. `+ 1`).Please use a specific unit instead.

tests/backends/matplotlib/mpl_line_test.py:136: DeprecationWarning
_________ test_line_datetime_binedges_with_errorbars[mpl-static-True] __________

mode = True

    @pytest.mark.parametrize("mode", ['band', 'bar', True])
    def test_line_datetime_binedges_with_errorbars(mode):
>       t = np.arange(
            np.datetime64('2017-03-16T20:58:17'), np.datetime64('2017-03-16T21:15:17'), 20
        )
E       DeprecationWarning: The 'generic' unit for NumPy timedelta is deprecated, and will raise an error in the future. This includes implicit conversion of bare integers (e.g. `+ 1`).Please use a specific unit instead.

tests/backends/matplotlib/mpl_line_test.py:136: DeprecationWarning
_______ test_line_datetime_binedges_with_errorbars[mpl-interactive-band] _______

mode = 'band'

    @pytest.mark.parametrize("mode", ['band', 'bar', True])
    def test_line_datetime_binedges_with_errorbars(mode):
>       t = np.arange(
            np.datetime64('2017-03-16T20:58:17'), np.datetime64('2017-03-16T21:15:17'), 20
        )
E       DeprecationWarning: The 'generic' unit for NumPy timedelta is deprecated, and will raise an error in the future. This includes implicit conversion of bare integers (e.g. `+ 1`).Please use a specific unit instead.

tests/backends/matplotlib/mpl_line_test.py:136: DeprecationWarning
_______ test_line_datetime_binedges_with_errorbars[mpl-interactive-bar] ________

mode = 'bar'

    @pytest.mark.parametrize("mode", ['band', 'bar', True])
    def test_line_datetime_binedges_with_errorbars(mode):
>       t = np.arange(
            np.datetime64('2017-03-16T20:58:17'), np.datetime64('2017-03-16T21:15:17'), 20
        )
E       DeprecationWarning: The 'generic' unit for NumPy timedelta is deprecated, and will raise an error in the future. This includes implicit conversion of bare integers (e.g. `+ 1`).Please use a specific unit instead.

tests/backends/matplotlib/mpl_line_test.py:136: DeprecationWarning
_______ test_line_datetime_binedges_with_errorbars[mpl-interactive-True] _______

mode = True

    @pytest.mark.parametrize("mode", ['band', 'bar', True])
    def test_line_datetime_binedges_with_errorbars(mode):
>       t = np.arange(
            np.datetime64('2017-03-16T20:58:17'), np.datetime64('2017-03-16T21:15:17'), 20
        )
E       DeprecationWarning: The 'generic' unit for NumPy timedelta is deprecated, and will raise an error in the future. This includes implicit conversion of bare integers (e.g. `+ 1`).Please use a specific unit instead.

tests/backends/matplotlib/mpl_line_test.py:136: DeprecationWarning
__________________________ test_find_limits_datetime ___________________________

    def test_find_limits_datetime():
>       time = np.arange(
            np.datetime64('2017-03-16T20:58:17'), np.datetime64('2017-03-16T21:15:17'), 20
        )
E       DeprecationWarning: The 'generic' unit for NumPy timedelta is deprecated, and will raise an error in the future. This includes implicit conversion of bare integers (e.g. `+ 1`).Please use a specific unit instead.

tests/core/limits_test.py:123: DeprecationWarning
___________________ test_plot_1d_datetime_coord[mpl-static] ____________________

    def test_plot_1d_datetime_coord():
>       t = np.arange(
            np.datetime64('2017-03-16T20:58:17'), np.datetime64('2017-03-16T21:15:17'), 20
        )
E       DeprecationWarning: The 'generic' unit for NumPy timedelta is deprecated, and will raise an error in the future. This includes implicit conversion of bare integers (e.g. `+ 1`).Please use a specific unit instead.

tests/plotting/plot_1d_test.py:298: DeprecationWarning
_________________ test_plot_1d_datetime_coord[mpl-interactive] _________________

    def test_plot_1d_datetime_coord():
>       t = np.arange(
            np.datetime64('2017-03-16T20:58:17'), np.datetime64('2017-03-16T21:15:17'), 20
        )
E       DeprecationWarning: The 'generic' unit for NumPy timedelta is deprecated, and will raise an error in the future. This includes implicit conversion of bare integers (e.g. `+ 1`).Please use a specific unit instead.

tests/plotting/plot_1d_test.py:298: DeprecationWarning
_______________ test_plot_1d_datetime_coord_binedges[mpl-static] _______________

    def test_plot_1d_datetime_coord_binedges():
>       t = np.arange(
            np.datetime64('2017-03-16T20:58:17'), np.datetime64('2017-03-16T21:15:17'), 20
        )
E       DeprecationWarning: The 'generic' unit for NumPy timedelta is deprecated, and will raise an error in the future. This includes implicit conversion of bare integers (e.g. `+ 1`).Please use a specific unit instead.

tests/plotting/plot_1d_test.py:311: DeprecationWarning
____________ test_plot_1d_datetime_coord_binedges[mpl-interactive] _____________

    def test_plot_1d_datetime_coord_binedges():
>       t = np.arange(
            np.datetime64('2017-03-16T20:58:17'), np.datetime64('2017-03-16T21:15:17'), 20
        )
E       DeprecationWarning: The 'generic' unit for NumPy timedelta is deprecated, and will raise an error in the future. This includes implicit conversion of bare integers (e.g. `+ 1`).Please use a specific unit instead.

tests/plotting/plot_1d_test.py:311: DeprecationWarning
______________ test_plot_1d_datetime_coord_with_mask[mpl-static] _______________

    def test_plot_1d_datetime_coord_with_mask():
>       t = np.arange(
            np.datetime64('2017-03-16T20:58:17'), np.datetime64('2017-03-16T21:15:17'), 20
        )
E       DeprecationWarning: The 'generic' unit for NumPy timedelta is deprecated, and will raise an error in the future. This includes implicit conversion of bare integers (e.g. `+ 1`).Please use a specific unit instead.

tests/plotting/plot_1d_test.py:324: DeprecationWarning
____________ test_plot_1d_datetime_coord_with_mask[mpl-interactive] ____________

    def test_plot_1d_datetime_coord_with_mask():
>       t = np.arange(
            np.datetime64('2017-03-16T20:58:17'), np.datetime64('2017-03-16T21:15:17'), 20
        )
E       DeprecationWarning: The 'generic' unit for NumPy timedelta is deprecated, and will raise an error in the future. This includes implicit conversion of bare integers (e.g. `+ 1`).Please use a specific unit instead.

tests/plotting/plot_1d_test.py:324: DeprecationWarning
________ test_plot_1d_datetime_coord_with_mask_and_binedges[mpl-static] ________

    def test_plot_1d_datetime_coord_with_mask_and_binedges():
>       t = np.arange(
            np.datetime64('2017-03-16T20:58:17'), np.datetime64('2017-03-16T21:15:17'), 20
        )
E       DeprecationWarning: The 'generic' unit for NumPy timedelta is deprecated, and will raise an error in the future. This includes implicit conversion of bare integers (e.g. `+ 1`).Please use a specific unit instead.

tests/plotting/plot_1d_test.py:338: DeprecationWarning
_____ test_plot_1d_datetime_coord_with_mask_and_binedges[mpl-interactive] ______

    def test_plot_1d_datetime_coord_with_mask_and_binedges():
>       t = np.arange(
            np.datetime64('2017-03-16T20:58:17'), np.datetime64('2017-03-16T21:15:17'), 20
        )
E       DeprecationWarning: The 'generic' unit for NumPy timedelta is deprecated, and will raise an error in the future. This includes implicit conversion of bare integers (e.g. `+ 1`).Please use a specific unit instead.

tests/plotting/plot_1d_test.py:338: DeprecationWarning
_________________ test_plot_1d_datetime_coord_log[mpl-static] __________________

    def test_plot_1d_datetime_coord_log():
>       t = np.arange(
            np.datetime64('2017-03-16T20:58:17'), np.datetime64('2017-03-16T21:15:17'), 20
        )
E       DeprecationWarning: The 'generic' unit for NumPy timedelta is deprecated, and will raise an error in the future. This includes implicit conversion of bare integers (e.g. `+ 1`).Please use a specific unit instead.

tests/plotting/plot_1d_test.py:352: DeprecationWarning
_______________ test_plot_1d_datetime_coord_log[mpl-interactive] _______________

    def test_plot_1d_datetime_coord_log():
>       t = np.arange(
            np.datetime64('2017-03-16T20:58:17'), np.datetime64('2017-03-16T21:15:17'), 20
        )
E       DeprecationWarning: The 'generic' unit for NumPy timedelta is deprecated, and will raise an error in the future. This includes implicit conversion of bare integers (e.g. `+ 1`).Please use a specific unit instead.

tests/plotting/plot_1d_test.py:352: DeprecationWarning
_____________ test_plot_1d_datetime_coord_log_binedges[mpl-static] _____________

    def test_plot_1d_datetime_coord_log_binedges():
>       t = np.arange(
            np.datetime64('2017-03-16T20:58:17'), np.datetime64('2017-03-16T21:15:17'), 20
        )
E       DeprecationWarning: The 'generic' unit for NumPy timedelta is deprecated, and will raise an error in the future. This includes implicit conversion of bare integers (e.g. `+ 1`).Please use a specific unit instead.

tests/plotting/plot_1d_test.py:365: DeprecationWarning
__________ test_plot_1d_datetime_coord_log_binedges[mpl-interactive] ___________

    def test_plot_1d_datetime_coord_log_binedges():
>       t = np.arange(
            np.datetime64('2017-03-16T20:58:17'), np.datetime64('2017-03-16T21:15:17'), 20
        )
E       DeprecationWarning: The 'generic' unit for NumPy timedelta is deprecated, and will raise an error in the future. This includes implicit conversion of bare integers (e.g. `+ 1`).Please use a specific unit instead.

tests/plotting/plot_1d_test.py:365: DeprecationWarning
____________ test_plot_1d_datetime_coord_log_with_mask[mpl-static] _____________

    def test_plot_1d_datetime_coord_log_with_mask():
>       t = np.arange(
            np.datetime64('2017-03-16T20:58:17'), np.datetime64('2017-03-16T21:15:17'), 20
        )
E       DeprecationWarning: The 'generic' unit for NumPy timedelta is deprecated, and will raise an error in the future. This includes implicit conversion of bare integers (e.g. `+ 1`).Please use a specific unit instead.

tests/plotting/plot_1d_test.py:378: DeprecationWarning
__________ test_plot_1d_datetime_coord_log_with_mask[mpl-interactive] __________

    def test_plot_1d_datetime_coord_log_with_mask():
>       t = np.arange(
            np.datetime64('2017-03-16T20:58:17'), np.datetime64('2017-03-16T21:15:17'), 20
        )
E       DeprecationWarning: The 'generic' unit for NumPy timedelta is deprecated, and will raise an error in the future. This includes implicit conversion of bare integers (e.g. `+ 1`).Please use a specific unit instead.

tests/plotting/plot_1d_test.py:378: DeprecationWarning
____________________ test_plot_1d_datetime_data[mpl-static] ____________________

    def test_plot_1d_datetime_data():
>       t = np.arange(
            np.datetime64('2017-03-16T20:58:17'), np.datetime64('2017-03-16T21:15:17'), 20
        )
E       DeprecationWarning: The 'generic' unit for NumPy timedelta is deprecated, and will raise an error in the future. This includes implicit conversion of bare integers (e.g. `+ 1`).Please use a specific unit instead.

tests/plotting/plot_1d_test.py:392: DeprecationWarning
_________________ test_plot_1d_datetime_data[mpl-interactive] __________________

    def test_plot_1d_datetime_data():
>       t = np.arange(
            np.datetime64('2017-03-16T20:58:17'), np.datetime64('2017-03-16T21:15:17'), 20
        )
E       DeprecationWarning: The 'generic' unit for NumPy timedelta is deprecated, and will raise an error in the future. This includes implicit conversion of bare integers (e.g. `+ 1`).Please use a specific unit instead.

tests/plotting/plot_1d_test.py:392: DeprecationWarning
_________________ test_plot_2d_datetime_coord[mpl-static-True] _________________

linspace = True

    @pytest.mark.parametrize('linspace', [True, False])
    def test_plot_2d_datetime_coord(linspace):
>       t = np.arange(
            np.datetime64('2017-03-16T20:58:17'), np.datetime64('2017-03-16T21:15:17'), 20
        )
E       DeprecationWarning: The 'generic' unit for NumPy timedelta is deprecated, and will raise an error in the future. This includes implicit conversion of bare integers (e.g. `+ 1`).Please use a specific unit instead.

tests/plotting/plot_2d_test.py:236: DeprecationWarning
________________ test_plot_2d_datetime_coord[mpl-static-False] _________________

linspace = False

    @pytest.mark.parametrize('linspace', [True, False])
    def test_plot_2d_datetime_coord(linspace):
>       t = np.arange(
            np.datetime64('2017-03-16T20:58:17'), np.datetime64('2017-03-16T21:15:17'), 20
        )
E       DeprecationWarning: The 'generic' unit for NumPy timedelta is deprecated, and will raise an error in the future. This includes implicit conversion of bare integers (e.g. `+ 1`).Please use a specific unit instead.

tests/plotting/plot_2d_test.py:236: DeprecationWarning
______________ test_plot_2d_datetime_coord[mpl-interactive-True] _______________

linspace = True

    @pytest.mark.parametrize('linspace', [True, False])
    def test_plot_2d_datetime_coord(linspace):
>       t = np.arange(
            np.datetime64('2017-03-16T20:58:17'), np.datetime64('2017-03-16T21:15:17'), 20
        )
E       DeprecationWarning: The 'generic' unit for NumPy timedelta is deprecated, and will raise an error in the future. This includes implicit conversion of bare integers (e.g. `+ 1`).Please use a specific unit instead.

tests/plotting/plot_2d_test.py:236: DeprecationWarning
______________ test_plot_2d_datetime_coord[mpl-interactive-False] ______________

linspace = False

    @pytest.mark.parametrize('linspace', [True, False])
    def test_plot_2d_datetime_coord(linspace):
>       t = np.arange(
            np.datetime64('2017-03-16T20:58:17'), np.datetime64('2017-03-16T21:15:17'), 20
        )
E       DeprecationWarning: The 'generic' unit for NumPy timedelta is deprecated, and will raise an error in the future. This includes implicit conversion of bare integers (e.g. `+ 1`).Please use a specific unit instead.

tests/plotting/plot_2d_test.py:236: DeprecationWarning
____________ test_plot_2d_datetime_coord_binedges[mpl-static-True] _____________

linspace = True

    @pytest.mark.parametrize('linspace', [True, False])
    def test_plot_2d_datetime_coord_binedges(linspace):
>       t = np.arange(
            np.datetime64('2017-03-16T20:58:17'), np.datetime64('2017-03-16T21:15:17'), 20
        )
E       DeprecationWarning: The 'generic' unit for NumPy timedelta is deprecated, and will raise an error in the future. This includes implicit conversion of bare integers (e.g. `+ 1`).Please use a specific unit instead.

tests/plotting/plot_2d_test.py:253: DeprecationWarning
____________ test_plot_2d_datetime_coord_binedges[mpl-static-False] ____________

linspace = False

    @pytest.mark.parametrize('linspace', [True, False])
    def test_plot_2d_datetime_coord_binedges(linspace):
>       t = np.arange(
            np.datetime64('2017-03-16T20:58:17'), np.datetime64('2017-03-16T21:15:17'), 20
        )
E       DeprecationWarning: The 'generic' unit for NumPy timedelta is deprecated, and will raise an error in the future. This includes implicit conversion of bare integers (e.g. `+ 1`).Please use a specific unit instead.

tests/plotting/plot_2d_test.py:253: DeprecationWarning
__________ test_plot_2d_datetime_coord_binedges[mpl-interactive-True] __________

linspace = True

    @pytest.mark.parametrize('linspace', [True, False])
    def test_plot_2d_datetime_coord_binedges(linspace):
>       t = np.arange(
            np.datetime64('2017-03-16T20:58:17'), np.datetime64('2017-03-16T21:15:17'), 20
        )
E       DeprecationWarning: The 'generic' unit for NumPy timedelta is deprecated, and will raise an error in the future. This includes implicit conversion of bare integers (e.g. `+ 1`).Please use a specific unit instead.

tests/plotting/plot_2d_test.py:253: DeprecationWarning
_________ test_plot_2d_datetime_coord_binedges[mpl-interactive-False] __________

linspace = False

    @pytest.mark.parametrize('linspace', [True, False])
    def test_plot_2d_datetime_coord_binedges(linspace):
>       t = np.arange(
            np.datetime64('2017-03-16T20:58:17'), np.datetime64('2017-03-16T21:15:17'), 20
        )
E       DeprecationWarning: The 'generic' unit for NumPy timedelta is deprecated, and will raise an error in the future. This includes implicit conversion of bare integers (e.g. `+ 1`).Please use a specific unit instead.

tests/plotting/plot_2d_test.py:253: DeprecationWarning
_____________ test_plot_1d_data_over_2d_data_datetime[mpl-static] ______________

    def test_plot_1d_data_over_2d_data_datetime():
        # 2d data
>       t = np.arange(
            np.datetime64('2017-03-16T20:58:17'), np.datetime64('2017-03-16T21:15:17'), 20
        )
E       DeprecationWarning: The 'generic' unit for NumPy timedelta is deprecated, and will raise an error in the future. This includes implicit conversion of bare integers (e.g. `+ 1`).Please use a specific unit instead.

tests/plotting/plot_2d_test.py:319: DeprecationWarning
___________ test_plot_1d_data_over_2d_data_datetime[mpl-interactive] ___________

    def test_plot_1d_data_over_2d_data_datetime():
        # 2d data
>       t = np.arange(
            np.datetime64('2017-03-16T20:58:17'), np.datetime64('2017-03-16T21:15:17'), 20
        )
E       DeprecationWarning: The 'generic' unit for NumPy timedelta is deprecated, and will raise an error in the future. This includes implicit conversion of bare integers (e.g. `+ 1`).Please use a specific unit instead.

tests/plotting/plot_2d_test.py:319: DeprecationWarning
=========================== short test summary info ============================
FAILED tests/backends/matplotlib/mpl_line_test.py::test_line_datetime_binedges_with_errorbars[mpl-static-band] - DeprecationWarning: The 'generic' unit for NumPy timedelta is deprecated, a...
FAILED tests/backends/matplotlib/mpl_line_test.py::test_line_datetime_binedges_with_errorbars[mpl-static-bar] - DeprecationWarning: The 'generic' unit for NumPy timedelta is deprecated, a...
FAILED tests/backends/matplotlib/mpl_line_test.py::test_line_datetime_binedges_with_errorbars[mpl-static-True] - DeprecationWarning: The 'generic' unit for NumPy timedelta is deprecated, a...
FAILED tests/backends/matplotlib/mpl_line_test.py::test_line_datetime_binedges_with_errorbars[mpl-interactive-band] - DeprecationWarning: The 'generic' unit for NumPy timedelta is deprecated, a...
FAILED tests/backends/matplotlib/mpl_line_test.py::test_line_datetime_binedges_with_errorbars[mpl-interactive-bar] - DeprecationWarning: The 'generic' unit for NumPy timedelta is deprecated, a...
FAILED tests/backends/matplotlib/mpl_line_test.py::test_line_datetime_binedges_with_errorbars[mpl-interactive-True] - DeprecationWarning: The 'generic' unit for NumPy timedelta is deprecated, a...
FAILED tests/core/limits_test.py::test_find_limits_datetime - DeprecationWarning: The 'generic' unit for NumPy timedelta is deprecated, a...
FAILED tests/plotting/plot_1d_test.py::test_plot_1d_datetime_coord[mpl-static] - DeprecationWarning: The 'generic' unit for NumPy timedelta is deprecated, a...
FAILED tests/plotting/plot_1d_test.py::test_plot_1d_datetime_coord[mpl-interactive] - DeprecationWarning: The 'generic' unit for NumPy timedelta is deprecated, a...
FAILED tests/plotting/plot_1d_test.py::test_plot_1d_datetime_coord_binedges[mpl-static] - DeprecationWarning: The 'generic' unit for NumPy timedelta is deprecated, a...
FAILED tests/plotting/plot_1d_test.py::test_plot_1d_datetime_coord_binedges[mpl-interactive] - DeprecationWarning: The 'generic' unit for NumPy timedelta is deprecated, a...
FAILED tests/plotting/plot_1d_test.py::test_plot_1d_datetime_coord_with_mask[mpl-static] - DeprecationWarning: The 'generic' unit for NumPy timedelta is deprecated, a...
FAILED tests/plotting/plot_1d_test.py::test_plot_1d_datetime_coord_with_mask[mpl-interactive] - DeprecationWarning: The 'generic' unit for NumPy timedelta is deprecated, a...
FAILED tests/plotting/plot_1d_test.py::test_plot_1d_datetime_coord_with_mask_and_binedges[mpl-static] - DeprecationWarning: The 'generic' unit for NumPy timedelta is deprecated, a...
FAILED tests/plotting/plot_1d_test.py::test_plot_1d_datetime_coord_with_mask_and_binedges[mpl-interactive] - DeprecationWarning: The 'generic' unit for NumPy timedelta is deprecated, a...
FAILED tests/plotting/plot_1d_test.py::test_plot_1d_datetime_coord_log[mpl-static] - DeprecationWarning: The 'generic' unit for NumPy timedelta is deprecated, a...
FAILED tests/plotting/plot_1d_test.py::test_plot_1d_datetime_coord_log[mpl-interactive] - DeprecationWarning: The 'generic' unit for NumPy timedelta is deprecated, a...
FAILED tests/plotting/plot_1d_test.py::test_plot_1d_datetime_coord_log_binedges[mpl-static] - DeprecationWarning: The 'generic' unit for NumPy timedelta is deprecated, a...
FAILED tests/plotting/plot_1d_test.py::test_plot_1d_datetime_coord_log_binedges[mpl-interactive] - DeprecationWarning: The 'generic' unit for NumPy timedelta is deprecated, a...
FAILED tests/plotting/plot_1d_test.py::test_plot_1d_datetime_coord_log_with_mask[mpl-static] - DeprecationWarning: The 'generic' unit for NumPy timedelta is deprecated, a...
FAILED tests/plotting/plot_1d_test.py::test_plot_1d_datetime_coord_log_with_mask[mpl-interactive] - DeprecationWarning: The 'generic' unit for NumPy timedelta is deprecated, a...
FAILED tests/plotting/plot_1d_test.py::test_plot_1d_datetime_data[mpl-static] - DeprecationWarning: The 'generic' unit for NumPy timedelta is deprecated, a...
FAILED tests/plotting/plot_1d_test.py::test_plot_1d_datetime_data[mpl-interactive] - DeprecationWarning: The 'generic' unit for NumPy timedelta is deprecated, a...
FAILED tests/plotting/plot_2d_test.py::test_plot_2d_datetime_coord[mpl-static-True] - DeprecationWarning: The 'generic' unit for NumPy timedelta is deprecated, a...
FAILED tests/plotting/plot_2d_test.py::test_plot_2d_datetime_coord[mpl-static-False] - DeprecationWarning: The 'generic' unit for NumPy timedelta is deprecated, a...
FAILED tests/plotting/plot_2d_test.py::test_plot_2d_datetime_coord[mpl-interactive-True] - DeprecationWarning: The 'generic' unit for NumPy timedelta is deprecated, a...
FAILED tests/plotting/plot_2d_test.py::test_plot_2d_datetime_coord[mpl-interactive-False] - DeprecationWarning: The 'generic' unit for NumPy timedelta is deprecated, a...
FAILED tests/plotting/plot_2d_test.py::test_plot_2d_datetime_coord_binedges[mpl-static-True] - DeprecationWarning: The 'generic' unit for NumPy timedelta is deprecated, a...
FAILED tests/plotting/plot_2d_test.py::test_plot_2d_datetime_coord_binedges[mpl-static-False] - DeprecationWarning: The 'generic' unit for NumPy timedelta is deprecated, a...
FAILED tests/plotting/plot_2d_test.py::test_plot_2d_datetime_coord_binedges[mpl-interactive-True] - DeprecationWarning: The 'generic' unit for NumPy timedelta is deprecated, a...
FAILED tests/plotting/plot_2d_test.py::test_plot_2d_datetime_coord_binedges[mpl-interactive-False] - DeprecationWarning: The 'generic' unit for NumPy timedelta is deprecated, a...
FAILED tests/plotting/plot_2d_test.py::test_plot_1d_data_over_2d_data_datetime[mpl-static] - DeprecationWarning: The 'generic' unit for NumPy timedelta is deprecated, a...
FAILED tests/plotting/plot_2d_test.py::test_plot_1d_data_over_2d_data_datetime[mpl-interactive] - DeprecationWarning: The 'generic' unit for NumPy timedelta is deprecated, a...
================ 33 failed, 1240 passed, 3 deselected in 58.29s ================

Use `np.timedelta64(20, 's')` instead of a bare `int` step in
`np.arange(datetime64, datetime64, ...)` calls, since Numpy now
deprecates the implicit 'generic' unit conversion.

See also:

scipp/scipp@217b3ba

@SimonHeybrock SimonHeybrock left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@MridulS
MridulS merged commit 1c52f1e into scipp:main Jul 29, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants