bioimageio.spec.generic
implementaions of all released minor versions are available in submodules:
- generic v0_2:
bioimageio.spec.generic.v0_2.GenericDescr
- generic v0_3:
bioimageio.spec.generic.v0_3.GenericDescr
1# autogen: start 2""" 3implementaions of all released minor versions are available in submodules: 4- generic v0_2: `bioimageio.spec.generic.v0_2.GenericDescr` 5- generic v0_3: `bioimageio.spec.generic.v0_3.GenericDescr` 6""" 7 8from typing import Union 9 10from pydantic import Discriminator, Field 11from typing_extensions import Annotated 12 13from . import v0_2, v0_3 14 15GenericDescr = v0_3.GenericDescr 16GenericDescr_v0_2 = v0_2.GenericDescr 17GenericDescr_v0_3 = v0_3.GenericDescr 18 19AnyGenericDescr = Annotated[ 20 Union[ 21 Annotated[GenericDescr_v0_2, Field(title="generic 0.2")], 22 Annotated[GenericDescr_v0_3, Field(title="generic 0.3")], 23 ], 24 Discriminator("format_version"), 25 Field(title="generic"), 26] 27"""Union of any released generic desription""" 28# autogen: stop
436class GenericDescr(GenericDescrBase, extra="ignore"): 437 """Specification of the fields used in a generic bioimage.io-compliant resource description file (RDF). 438 439 An RDF is a YAML file that describes a resource such as a model, a dataset, or a notebook. 440 Note that those resources are described with a type-specific RDF. 441 Use this generic resource description, if none of the known specific types matches your resource. 442 """ 443 444 type: Annotated[str, LowerCase] = Field("generic", frozen=True) 445 """The resource type assigns a broad category to the resource.""" 446 447 id: Optional[ 448 Annotated[ResourceId, Field(examples=["affable-shark", "ambitious-sloth"])] 449 ] = None 450 """bioimage.io-wide unique resource identifier 451 assigned by bioimage.io; version **un**specific.""" 452 453 parent: Optional[ResourceId] = None 454 """The description from which this one is derived""" 455 456 source: Optional[HttpUrl] = None 457 """The primary source of the resource""" 458 459 @field_validator("type", mode="after") 460 @classmethod 461 def check_specific_types(cls, value: str) -> str: 462 if value in KNOWN_SPECIFIC_RESOURCE_TYPES: 463 raise ValueError( 464 f"Use the {value} description instead of this generic description for" 465 + f" your '{value}' resource." 466 ) 467 468 return value
Specification of the fields used in a generic bioimage.io-compliant resource description file (RDF).
An RDF is a YAML file that describes a resource such as a model, a dataset, or a notebook. Note that those resources are described with a type-specific RDF. Use this generic resource description, if none of the known specific types matches your resource.
The resource type assigns a broad category to the resource.
bioimage.io-wide unique resource identifier assigned by bioimage.io; version unspecific.
The description from which this one is derived
459 @field_validator("type", mode="after") 460 @classmethod 461 def check_specific_types(cls, value: str) -> str: 462 if value in KNOWN_SPECIFIC_RESOURCE_TYPES: 463 raise ValueError( 464 f"Use the {value} description instead of this generic description for" 465 + f" your '{value}' resource." 466 ) 467 468 return value
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.
Inherited Members
Union of any released generic desription