modelrunner.run.compatibility.triage module

Contains code necessary for deciding which format version was used to write a file

guess_format(path)[source]

guess the format of a given store

Parameters:

path (str or Path) – Path pointing to a file

Returns:

The store format

Return type:

str

normalize_zarr_store(store, mode='a')[source]

determine best file format for zarr storage

In particular, we use a ZipStore when a path looking like a file is given.

Parameters:
  • store (Store) – User-provided store

  • mode (str) – The mode with which the file will be opened

Return type:

Store | None

Returns:

result_check_load_old_version(path, loc, *, model=None)[source]

check whether the resource can be loaded with an older version of the package

Parameters:
  • path (str or Path) – The path to the resource to be loaded

  • loc (str) – Label, key, or location of the item to be loaded

  • model (ModelBase, optional) – Optional model that was used to write this result

Returns:

The loaded result or None if we cannot load it with the old versions

Return type:

Result