8.7.1.6. pymodaq_data.h5modules.migration module

Migration of the h5 files written by older versions of PyMoDAQ

Older versions stored the strings of the string nodes (such as the logger) as pickles. They are still read, but the migration rewrites them as plain UTF-8, as the current version does, in a copy of the file.

pymodaq_data.h5modules.migration.default_destination(source)[source]
Return type:

Path

pymodaq_data.h5modules.migration.migrate_h5_file(source, destination=None)[source]

Write a copy of a h5 file in which the pickled strings are rewritten as UTF-8

The source file is never modified, and an existing destination file is never overwritten.

Parameters:
  • source (Union[str, Path]) – The file to migrate

  • destination (Union[str, Path, None]) – The file to create, by default the name of the source followed by _migrated

Return type:

Tuple[Path, int]

Returns:

  • Path (the migrated file)

  • int (the number of string nodes that were migrated)

Raises: