qdk_chemistry.migrate.__main__ module

Command-line entry point: python -m qdk_chemistry.migrate OLD NEW.

exception qdk_chemistry.migrate.__main__.MigrationError

Bases: RuntimeError

Raised when a file cannot be migrated to the current serialization version.

qdk_chemistry.migrate.__main__.convert_file(src, dst)

Migrate a single data file to the serialization version the library accepts.

Return type:

Path

Parameters:
  • src (str | Path) – Path to the file to read (format inferred from its extension).

  • dst (str | Path) – Path to write the migrated file (format inferred from its extension).

Returns:

The dst path as a pathlib.Path.

Raises:

MigrationError – If the data type/format cannot be determined, the source and destination are the same file, the file is already at the current serialization version, or the migration fails.

qdk_chemistry.migrate.__main__.main(argv=None)[source]

Run the migration CLI; return a process exit code.

Return type:

int

Parameters:

argv (list[str] | None)