From c6f72ac4d81a721d2977a69b71745a5fa64809b3 Mon Sep 17 00:00:00 2001 From: fynnbe Date: Thu, 23 May 2024 11:27:25 +0200 Subject: [PATCH] add dois to collection entry --- bioimageio_collection_backoffice/backup.py | 1 - bioimageio_collection_backoffice/collection_json.py | 2 ++ bioimageio_collection_backoffice/remote_collection.py | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/bioimageio_collection_backoffice/backup.py b/bioimageio_collection_backoffice/backup.py index fcc8bf40..a72a1e48 100644 --- a/bioimageio_collection_backoffice/backup.py +++ b/bioimageio_collection_backoffice/backup.py @@ -15,7 +15,6 @@ from bioimageio.spec.utils import download from loguru import logger from ruyaml import YAML -from typing_extensions import Literal, assert_never from ._settings import settings from .remote_collection import Record, RemoteCollection diff --git a/bioimageio_collection_backoffice/collection_json.py b/bioimageio_collection_backoffice/collection_json.py index 8aefd560..6fdafa12 100644 --- a/bioimageio_collection_backoffice/collection_json.py +++ b/bioimageio_collection_backoffice/collection_json.py @@ -54,6 +54,8 @@ class CollectionEntry(Node, frozen=True): type: Literal["application", "model", "notebook", "dataset"] versions: Sequence[str] """available versions of this resource. newest first""" + dois: Sequence[Optional[str]] + """version specific dois of the available versions. newest first""" class CollectionWebsiteConfig(CollectionWebsiteConfigTemplate, frozen=True): diff --git a/bioimageio_collection_backoffice/remote_collection.py b/bioimageio_collection_backoffice/remote_collection.py index 1cbbe204..ecf94b90 100644 --- a/bioimageio_collection_backoffice/remote_collection.py +++ b/bioimageio_collection_backoffice/remote_collection.py @@ -24,8 +24,7 @@ Union, ) -from bioimageio.spec import ValidationContext, build_description -from bioimageio.spec.collection import CollectionDescr +from bioimageio.spec import ValidationContext from bioimageio.spec.common import HttpUrl from bioimageio.spec.utils import ( download, @@ -975,5 +974,6 @@ def maybe_swap_with_thumbnail( training_data=rdf["training_data"] if "training_data" in rdf else None, type=rdf["type"], versions=[v.version for v in versions], + dois=[v.doi for v in versions], ) ]