Coverage for bioimageio/spec/application/v0_2.py: 100%
35 statements
« prev ^ index » next coverage.py v7.8.0, created at 2025-04-02 14:21 +0000
« prev ^ index » next coverage.py v7.8.0, created at 2025-04-02 14:21 +0000
1from typing import TYPE_CHECKING, ClassVar, Literal, Optional
3from pydantic import Field
4from typing_extensions import Annotated
6from .._internal.common_nodes import Node
7from .._internal.io_basics import AbsoluteFilePath as AbsoluteFilePath
8from .._internal.types import ImportantFileSource
9from .._internal.url import HttpUrl as HttpUrl
10from ..generic.v0_2 import VALID_COVER_IMAGE_EXTENSIONS as VALID_COVER_IMAGE_EXTENSIONS
11from ..generic.v0_2 import AttachmentsDescr as AttachmentsDescr
12from ..generic.v0_2 import Author as Author
13from ..generic.v0_2 import BadgeDescr as BadgeDescr
14from ..generic.v0_2 import CiteEntry as CiteEntry
15from ..generic.v0_2 import Doi as Doi
16from ..generic.v0_2 import GenericDescrBase
17from ..generic.v0_2 import LinkedResource as LinkedResource
18from ..generic.v0_2 import Maintainer as Maintainer
19from ..generic.v0_2 import OrcidId as OrcidId
20from ..generic.v0_2 import RelativeFilePath as RelativeFilePath
21from ..generic.v0_2 import ResourceId as ResourceId
22from ..generic.v0_2 import Uploader as Uploader
23from ..generic.v0_2 import Version as Version
26class ApplicationId(ResourceId):
27 pass
30class ApplicationDescr(GenericDescrBase):
31 """Bioimage.io description of an application."""
33 implemented_type: ClassVar[Literal["application"]] = "application"
34 if TYPE_CHECKING:
35 type: Literal["application"] = "application"
36 else:
37 type: Literal["application"]
39 id: Optional[ApplicationId] = None
40 """bioimage.io-wide unique resource identifier
41 assigned by bioimage.io; version **un**specific."""
43 source: Annotated[
44 Optional[ImportantFileSource],
45 Field(description="URL or path to the source of the application"),
46 ] = None
47 """The primary source of the application"""
50class LinkedApplication(Node):
51 """Reference to a bioimage.io application."""
53 id: ApplicationId
54 """A valid application `id` from the bioimage.io collection."""
56 version_number: Optional[int] = None
57 """version number (n-th published version, not the semantic version) of linked application"""