bioimageio.spec.application.v0_2

 1from typing import Literal, Optional
 2
 3from pydantic import Field
 4from typing_extensions import Annotated
 5
 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
24
25
26class ApplicationId(ResourceId):
27    pass
28
29
30class ApplicationDescr(GenericDescrBase, title="bioimage.io application specification"):
31    """Bioimage.io description of an application."""
32
33    type: Literal["application"] = "application"
34
35    id: Optional[ApplicationId] = None
36    """bioimage.io-wide unique resource identifier
37    assigned by bioimage.io; version **un**specific."""
38
39    source: Annotated[
40        Optional[ImportantFileSource],
41        Field(description="URL or path to the source of the application"),
42    ] = None
43    """The primary source of the application"""
44
45
46class LinkedApplication(Node):
47    """Reference to a bioimage.io application."""
48
49    id: ApplicationId
50    """A valid application `id` from the bioimage.io collection."""
51
52    version_number: Optional[int] = None
53    """version number (n-th published version, not the semantic version) of linked application"""
class ApplicationId(bioimageio.spec.generic.v0_2.ResourceId):
27class ApplicationId(ResourceId):
28    pass

str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str

Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.

class ApplicationDescr(bioimageio.spec.generic.v0_2.GenericDescrBase):
31class ApplicationDescr(GenericDescrBase, title="bioimage.io application specification"):
32    """Bioimage.io description of an application."""
33
34    type: Literal["application"] = "application"
35
36    id: Optional[ApplicationId] = None
37    """bioimage.io-wide unique resource identifier
38    assigned by bioimage.io; version **un**specific."""
39
40    source: Annotated[
41        Optional[ImportantFileSource],
42        Field(description="URL or path to the source of the application"),
43    ] = None
44    """The primary source of the application"""

Bioimage.io description of an application.

type: Literal['application']
id: Optional[ApplicationId]

bioimage.io-wide unique resource identifier assigned by bioimage.io; version unspecific.

source: Annotated[Optional[Annotated[Union[bioimageio.spec._internal.url.HttpUrl, bioimageio.spec._internal.io.RelativeFilePath, Annotated[pathlib.Path, PathType(path_type='file')]], FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')]), AfterValidator(func=<function wo_special_file_name at 0x7f9a7f3b8ea0>), PlainSerializer(func=<function _package at 0x7f9a7f3b9620>, return_type=PydanticUndefined, when_used='unless-none')]], FieldInfo(annotation=NoneType, required=True, description='URL or path to the source of the application')]

The primary source of the application

implemented_format_version: ClassVar[str] = '0.2.4'
implemented_format_version_tuple: ClassVar[Tuple[int, int, int]] = (0, 2, 4)
def model_post_init(self: pydantic.main.BaseModel, context: Any, /) -> None:
124                    def wrapped_model_post_init(self: BaseModel, context: Any, /) -> None:
125                        """We need to both initialize private attributes and call the user-defined model_post_init
126                        method.
127                        """
128                        init_private_attributes(self, context)
129                        original_model_post_init(self, context)

We need to both initialize private attributes and call the user-defined model_post_init method.

class LinkedApplication(bioimageio.spec._internal.node.Node):
47class LinkedApplication(Node):
48    """Reference to a bioimage.io application."""
49
50    id: ApplicationId
51    """A valid application `id` from the bioimage.io collection."""
52
53    version_number: Optional[int] = None
54    """version number (n-th published version, not the semantic version) of linked application"""

Reference to a bioimage.io application.

A valid application id from the bioimage.io collection.

version_number: Optional[int]

version number (n-th published version, not the semantic version) of linked application