Skip to content

h5py 2.10.0 Deprecation Warning #47

Closed
@zakv

Description

@zakv

Hi all, I get the deprecation warning below when using h5py 2.10.0. It appears in runmanager when compiling shots and in lyse when analysis scripts run.

C:\Users\waveguide3\Desktop\labscript_test_install_3\labscript_utils\h5_lock.py:64: H5pyDeprecationWarning: The default file mode will change to 'r' (read-only) in h5py 3.0. To suppress this warning, pass the mode you need to h5py.File(), or set the global default h5.get_config().default_file_mode, or set the environment variable H5PY_DEFAULT_READONLY=1. Available modes are: 'r', 'r+', 'w', 'w-'/'x', 'a'. See the docs for details.
  _File.__init__(self, name, mode, driver, libver, **kwds)

This was done using labscript-utils mercurial changeset e5a908bdc9cb. In the most recent git commit, this command is now on line 53:

_File.__init__(self, name, mode, driver, libver, **kwds)
.

Looks like having mode=None is deprecated now. The h5py code for handling that case is here: https://github.com/h5py/h5py/blob/497d6a8ccbf3519fea2cd10093d0cee5da72358a/h5py/_hl/files.py#L188. I'm not very familiar with h5_lock.py but it may be fine to just use mode='a'. Alternatively the old h5py behavior could be reproduced by recreating those try/except statements from h5py in h5lock.py.

The warning pollutes the terminal outputs in runmanager and lyse but doesn't prevent anything from working, so this is a pretty minor issue. Also, h5py 2.9.0 works fine and doesn't issue this warning.

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