Skip to content

Session.save(overwrite=False) can create inconsistent files #1192

@gdementen

Description

@gdementen

overwrite=False is an nasty functionality :

  • it is a misnomer because the file is updated (and thus overwritten), just not cleared/started from scratch
  • in combination with groups, it can create invalid files. For example, in test_session.py:_test_io, if we redefine a01 (=a4_01), do not redefine ano01, the file still contains the original ano01 group which "expects" the original a axis but since the reference to the axis is by name, it refers to the new a4 axis which has incompatible labels. We got away with it so far because we did not test the result for that variable and (in general) do not test that a group labels are actually valid on their axis when creating them/loading them from H5 (see check that key is valid on axis[key] #596).

Unsure if the functionality is used much, so not high priority so far.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions