Coverage for src/bioimageio/spec/application/v0_2.py: 100%
35 statements
« prev ^ index » next coverage.py v7.15.4, created at 2026-08-18 09:17 +0000
« prev ^ index » next coverage.py v7.15.4, created at 2026-08-18 09:17 +0000
1from __future__ import annotations
3from typing import TYPE_CHECKING, ClassVar, Literal
5from pydantic import Field
6from typing_extensions import Annotated
8from .._internal.common_nodes import Node
9from .._internal.io_packaging import FileSource_package
10from .._internal.url import HttpUrl as HttpUrl
11from ..generic.v0_2 import VALID_COVER_IMAGE_EXTENSIONS as VALID_COVER_IMAGE_EXTENSIONS
12from ..generic.v0_2 import AttachmentsDescr as AttachmentsDescr
13from ..generic.v0_2 import Author as Author
14from ..generic.v0_2 import BadgeDescr as BadgeDescr
15from ..generic.v0_2 import CiteEntry as CiteEntry
16from ..generic.v0_2 import Doi as Doi
17from ..generic.v0_2 import GenericDescrBase
18from ..generic.v0_2 import LinkedResource as LinkedResource
19from ..generic.v0_2 import Maintainer as Maintainer
20from ..generic.v0_2 import OrcidId as OrcidId
21from ..generic.v0_2 import RelativeFilePath as RelativeFilePath
22from ..generic.v0_2 import ResourceId as ResourceId
23from ..generic.v0_2 import Uploader as Uploader
24from ..generic.v0_2 import Version as Version
27class ApplicationId(ResourceId):
28 pass
31class ApplicationDescr(GenericDescrBase):
32 """Bioimage.io description of an application."""
34 implemented_type: ClassVar[Literal["application"]] = "application"
35 if TYPE_CHECKING:
36 type: Literal["application"] = "application"
37 else:
38 type: Literal["application"]
40 id: ApplicationId | None = None
41 """bioimage.io-wide unique resource identifier
42 assigned by bioimage.io; version **un**specific."""
44 source: Annotated[
45 FileSource_package | None,
46 Field(description="URL or path to the source of the application"),
47 ] = None
48 """The primary source of the application"""
51class LinkedApplication(Node):
52 """Reference to a bioimage.io application."""
54 id: ApplicationId
55 """A valid application `id` from the bioimage.io collection."""
57 version_number: int | None = None
58 """version number (n-th published version, not the semantic version) of linked application"""