Skip to content

netCDF4 ndarray.shape DeprecationWarning floods example-notebook runs (pytest.ini filter doesn't reach them) #418

Closed

Description

@rmcd-mscb

The filter in autotest/pytest.ini doesn't cover notebooks: autotest_exs/test_notebooks.py runs them in a subprocess via ipython, so CI example runs and interactive users get the full flood.

Amplifier: flopy sets warnings.simplefilter("always", DeprecationWarning) globally at import, defeating dedup and any earlier-set filter — so the suppression must be applied after import pywatershed; PYTHONWARNINGS does not work (measurements above).

Options: (a) add the filter after the imports in each examples/0*.ipynb; (b) install it inside pywatershed's NetCDF writer module so it lands after flopy; (c) raise it with flopy, since the global simplefilter affects every downstream consumer.

Tie-in: add these sites to the MAINTENANCE.md "Drop the netCDF4 ndarray.shape warning filter" action list so they're all removed together when netCDF4 ships PR #1469.

Activity

  1. jmccreight commented on Sep 12, 2026

    @jmccreight
    Collaborator

    thanks for digging into that more than I have. I thought I'd silenced it, but I havent been running noteboks lately, though I soon will be.

    Next time i see @jswhit ride his bike up my street I'm going to shout "ship the new version, already!"

    I notified flopy devs informally. I am applying fixes in #419. They were quite messy to really get at the root but should be easy to revert/fix one bright and glorious day in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions