xnn.common.models.hub.zenodo.choose#

xnn.common.models.hub.zenodo.choose(record_files, filename, suffixes, recid)[source]#

Pick the model file of a record.

Parameters:
  • record_files (list of dict) – Output of files().

  • filename (str or None) – Requested file name; None picks the only file with a model or archive suffix.

  • suffixes (tuple of str) – Suffixes that mark a model file or an archive.

  • recid (str) – Record id, for error messages.

Returns:

The chosen file entry.

Return type:

dict

Raises:
  • FileNotFoundError – If filename is not in the record, or nothing looks like a model.

  • ValueError – If several files could be the model and no filename was given.