summary
¤
| CLASS | DESCRIPTION |
|---|---|
CondaEnv |
Represenation of the content of a conda environment.yaml file |
ErrorEntry |
An error in a |
InstalledPackage |
|
ValidationContextSummary |
Summary of the validation context without internally used context fields. |
ValidationDetail |
a detail in a validation summary |
ValidationEntry |
Base of |
ValidationSummary |
Summarizes output of all bioimageio validations and tests |
WarningEntry |
A warning in a |
| FUNCTION | DESCRIPTION |
|---|---|
_format_html_table |
format |
_format_md_table |
format |
_format_summary |
|
format_loc |
helper to format a location tuple loc |
is_dict |
to avoid Dict[Unknown, Unknown] |
is_yaml_value |
|
write_yaml |
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
CONDA_CMD |
|
Loc |
location of error/warning in a nested data structure
|
VERSION |
|
WARNING_LEVEL_TO_NAME |
TYPE:
|
WARNING_NAME_TO_LEVEL |
TYPE:
|
WARNING_SEVERITY_TO_NAME |
TYPE:
|
WarningLevel |
With warning level x validation warnings of severity >=x are raised.
|
WarningLevelName |
|
WarningSeverity |
|
WarningSeverityName |
|
CONDA_CMD
module-attribute
¤
CONDA_CMD = (
"conda.bat"
if platform.system() == "Windows"
else "conda"
)
Loc
module-attribute
¤
Loc = Tuple[Union[int, str], ...]
location of error/warning in a nested data structure
WARNING_LEVEL_TO_NAME
module-attribute
¤
WARNING_LEVEL_TO_NAME: Mapping[
WarningLevel, WarningLevelName
] = MappingProxyType(
{
INFO: INFO_NAME,
WARNING: WARNING_NAME,
ALERT: ALERT_NAME,
ERROR: ERROR_NAME,
}
)
WARNING_NAME_TO_LEVEL
module-attribute
¤
WARNING_NAME_TO_LEVEL: Mapping[
WarningLevelName, WarningLevel
] = MappingProxyType(
{v: k for k, v in (WARNING_LEVEL_TO_NAME.items())}
)
WARNING_SEVERITY_TO_NAME
module-attribute
¤
WARNING_SEVERITY_TO_NAME: Mapping[
WarningSeverity, WarningSeverityName
] = MappingProxyType(
{
INFO: INFO_NAME,
WARNING: WARNING_NAME,
ALERT: ALERT_NAME,
}
)
WarningLevel
module-attribute
¤
WarningLevel = Literal[WarningSeverity, 50]
With warning level x validation warnings of severity >=x are raised. Highest warning level 50/error does not raise any validaiton warnings (only validation errors).
WarningLevelName
module-attribute
¤
WarningLevelName = Literal[WarningSeverityName, 'error']
WarningSeverity
module-attribute
¤
WarningSeverity = Literal[20, 30, 35]
WarningSeverityName
module-attribute
¤
WarningSeverityName = Literal['info', 'warning', 'alert']
CondaEnv
pydantic-model
¤
Bases: BaseModel
Represenation of the content of a conda environment.yaml file
Show JSON schema:
{
"$defs": {
"PipDeps": {
"description": "Pip dependencies to include in conda dependecies",
"properties": {
"pip": {
"items": {
"type": "string"
},
"title": "Pip",
"type": "array"
}
},
"title": "PipDeps",
"type": "object"
}
},
"description": "Represenation of the content of a conda environment.yaml file",
"properties": {
"name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Name"
},
"channels": {
"items": {
"type": "string"
},
"title": "Channels",
"type": "array"
},
"dependencies": {
"items": {
"anyOf": [
{
"type": "string"
},
{
"$ref": "#/$defs/PipDeps"
}
]
},
"title": "Dependencies",
"type": "array"
}
},
"title": "CondaEnv",
"type": "object"
}
Fields:
-
name(Optional[str]) -
channels(List[str]) -
dependencies(List[Union[str, PipDeps]])
Validators:
-
_ensure_valid_conda_env_name→name
get_pip_deps
¤
get_pip_deps() -> List[str]
Get the pip dependencies of this conda env.
Source code in src/bioimageio/spec/conda_env.py
70 71 72 73 74 75 76 | |
ErrorEntry
pydantic-model
¤
Bases: ValidationEntry
An error in a ValidationDetail
Show JSON schema:
{
"description": "An error in a `ValidationDetail`",
"properties": {
"loc": {
"items": {
"anyOf": [
{
"type": "integer"
},
{
"type": "string"
}
]
},
"title": "Loc",
"type": "array"
},
"msg": {
"title": "Msg",
"type": "string"
},
"type": {
"anyOf": [
{
"enum": [
"no_such_attribute",
"json_invalid",
"json_type",
"needs_python_object",
"recursion_loop",
"missing",
"frozen_field",
"frozen_instance",
"extra_forbidden",
"invalid_key",
"get_attribute_error",
"model_type",
"model_attributes_type",
"dataclass_type",
"dataclass_exact_type",
"none_required",
"greater_than",
"greater_than_equal",
"less_than",
"less_than_equal",
"multiple_of",
"finite_number",
"too_short",
"too_long",
"iterable_type",
"iteration_error",
"string_type",
"string_sub_type",
"string_unicode",
"string_too_short",
"string_too_long",
"string_pattern_mismatch",
"enum",
"dict_type",
"mapping_type",
"list_type",
"tuple_type",
"set_type",
"set_item_not_hashable",
"bool_type",
"bool_parsing",
"int_type",
"int_parsing",
"int_parsing_size",
"int_from_float",
"float_type",
"float_parsing",
"bytes_type",
"bytes_too_short",
"bytes_too_long",
"bytes_invalid_encoding",
"value_error",
"assertion_error",
"literal_error",
"date_type",
"date_parsing",
"date_from_datetime_parsing",
"date_from_datetime_inexact",
"date_past",
"date_future",
"time_type",
"time_parsing",
"datetime_type",
"datetime_parsing",
"datetime_object_invalid",
"datetime_from_date_parsing",
"datetime_past",
"datetime_future",
"timezone_naive",
"timezone_aware",
"timezone_offset",
"time_delta_type",
"time_delta_parsing",
"frozen_set_type",
"is_instance_of",
"is_subclass_of",
"callable_type",
"union_tag_invalid",
"union_tag_not_found",
"arguments_type",
"missing_argument",
"unexpected_keyword_argument",
"missing_keyword_only_argument",
"unexpected_positional_argument",
"missing_positional_only_argument",
"multiple_argument_values",
"url_type",
"url_parsing",
"url_syntax_violation",
"url_too_long",
"url_scheme",
"uuid_type",
"uuid_parsing",
"uuid_version",
"decimal_type",
"decimal_parsing",
"decimal_max_digits",
"decimal_max_places",
"decimal_whole_digits",
"complex_type",
"complex_str_parsing"
],
"type": "string"
},
{
"type": "string"
}
],
"title": "Type"
},
"with_traceback": {
"default": false,
"title": "With Traceback",
"type": "boolean"
},
"traceback_md": {
"default": "",
"title": "Traceback Md",
"type": "string"
},
"traceback_html": {
"default": "",
"title": "Traceback Html",
"type": "string"
}
},
"required": [
"loc",
"msg",
"type"
],
"title": "ErrorEntry",
"type": "object"
}
Fields:
-
loc(Loc) -
msg(str) -
type(Union[ErrorType, str]) -
with_traceback(bool) -
traceback_md(str) -
traceback_html(str) -
_traceback_rich(Optional[rich.traceback.Traceback])
model_post_init
¤
model_post_init(__context: Any)
Source code in src/bioimageio/spec/summary.py
102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 | |
InstalledPackage
¤
ValidationContextSummary
dataclass
¤
ValidationContextSummary(
file_name: Optional[FileName] = None,
original_source_name: Optional[str] = None,
perform_io_checks: bool = settings.perform_io_checks,
known_files: Dict[str, Optional[Sha256]] = cast(
Callable[[], Dict[str, Optional[Sha256]]], dict
)(),
update_hashes: bool = False,
root: Union[
RootHttpUrl, Path, Literal["in-memory"]
] = Path(),
)
Bases: ValidationContextBase
flowchart TD
bioimageio.spec.summary.ValidationContextSummary[ValidationContextSummary]
bioimageio.spec._internal.validation_context.ValidationContextBase[ValidationContextBase]
bioimageio.spec._internal.validation_context.ValidationContextBase --> bioimageio.spec.summary.ValidationContextSummary
click bioimageio.spec.summary.ValidationContextSummary href "" "bioimageio.spec.summary.ValidationContextSummary"
click bioimageio.spec._internal.validation_context.ValidationContextBase href "" "bioimageio.spec._internal.validation_context.ValidationContextBase"
Summary of the validation context without internally used context fields.
| ATTRIBUTE | DESCRIPTION |
|---|---|
__pydantic_config__ |
Pydantic config to include ValdationContextSummary in ValidationDetail.
|
file_name |
File name of the bioimageio YAML file.
TYPE:
|
known_files |
Allows to bypass download and hashing of referenced files.
TYPE:
|
original_source_name |
Original source of the bioimageio resource description, e.g. a URL or file path.
TYPE:
|
perform_io_checks |
Wether or not to perform validation that requires file io,
TYPE:
|
root |
TYPE:
|
update_hashes |
Overwrite specified file hashes with values computed from the referenced file (instead of comparing them).
TYPE:
|
__pydantic_config__
class-attribute
instance-attribute
¤
__pydantic_config__ = ConfigDict(extra='forbid')
Pydantic config to include ValdationContextSummary in ValidationDetail.
file_name
class-attribute
instance-attribute
¤
file_name: Optional[FileName] = None
File name of the bioimageio YAML file.
known_files
class-attribute
instance-attribute
¤
known_files: Dict[str, Optional[Sha256]] = field(
default_factory=cast(
Callable[[], Dict[str, Optional[Sha256]]], dict
)
)
Allows to bypass download and hashing of referenced files.
original_source_name
class-attribute
instance-attribute
¤
original_source_name: Optional[str] = None
Original source of the bioimageio resource description, e.g. a URL or file path.
perform_io_checks
class-attribute
instance-attribute
¤
perform_io_checks: bool = settings.perform_io_checks
Wether or not to perform validation that requires file io, e.g. downloading a remote files.
Existence of local absolute file paths is still being checked.
root
class-attribute
instance-attribute
¤
root: Union[RootHttpUrl, Path, Literal["in-memory"]] = (
Path()
)
update_hashes
class-attribute
instance-attribute
¤
update_hashes: bool = False
Overwrite specified file hashes with values computed from the referenced file (instead of comparing them).
(Has no effect if perform_io_checks=False.)
ValidationDetail
pydantic-model
¤
Bases: BaseModel
a detail in a validation summary
Show JSON schema:
{
"$defs": {
"CondaEnv": {
"description": "Represenation of the content of a conda environment.yaml file",
"properties": {
"name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Name"
},
"channels": {
"items": {
"type": "string"
},
"title": "Channels",
"type": "array"
},
"dependencies": {
"items": {
"anyOf": [
{
"type": "string"
},
{
"$ref": "#/$defs/PipDeps"
}
]
},
"title": "Dependencies",
"type": "array"
}
},
"title": "CondaEnv",
"type": "object"
},
"ErrorEntry": {
"description": "An error in a `ValidationDetail`",
"properties": {
"loc": {
"items": {
"anyOf": [
{
"type": "integer"
},
{
"type": "string"
}
]
},
"title": "Loc",
"type": "array"
},
"msg": {
"title": "Msg",
"type": "string"
},
"type": {
"anyOf": [
{
"enum": [
"no_such_attribute",
"json_invalid",
"json_type",
"needs_python_object",
"recursion_loop",
"missing",
"frozen_field",
"frozen_instance",
"extra_forbidden",
"invalid_key",
"get_attribute_error",
"model_type",
"model_attributes_type",
"dataclass_type",
"dataclass_exact_type",
"none_required",
"greater_than",
"greater_than_equal",
"less_than",
"less_than_equal",
"multiple_of",
"finite_number",
"too_short",
"too_long",
"iterable_type",
"iteration_error",
"string_type",
"string_sub_type",
"string_unicode",
"string_too_short",
"string_too_long",
"string_pattern_mismatch",
"enum",
"dict_type",
"mapping_type",
"list_type",
"tuple_type",
"set_type",
"set_item_not_hashable",
"bool_type",
"bool_parsing",
"int_type",
"int_parsing",
"int_parsing_size",
"int_from_float",
"float_type",
"float_parsing",
"bytes_type",
"bytes_too_short",
"bytes_too_long",
"bytes_invalid_encoding",
"value_error",
"assertion_error",
"literal_error",
"date_type",
"date_parsing",
"date_from_datetime_parsing",
"date_from_datetime_inexact",
"date_past",
"date_future",
"time_type",
"time_parsing",
"datetime_type",
"datetime_parsing",
"datetime_object_invalid",
"datetime_from_date_parsing",
"datetime_past",
"datetime_future",
"timezone_naive",
"timezone_aware",
"timezone_offset",
"time_delta_type",
"time_delta_parsing",
"frozen_set_type",
"is_instance_of",
"is_subclass_of",
"callable_type",
"union_tag_invalid",
"union_tag_not_found",
"arguments_type",
"missing_argument",
"unexpected_keyword_argument",
"missing_keyword_only_argument",
"unexpected_positional_argument",
"missing_positional_only_argument",
"multiple_argument_values",
"url_type",
"url_parsing",
"url_syntax_violation",
"url_too_long",
"url_scheme",
"uuid_type",
"uuid_parsing",
"uuid_version",
"decimal_type",
"decimal_parsing",
"decimal_max_digits",
"decimal_max_places",
"decimal_whole_digits",
"complex_type",
"complex_str_parsing"
],
"type": "string"
},
{
"type": "string"
}
],
"title": "Type"
},
"with_traceback": {
"default": false,
"title": "With Traceback",
"type": "boolean"
},
"traceback_md": {
"default": "",
"title": "Traceback Md",
"type": "string"
},
"traceback_html": {
"default": "",
"title": "Traceback Html",
"type": "string"
}
},
"required": [
"loc",
"msg",
"type"
],
"title": "ErrorEntry",
"type": "object"
},
"PipDeps": {
"description": "Pip dependencies to include in conda dependecies",
"properties": {
"pip": {
"items": {
"type": "string"
},
"title": "Pip",
"type": "array"
}
},
"title": "PipDeps",
"type": "object"
},
"ValidationContextSummary": {
"additionalProperties": false,
"properties": {
"file_name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "File Name"
},
"original_source_name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Original Source Name"
},
"perform_io_checks": {
"default": true,
"title": "Perform Io Checks",
"type": "boolean"
},
"known_files": {
"additionalProperties": {
"anyOf": [
{
"description": "A SHA-256 hash value",
"maxLength": 64,
"minLength": 64,
"title": "Sha256",
"type": "string"
},
{
"type": "null"
}
]
},
"title": "Known Files",
"type": "object"
},
"update_hashes": {
"default": false,
"title": "Update Hashes",
"type": "boolean"
},
"root": {
"anyOf": [
{
"description": "An untested HTTP URL, possibly a 'URL folder' or an invalid HTTP URL",
"format": "uri",
"maxLength": 2083,
"minLength": 1,
"title": "RootHttpUrl",
"type": "string"
},
{
"format": "path",
"type": "string"
},
{
"const": "in-memory",
"type": "string"
}
],
"default": ".",
"title": "Root"
}
},
"title": "ValidationContextSummary",
"type": "object"
},
"WarningEntry": {
"description": "A warning in a `ValidationDetail`",
"properties": {
"loc": {
"items": {
"anyOf": [
{
"type": "integer"
},
{
"type": "string"
}
]
},
"title": "Loc",
"type": "array"
},
"msg": {
"title": "Msg",
"type": "string"
},
"type": {
"anyOf": [
{
"enum": [
"no_such_attribute",
"json_invalid",
"json_type",
"needs_python_object",
"recursion_loop",
"missing",
"frozen_field",
"frozen_instance",
"extra_forbidden",
"invalid_key",
"get_attribute_error",
"model_type",
"model_attributes_type",
"dataclass_type",
"dataclass_exact_type",
"none_required",
"greater_than",
"greater_than_equal",
"less_than",
"less_than_equal",
"multiple_of",
"finite_number",
"too_short",
"too_long",
"iterable_type",
"iteration_error",
"string_type",
"string_sub_type",
"string_unicode",
"string_too_short",
"string_too_long",
"string_pattern_mismatch",
"enum",
"dict_type",
"mapping_type",
"list_type",
"tuple_type",
"set_type",
"set_item_not_hashable",
"bool_type",
"bool_parsing",
"int_type",
"int_parsing",
"int_parsing_size",
"int_from_float",
"float_type",
"float_parsing",
"bytes_type",
"bytes_too_short",
"bytes_too_long",
"bytes_invalid_encoding",
"value_error",
"assertion_error",
"literal_error",
"date_type",
"date_parsing",
"date_from_datetime_parsing",
"date_from_datetime_inexact",
"date_past",
"date_future",
"time_type",
"time_parsing",
"datetime_type",
"datetime_parsing",
"datetime_object_invalid",
"datetime_from_date_parsing",
"datetime_past",
"datetime_future",
"timezone_naive",
"timezone_aware",
"timezone_offset",
"time_delta_type",
"time_delta_parsing",
"frozen_set_type",
"is_instance_of",
"is_subclass_of",
"callable_type",
"union_tag_invalid",
"union_tag_not_found",
"arguments_type",
"missing_argument",
"unexpected_keyword_argument",
"missing_keyword_only_argument",
"unexpected_positional_argument",
"missing_positional_only_argument",
"multiple_argument_values",
"url_type",
"url_parsing",
"url_syntax_violation",
"url_too_long",
"url_scheme",
"uuid_type",
"uuid_parsing",
"uuid_version",
"decimal_type",
"decimal_parsing",
"decimal_max_digits",
"decimal_max_places",
"decimal_whole_digits",
"complex_type",
"complex_str_parsing"
],
"type": "string"
},
{
"type": "string"
}
],
"title": "Type"
},
"severity": {
"default": 30,
"enum": [
20,
30,
35
],
"title": "Severity",
"type": "integer"
}
},
"required": [
"loc",
"msg",
"type"
],
"title": "WarningEntry",
"type": "object"
}
},
"additionalProperties": true,
"description": "a detail in a validation summary",
"properties": {
"name": {
"title": "Name",
"type": "string"
},
"status": {
"enum": [
"passed",
"failed"
],
"title": "Status",
"type": "string"
},
"loc": {
"default": [],
"items": {
"anyOf": [
{
"type": "integer"
},
{
"type": "string"
}
]
},
"title": "Loc",
"type": "array"
},
"errors": {
"items": {
"$ref": "#/$defs/ErrorEntry"
},
"title": "Errors",
"type": "array"
},
"warnings": {
"items": {
"$ref": "#/$defs/WarningEntry"
},
"title": "Warnings",
"type": "array"
},
"context": {
"anyOf": [
{
"$ref": "#/$defs/ValidationContextSummary"
},
{
"type": "null"
}
],
"default": null
},
"recommended_env": {
"anyOf": [
{
"$ref": "#/$defs/CondaEnv"
},
{
"type": "null"
}
],
"default": null
},
"saved_conda_compare": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Saved Conda Compare"
}
},
"required": [
"name",
"status"
],
"title": "ValidationDetail",
"type": "object"
}
Fields:
-
name(str) -
status(Literal['passed', 'failed']) -
loc(Loc) -
errors(List[ErrorEntry]) -
warnings(List[WarningEntry]) -
context(Optional[ValidationContextSummary]) -
recommended_env(Optional[CondaEnv]) -
saved_conda_compare(Optional[str])
Validators:
-
_load_legacy
ValidationEntry
pydantic-model
¤
Bases: BaseModel
Base of ErrorEntry and WarningEntry
Show JSON schema:
{
"description": "Base of `ErrorEntry` and `WarningEntry`",
"properties": {
"loc": {
"items": {
"anyOf": [
{
"type": "integer"
},
{
"type": "string"
}
]
},
"title": "Loc",
"type": "array"
},
"msg": {
"title": "Msg",
"type": "string"
},
"type": {
"anyOf": [
{
"enum": [
"no_such_attribute",
"json_invalid",
"json_type",
"needs_python_object",
"recursion_loop",
"missing",
"frozen_field",
"frozen_instance",
"extra_forbidden",
"invalid_key",
"get_attribute_error",
"model_type",
"model_attributes_type",
"dataclass_type",
"dataclass_exact_type",
"none_required",
"greater_than",
"greater_than_equal",
"less_than",
"less_than_equal",
"multiple_of",
"finite_number",
"too_short",
"too_long",
"iterable_type",
"iteration_error",
"string_type",
"string_sub_type",
"string_unicode",
"string_too_short",
"string_too_long",
"string_pattern_mismatch",
"enum",
"dict_type",
"mapping_type",
"list_type",
"tuple_type",
"set_type",
"set_item_not_hashable",
"bool_type",
"bool_parsing",
"int_type",
"int_parsing",
"int_parsing_size",
"int_from_float",
"float_type",
"float_parsing",
"bytes_type",
"bytes_too_short",
"bytes_too_long",
"bytes_invalid_encoding",
"value_error",
"assertion_error",
"literal_error",
"date_type",
"date_parsing",
"date_from_datetime_parsing",
"date_from_datetime_inexact",
"date_past",
"date_future",
"time_type",
"time_parsing",
"datetime_type",
"datetime_parsing",
"datetime_object_invalid",
"datetime_from_date_parsing",
"datetime_past",
"datetime_future",
"timezone_naive",
"timezone_aware",
"timezone_offset",
"time_delta_type",
"time_delta_parsing",
"frozen_set_type",
"is_instance_of",
"is_subclass_of",
"callable_type",
"union_tag_invalid",
"union_tag_not_found",
"arguments_type",
"missing_argument",
"unexpected_keyword_argument",
"missing_keyword_only_argument",
"unexpected_positional_argument",
"missing_positional_only_argument",
"multiple_argument_values",
"url_type",
"url_parsing",
"url_syntax_violation",
"url_too_long",
"url_scheme",
"uuid_type",
"uuid_parsing",
"uuid_version",
"decimal_type",
"decimal_parsing",
"decimal_max_digits",
"decimal_max_places",
"decimal_whole_digits",
"complex_type",
"complex_str_parsing"
],
"type": "string"
},
{
"type": "string"
}
],
"title": "Type"
}
},
"required": [
"loc",
"msg",
"type"
],
"title": "ValidationEntry",
"type": "object"
}
Fields:
ValidationSummary
pydantic-model
¤
Bases: BaseModel
Summarizes output of all bioimageio validations and tests
for one specific ResourceDescr instance.
Show JSON schema:
{
"$defs": {
"CondaEnv": {
"description": "Represenation of the content of a conda environment.yaml file",
"properties": {
"name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Name"
},
"channels": {
"items": {
"type": "string"
},
"title": "Channels",
"type": "array"
},
"dependencies": {
"items": {
"anyOf": [
{
"type": "string"
},
{
"$ref": "#/$defs/PipDeps"
}
]
},
"title": "Dependencies",
"type": "array"
}
},
"title": "CondaEnv",
"type": "object"
},
"ErrorEntry": {
"description": "An error in a `ValidationDetail`",
"properties": {
"loc": {
"items": {
"anyOf": [
{
"type": "integer"
},
{
"type": "string"
}
]
},
"title": "Loc",
"type": "array"
},
"msg": {
"title": "Msg",
"type": "string"
},
"type": {
"anyOf": [
{
"enum": [
"no_such_attribute",
"json_invalid",
"json_type",
"needs_python_object",
"recursion_loop",
"missing",
"frozen_field",
"frozen_instance",
"extra_forbidden",
"invalid_key",
"get_attribute_error",
"model_type",
"model_attributes_type",
"dataclass_type",
"dataclass_exact_type",
"none_required",
"greater_than",
"greater_than_equal",
"less_than",
"less_than_equal",
"multiple_of",
"finite_number",
"too_short",
"too_long",
"iterable_type",
"iteration_error",
"string_type",
"string_sub_type",
"string_unicode",
"string_too_short",
"string_too_long",
"string_pattern_mismatch",
"enum",
"dict_type",
"mapping_type",
"list_type",
"tuple_type",
"set_type",
"set_item_not_hashable",
"bool_type",
"bool_parsing",
"int_type",
"int_parsing",
"int_parsing_size",
"int_from_float",
"float_type",
"float_parsing",
"bytes_type",
"bytes_too_short",
"bytes_too_long",
"bytes_invalid_encoding",
"value_error",
"assertion_error",
"literal_error",
"date_type",
"date_parsing",
"date_from_datetime_parsing",
"date_from_datetime_inexact",
"date_past",
"date_future",
"time_type",
"time_parsing",
"datetime_type",
"datetime_parsing",
"datetime_object_invalid",
"datetime_from_date_parsing",
"datetime_past",
"datetime_future",
"timezone_naive",
"timezone_aware",
"timezone_offset",
"time_delta_type",
"time_delta_parsing",
"frozen_set_type",
"is_instance_of",
"is_subclass_of",
"callable_type",
"union_tag_invalid",
"union_tag_not_found",
"arguments_type",
"missing_argument",
"unexpected_keyword_argument",
"missing_keyword_only_argument",
"unexpected_positional_argument",
"missing_positional_only_argument",
"multiple_argument_values",
"url_type",
"url_parsing",
"url_syntax_violation",
"url_too_long",
"url_scheme",
"uuid_type",
"uuid_parsing",
"uuid_version",
"decimal_type",
"decimal_parsing",
"decimal_max_digits",
"decimal_max_places",
"decimal_whole_digits",
"complex_type",
"complex_str_parsing"
],
"type": "string"
},
{
"type": "string"
}
],
"title": "Type"
},
"with_traceback": {
"default": false,
"title": "With Traceback",
"type": "boolean"
},
"traceback_md": {
"default": "",
"title": "Traceback Md",
"type": "string"
},
"traceback_html": {
"default": "",
"title": "Traceback Html",
"type": "string"
}
},
"required": [
"loc",
"msg",
"type"
],
"title": "ErrorEntry",
"type": "object"
},
"InstalledPackage": {
"maxItems": 4,
"minItems": 2,
"prefixItems": [
{
"title": "Name",
"type": "string"
},
{
"title": "Version",
"type": "string"
},
{
"default": "",
"title": "Build",
"type": "string"
},
{
"default": "",
"title": "Channel",
"type": "string"
}
],
"type": "array"
},
"PipDeps": {
"description": "Pip dependencies to include in conda dependecies",
"properties": {
"pip": {
"items": {
"type": "string"
},
"title": "Pip",
"type": "array"
}
},
"title": "PipDeps",
"type": "object"
},
"ValidationContextSummary": {
"additionalProperties": false,
"properties": {
"file_name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "File Name"
},
"original_source_name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Original Source Name"
},
"perform_io_checks": {
"default": true,
"title": "Perform Io Checks",
"type": "boolean"
},
"known_files": {
"additionalProperties": {
"anyOf": [
{
"description": "A SHA-256 hash value",
"maxLength": 64,
"minLength": 64,
"title": "Sha256",
"type": "string"
},
{
"type": "null"
}
]
},
"title": "Known Files",
"type": "object"
},
"update_hashes": {
"default": false,
"title": "Update Hashes",
"type": "boolean"
},
"root": {
"anyOf": [
{
"description": "An untested HTTP URL, possibly a 'URL folder' or an invalid HTTP URL",
"format": "uri",
"maxLength": 2083,
"minLength": 1,
"title": "RootHttpUrl",
"type": "string"
},
{
"format": "path",
"type": "string"
},
{
"const": "in-memory",
"type": "string"
}
],
"default": ".",
"title": "Root"
}
},
"title": "ValidationContextSummary",
"type": "object"
},
"ValidationDetail": {
"additionalProperties": true,
"description": "a detail in a validation summary",
"properties": {
"name": {
"title": "Name",
"type": "string"
},
"status": {
"enum": [
"passed",
"failed"
],
"title": "Status",
"type": "string"
},
"loc": {
"default": [],
"items": {
"anyOf": [
{
"type": "integer"
},
{
"type": "string"
}
]
},
"title": "Loc",
"type": "array"
},
"errors": {
"items": {
"$ref": "#/$defs/ErrorEntry"
},
"title": "Errors",
"type": "array"
},
"warnings": {
"items": {
"$ref": "#/$defs/WarningEntry"
},
"title": "Warnings",
"type": "array"
},
"context": {
"anyOf": [
{
"$ref": "#/$defs/ValidationContextSummary"
},
{
"type": "null"
}
],
"default": null
},
"recommended_env": {
"anyOf": [
{
"$ref": "#/$defs/CondaEnv"
},
{
"type": "null"
}
],
"default": null
},
"saved_conda_compare": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Saved Conda Compare"
}
},
"required": [
"name",
"status"
],
"title": "ValidationDetail",
"type": "object"
},
"WarningEntry": {
"description": "A warning in a `ValidationDetail`",
"properties": {
"loc": {
"items": {
"anyOf": [
{
"type": "integer"
},
{
"type": "string"
}
]
},
"title": "Loc",
"type": "array"
},
"msg": {
"title": "Msg",
"type": "string"
},
"type": {
"anyOf": [
{
"enum": [
"no_such_attribute",
"json_invalid",
"json_type",
"needs_python_object",
"recursion_loop",
"missing",
"frozen_field",
"frozen_instance",
"extra_forbidden",
"invalid_key",
"get_attribute_error",
"model_type",
"model_attributes_type",
"dataclass_type",
"dataclass_exact_type",
"none_required",
"greater_than",
"greater_than_equal",
"less_than",
"less_than_equal",
"multiple_of",
"finite_number",
"too_short",
"too_long",
"iterable_type",
"iteration_error",
"string_type",
"string_sub_type",
"string_unicode",
"string_too_short",
"string_too_long",
"string_pattern_mismatch",
"enum",
"dict_type",
"mapping_type",
"list_type",
"tuple_type",
"set_type",
"set_item_not_hashable",
"bool_type",
"bool_parsing",
"int_type",
"int_parsing",
"int_parsing_size",
"int_from_float",
"float_type",
"float_parsing",
"bytes_type",
"bytes_too_short",
"bytes_too_long",
"bytes_invalid_encoding",
"value_error",
"assertion_error",
"literal_error",
"date_type",
"date_parsing",
"date_from_datetime_parsing",
"date_from_datetime_inexact",
"date_past",
"date_future",
"time_type",
"time_parsing",
"datetime_type",
"datetime_parsing",
"datetime_object_invalid",
"datetime_from_date_parsing",
"datetime_past",
"datetime_future",
"timezone_naive",
"timezone_aware",
"timezone_offset",
"time_delta_type",
"time_delta_parsing",
"frozen_set_type",
"is_instance_of",
"is_subclass_of",
"callable_type",
"union_tag_invalid",
"union_tag_not_found",
"arguments_type",
"missing_argument",
"unexpected_keyword_argument",
"missing_keyword_only_argument",
"unexpected_positional_argument",
"missing_positional_only_argument",
"multiple_argument_values",
"url_type",
"url_parsing",
"url_syntax_violation",
"url_too_long",
"url_scheme",
"uuid_type",
"uuid_parsing",
"uuid_version",
"decimal_type",
"decimal_parsing",
"decimal_max_digits",
"decimal_max_places",
"decimal_whole_digits",
"complex_type",
"complex_str_parsing"
],
"type": "string"
},
{
"type": "string"
}
],
"title": "Type"
},
"severity": {
"default": 30,
"enum": [
20,
30,
35
],
"title": "Severity",
"type": "integer"
}
},
"required": [
"loc",
"msg",
"type"
],
"title": "WarningEntry",
"type": "object"
}
},
"additionalProperties": true,
"description": "Summarizes output of all bioimageio validations and tests\nfor one specific `ResourceDescr` instance.",
"properties": {
"name": {
"title": "Name",
"type": "string"
},
"source_name": {
"title": "Source Name",
"type": "string"
},
"id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Id"
},
"type": {
"title": "Type",
"type": "string"
},
"format_version": {
"title": "Format Version",
"type": "string"
},
"status": {
"enum": [
"passed",
"valid-format",
"failed"
],
"title": "Status",
"type": "string"
},
"metadata_completeness": {
"default": 0.0,
"maximum": 1,
"minimum": 0,
"title": "Metadata Completeness",
"type": "number"
},
"details": {
"items": {
"$ref": "#/$defs/ValidationDetail"
},
"title": "Details",
"type": "array"
},
"env": {
"items": {
"$ref": "#/$defs/InstalledPackage"
},
"title": "Env",
"type": "array",
"uniqueItems": true
},
"saved_conda_list": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Saved Conda List"
}
},
"required": [
"name",
"source_name",
"type",
"format_version",
"status",
"details"
],
"title": "ValidationSummary",
"type": "object"
}
Fields:
-
name(str) -
source_name(str) -
id(Optional[str]) -
type(str) -
format_version(str) -
status(Literal['passed', 'valid-format', 'failed']) -
metadata_completeness(float) -
details(List[ValidationDetail]) -
env(Set[InstalledPackage]) -
saved_conda_list(Optional[str])
Validators:
-
_convert_old_env→env
metadata_completeness
pydantic-field
¤
metadata_completeness: float = 0.0
Estimate of completeness of the metadata in the resource description.
This completeness estimate may change with subsequent releases
and should be considered bioimageio.spec version specific.
status
pydantic-field
¤
status: Literal['passed', 'valid-format', 'failed']
Overall status of the bioimageio validation
add_detail
¤
add_detail(
detail: ValidationDetail, update_status: bool = True
) -> None
Source code in src/bioimageio/spec/summary.py
391 392 393 394 395 396 397 398 399 400 401 | |
display
¤
display(
*,
width: Optional[int] = None,
include_conda_list: bool = False,
tab_size: int = 4,
soft_wrap: bool = True,
) -> None
Source code in src/bioimageio/spec/summary.py
355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 | |
format
¤
format(
*,
width: Optional[int] = None,
include_conda_list: bool = False,
) -> str
Format summary as Markdown string (alias to format_md)
Source code in src/bioimageio/spec/summary.py
322 323 324 325 326 327 328 329 | |
format_html
¤
format_html(
*,
width: Optional[int] = None,
include_conda_list: bool = False,
) -> str
Source code in src/bioimageio/spec/summary.py
342 343 344 345 346 347 348 349 350 351 352 353 | |
format_md
¤
format_md(
*,
width: Optional[int] = None,
include_conda_list: bool = False,
) -> str
Format summary as Markdown string
Source code in src/bioimageio/spec/summary.py
331 332 333 334 335 336 337 338 339 340 | |
load_json
classmethod
¤
load_json(path: Path) -> Self
Load validation/test summary from a suitable JSON file
Source code in src/bioimageio/spec/summary.py
492 493 494 495 496 | |
log
¤
log(
to: Union[
Literal["display"],
Path,
Sequence[Union[Literal["display"], Path]],
],
) -> List[Path]
Convenience method to display the validation summary in the terminal and/or
save it to disk. See save for details.
Source code in src/bioimageio/spec/summary.py
403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 | |
save
¤
save(
path: Union[Path, Sequence[Path]] = Path(
"{id}_summary_{now}"
),
) -> List[Path]
Save the validation/test summary in JSON, Markdown or HTML format.
| RETURNS | DESCRIPTION |
|---|---|
List[Path]
|
List of file paths the summary was saved to. |
Notes:
- Format is chosen based on the suffix: .json, .md, .html.
- If path has no suffix it is assumed to be a direcotry to which a
summary.json, summary.md and summary.html are saved to.
Source code in src/bioimageio/spec/summary.py
424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 | |
save_html
¤
save_html(path: Path = Path('summary.html')) -> None
Save rendered validation/test summary as HTML file.
Source code in src/bioimageio/spec/summary.py
484 485 486 487 488 489 490 | |
save_json
¤
save_json(
path: Path = Path("summary.json"),
*,
indent: Optional[int] = 2,
) -> None
Save validation/test summary as JSON file.
Source code in src/bioimageio/spec/summary.py
468 469 470 471 472 473 474 475 | |
save_markdown
¤
save_markdown(path: Path = Path('summary.md')) -> None
Save rendered validation/test summary as Markdown file.
Source code in src/bioimageio/spec/summary.py
477 478 479 480 481 482 | |
WarningEntry
pydantic-model
¤
Bases: ValidationEntry
A warning in a ValidationDetail
Show JSON schema:
{
"description": "A warning in a `ValidationDetail`",
"properties": {
"loc": {
"items": {
"anyOf": [
{
"type": "integer"
},
{
"type": "string"
}
]
},
"title": "Loc",
"type": "array"
},
"msg": {
"title": "Msg",
"type": "string"
},
"type": {
"anyOf": [
{
"enum": [
"no_such_attribute",
"json_invalid",
"json_type",
"needs_python_object",
"recursion_loop",
"missing",
"frozen_field",
"frozen_instance",
"extra_forbidden",
"invalid_key",
"get_attribute_error",
"model_type",
"model_attributes_type",
"dataclass_type",
"dataclass_exact_type",
"none_required",
"greater_than",
"greater_than_equal",
"less_than",
"less_than_equal",
"multiple_of",
"finite_number",
"too_short",
"too_long",
"iterable_type",
"iteration_error",
"string_type",
"string_sub_type",
"string_unicode",
"string_too_short",
"string_too_long",
"string_pattern_mismatch",
"enum",
"dict_type",
"mapping_type",
"list_type",
"tuple_type",
"set_type",
"set_item_not_hashable",
"bool_type",
"bool_parsing",
"int_type",
"int_parsing",
"int_parsing_size",
"int_from_float",
"float_type",
"float_parsing",
"bytes_type",
"bytes_too_short",
"bytes_too_long",
"bytes_invalid_encoding",
"value_error",
"assertion_error",
"literal_error",
"date_type",
"date_parsing",
"date_from_datetime_parsing",
"date_from_datetime_inexact",
"date_past",
"date_future",
"time_type",
"time_parsing",
"datetime_type",
"datetime_parsing",
"datetime_object_invalid",
"datetime_from_date_parsing",
"datetime_past",
"datetime_future",
"timezone_naive",
"timezone_aware",
"timezone_offset",
"time_delta_type",
"time_delta_parsing",
"frozen_set_type",
"is_instance_of",
"is_subclass_of",
"callable_type",
"union_tag_invalid",
"union_tag_not_found",
"arguments_type",
"missing_argument",
"unexpected_keyword_argument",
"missing_keyword_only_argument",
"unexpected_positional_argument",
"missing_positional_only_argument",
"multiple_argument_values",
"url_type",
"url_parsing",
"url_syntax_violation",
"url_too_long",
"url_scheme",
"uuid_type",
"uuid_parsing",
"uuid_version",
"decimal_type",
"decimal_parsing",
"decimal_max_digits",
"decimal_max_places",
"decimal_whole_digits",
"complex_type",
"complex_str_parsing"
],
"type": "string"
},
{
"type": "string"
}
],
"title": "Type"
},
"severity": {
"default": 30,
"enum": [
20,
30,
35
],
"title": "Severity",
"type": "integer"
}
},
"required": [
"loc",
"msg",
"type"
],
"title": "WarningEntry",
"type": "object"
}
Fields:
_format_html_table
¤
_format_html_table(rows: List[List[str]]) -> str
format rows as HTML table
Source code in src/bioimageio/spec/summary.py
780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 | |
_format_md_table
¤
_format_md_table(rows: List[List[str]]) -> str
format rows as markdown table
Source code in src/bioimageio/spec/summary.py
760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 | |
_format_summary
¤
_format_summary(
summary: ValidationSummary,
*,
hide_tracebacks: bool = False,
hide_source: bool = False,
hide_env: bool = False,
target: Union[
rich.console.Console, Literal["html", "md"]
] = "md",
include_conda_list: bool,
width: int,
) -> str
Source code in src/bioimageio/spec/summary.py
528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 | |
format_loc
¤
format_loc(
loc: Loc,
target: Union[
Literal["md", "html", "plain"], rich.console.Console
],
) -> str
helper to format a location tuple loc
Source code in src/bioimageio/spec/summary.py
131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 | |
is_dict
¤
is_dict(v: Any) -> TypeGuard[Dict[Any, Any]]
to avoid Dict[Unknown, Unknown]
Source code in src/bioimageio/spec/_internal/type_guards.py
12 13 14 | |
is_yaml_value
¤
is_yaml_value(value: Any) -> TypeGuard[YamlValue]
Source code in src/bioimageio/spec/_internal/io.py
501 502 | |
write_yaml
¤
write_yaml(
content: Union[
YamlValue, BioimageioYamlContentView, BaseModel
],
/,
file: Union[
NewPath, FilePath, IO[str], IO[bytes], ZipPath
],
)
Source code in src/bioimageio/spec/_internal/io_utils.py
72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 | |