Skip to content

Resetting warnings prevents downstream processes from managing warnings #44

@CBroz1

Description

@CBroz1

This package resets warnings globally here:

# import h5py
import warnings
warnings.simplefilter(action='ignore', category=FutureWarning)
import h5py
warnings.resetwarnings()

In running my dependent package, I'd like to manage other warnings, but they're reset when trigger this import

Alternatively, this package could disable these warnings only for the scope of this import

import warnings
with warnings.catch_warnings():
    warnings.simplefilter(action="ignore", category=FutureWarning)
    import h5py

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions