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

1from __future__ import annotations 

2 

3from typing import TYPE_CHECKING, ClassVar, Literal 

4 

5from pydantic import Field 

6from typing_extensions import Annotated 

7 

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 

25 

26 

27class ApplicationId(ResourceId): 

28 pass 

29 

30 

31class ApplicationDescr(GenericDescrBase): 

32 """Bioimage.io description of an application.""" 

33 

34 implemented_type: ClassVar[Literal["application"]] = "application" 

35 if TYPE_CHECKING: 

36 type: Literal["application"] = "application" 

37 else: 

38 type: Literal["application"] 

39 

40 id: ApplicationId | None = None 

41 """bioimage.io-wide unique resource identifier 

42 assigned by bioimage.io; version **un**specific.""" 

43 

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""" 

49 

50 

51class LinkedApplication(Node): 

52 """Reference to a bioimage.io application.""" 

53 

54 id: ApplicationId 

55 """A valid application `id` from the bioimage.io collection.""" 

56 

57 version_number: int | None = None 

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