bioimageio.spec.dataset      
                        implementaions of all released minor versions are available in submodules:
- dataset v0_2: 
bioimageio.spec.dataset.v0_2.DatasetDescr - dataset v0_3: 
bioimageio.spec.dataset.v0_3.DatasetDescr 
1# autogen: start 2""" 3implementaions of all released minor versions are available in submodules: 4- dataset v0_2: `bioimageio.spec.dataset.v0_2.DatasetDescr` 5- dataset v0_3: `bioimageio.spec.dataset.v0_3.DatasetDescr` 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 15DatasetDescr = v0_3.DatasetDescr 16DatasetDescr_v0_2 = v0_2.DatasetDescr 17DatasetDescr_v0_3 = v0_3.DatasetDescr 18 19AnyDatasetDescr = Annotated[ 20 Union[ 21 Annotated[DatasetDescr_v0_2, Field(title="dataset 0.2")], 22 Annotated[DatasetDescr_v0_3, Field(title="dataset 0.3")], 23 ], 24 Discriminator("format_version"), 25 Field(title="dataset"), 26] 27"""Union of any released dataset desription""" 28# autogen: stop
40class DatasetDescr(GenericDescrBase): 41 """A bioimage.io dataset resource description file (dataset RDF) describes a dataset relevant to bioimage 42 processing. 43 """ 44 45 implemented_type: ClassVar[Literal["dataset"]] = "dataset" 46 if TYPE_CHECKING: 47 type: Literal["dataset"] = "dataset" 48 else: 49 type: Literal["dataset"] 50 51 id: Optional[DatasetId] = None 52 """bioimage.io-wide unique resource identifier 53 assigned by bioimage.io; version **un**specific.""" 54 55 parent: Optional[DatasetId] = None 56 """The description from which this one is derived""" 57 58 source: FAIR[Optional[HttpUrl]] = None 59 """"URL to the source of the dataset.""" 60 61 @model_validator(mode="before") 62 @classmethod 63 def _convert(cls, data: Dict[str, Any], /) -> Dict[str, Any]: 64 if ( 65 data.get("type") == "dataset" 66 and isinstance(fv := data.get("format_version"), str) 67 and fv.startswith("0.2.") 68 ): 69 old = DatasetDescr02.load(data) 70 if isinstance(old, InvalidDescr): 71 return data 72 73 return cast( 74 Dict[str, Any], 75 (cls if TYPE_CHECKING else dict)( 76 attachments=( 77 [] 78 if old.attachments is None 79 else [FileDescr(source=f) for f in old.attachments.files] 80 ), 81 authors=[_author_conv.convert_as_dict(a) for a in old.authors], # pyright: ignore[reportArgumentType] 82 badges=old.badges, 83 cite=[ 84 {"text": c.text, "doi": c.doi, "url": c.url} for c in old.cite 85 ], # pyright: ignore[reportArgumentType] 86 config=old.config, # pyright: ignore[reportArgumentType] 87 covers=old.covers, 88 description=old.description, 89 documentation=old.documentation, 90 format_version="0.3.0", 91 git_repo=old.git_repo, # pyright: ignore[reportArgumentType] 92 icon=old.icon, 93 id=None if old.id is None else DatasetId(old.id), 94 license=old.license, # type: ignore 95 links=old.links, 96 maintainers=[ 97 _maintainer_conv.convert_as_dict(m) for m in old.maintainers 98 ], # pyright: ignore[reportArgumentType] 99 name=old.name, 100 source=old.source, 101 tags=old.tags, 102 type=old.type, 103 uploader=old.uploader, 104 version=old.version, 105 **(old.model_extra or {}), 106 ), 107 ) 108 109 return data
A bioimage.io dataset resource description file (dataset RDF) describes a dataset relevant to bioimage processing.
            source: Annotated[Optional[bioimageio.spec._internal.url.HttpUrl], AfterWarner(func=<function as_warning.<locals>.wrapper at 0x7efc006a6ac0>, severity=35, msg=None, context=None)]        =
None
        
    
    
    
            "URL to the source of the dataset.
Inherited Members
- bioimageio.spec.generic.v0_3.GenericDescrBase
 - implemented_format_version
 - convert_from_old_format_wo_validation
 - documentation
 - badges
 - config
 - bioimageio.spec.generic.v0_3.GenericModelDescrBase
 - name
 - description
 - covers
 - id_emoji
 - attachments
 - cite
 - license
 - git_repo
 - icon
 - links
 - uploader
 - maintainers
 - warn_about_tag_categories
 - version
 - version_comment
 
            DatasetDescr_v0_2        =
<class 'bioimageio.spec.dataset.v0_2.DatasetDescr'>
        
    
    
    
    
                
            DatasetDescr_v0_3        =
<class 'DatasetDescr'>
        
    
    
    
    
                
            AnyDatasetDescr        =
            typing.Annotated[typing.Union[typing.Annotated[bioimageio.spec.dataset.v0_2.DatasetDescr, FieldInfo(annotation=NoneType, required=True, title='dataset 0.2')], typing.Annotated[DatasetDescr, FieldInfo(annotation=NoneType, required=True, title='dataset 0.3')]], Discriminator(discriminator='format_version', custom_error_type=None, custom_error_message=None, custom_error_context=None), FieldInfo(annotation=NoneType, required=True, title='dataset')]
        
    
    
    
            Union of any released dataset desription