Coverage for src/bioimageio/spec/application/v0_2.py: 100%

34 statements  

« prev     ^ index     » next       coverage.py v7.17.3, created at 2026-11-17 16:20 +0000

1from __future__ import annotations 

2 

3from typing import TYPE_CHECKING, Annotated, ClassVar, Literal 

4 

5from pydantic import Field 

6 

7from .._internal.common_nodes import Node 

8from .._internal.io_packaging import FileSource_package 

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): 

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

32 

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

34 if TYPE_CHECKING: 

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

36 else: 

37 type: Literal["application"] 

38 

39 id: ApplicationId | None = None 

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

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

42 

43 source: Annotated[ 

44 FileSource_package | None, 

45 Field(description="URL or path to the source of the application"), 

46 ] = None 

47 """The primary source of the application""" 

48 

49 

50class LinkedApplication(Node): 

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

52 

53 id: ApplicationId 

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

55 

56 version_number: int | None = None 

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