summary
¤
Utilities for summarizing and formatting BioImage.IO validation results.
This module defines data structures to capture validation errors, warnings, and summaries for BioImage.IO resource descriptions, along with helpers to format these results as plain text, Markdown, or HTML for reporting and diagnostics.
-
API Reference
specValidationSummary
Classes:
| Name | Description |
|---|---|
ErrorEntry |
An error in a |
InstalledPackage |
|
ValidationDetail |
a detail in a validation summary |
ValidationEntry |
Base of |
ValidationSummary |
Summarizes output of all bioimageio validations and tests |
WarningEntry |
A warning in a |
Functions:
| Name | Description |
|---|---|
format_loc |
helper to format a location tuple loc |
Attributes:
| Name | Type | Description |
|---|---|---|
CONDA_CMD |
|
|
Loc |
location of error/warning in a nested data structure |
|
WARNING_LEVEL_TO_NAME |
Mapping[WarningLevel, WarningLevelName]
|
|
WARNING_NAME_TO_LEVEL |
Mapping[WarningLevelName, WarningLevel]
|
|
WARNING_SEVERITY_TO_NAME |
Mapping[WarningSeverity, WarningSeverityName]
|
|
WarningLevelName |
|
|
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
-
API Reference
summaryformat_loc
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,
}
)
-
API Reference
summaryWARNING_NAME_TO_LEVEL
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,
}
)
WarningLevelName
module-attribute
¤
WarningLevelName = Literal[WarningSeverityName, 'error']
-
API Reference
summary
WarningSeverityName
module-attribute
¤
WarningSeverityName = Literal['info', 'warning', 'alert']
-
API Reference
summaryWARNING_SEVERITY_TO_NAME
-
API Reference
summaryWarningLevelName
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",
"default_factory_not_called",
"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",
"missing_sentinel_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
111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 | |
InstalledPackage
¤
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",
"default_factory_not_called",
"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",
"missing_sentinel_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",
"default_factory_not_called",
"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",
"missing_sentinel_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",
"default_factory_not_called",
"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",
"missing_sentinel_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",
"default_factory_not_called",
"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",
"missing_sentinel_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"
},
"Version": {
"anyOf": [
{
"type": "string"
},
{
"type": "integer"
},
{
"type": "number"
}
],
"description": "wraps a packaging.version.Version instance for validation in pydantic models",
"title": "Version"
},
"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",
"default_factory_not_called",
"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",
"missing_sentinel_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"
},
"version": {
"anyOf": [
{
"$ref": "#/$defs/Version"
},
{
"type": "null"
}
],
"default": null
},
"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]) -
version(Optional[Version]) -
type(str) -
format_version(str) -
status(Literal['passed', 'valid-format', 'failed']) -
metadata_completeness(Annotated[float, annotated_types.Interval(ge=0, le=1)]) -
details(List[ValidationDetail]) -
env(Set[InstalledPackage]) -
saved_conda_list(Optional[str])
Validators:
-
_convert_old_env→env
metadata_completeness
pydantic-field
¤
metadata_completeness: Annotated[
float, annotated_types.Interval(ge=0, le=1)
] = 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
411 412 413 414 415 416 417 418 419 420 421 | |
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
375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 | |
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
342 343 344 345 346 347 348 349 | |
format_html
¤
format_html(
*,
width: Optional[int] = None,
include_conda_list: bool = False,
) -> str
Source code in src/bioimageio/spec/summary.py
362 363 364 365 366 367 368 369 370 371 372 373 | |
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
351 352 353 354 355 356 357 358 359 360 | |
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
512 513 514 515 516 | |
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
423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 | |
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:
| Type | 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
444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 | |
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
504 505 506 507 508 509 510 | |
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
488 489 490 491 492 493 494 495 | |
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
497 498 499 500 501 502 | |
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",
"default_factory_not_called",
"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",
"missing_sentinel_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_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
140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 | |