tensorbay.healthcheck.catalog_check¶
Method check_catalog.
check_catalog()
checks the catalog of Dataset
or FusionDataset
,
including subcatalog, categories and attributes.
For AttributeInfo
,
it finds errors in fields such as ‘type’, ‘enum’, ‘range’ and ‘parent categories’.
- class tensorbay.healthcheck.catalog_check.AttributeInfoError(name: str)[source]¶
Bases:
tensorbay.healthcheck.report.Error
This class defines
AttributeInfoError
.- Parameters
name – The name of the attribute which has error.
- tensorbay.healthcheck.catalog_check.check_catalog(catalog: tensorbay.label.catalog.Catalog) Iterator[Tuple[str, tensorbay.healthcheck.catalog_check.AttributeInfoError]] [source]¶
The health check method for
Catalog
.- Parameters
catalog – The
Catalog
needs to be checked.- Yields
The label type and
AttributeInfoError
indicating thatAttributeInfo
has invalid ‘type’, ‘enum’, ‘range’ or ‘parent categories’ field.
- class tensorbay.healthcheck.catalog_check.InvalidTypeError(name: str)[source]¶
Bases:
tensorbay.healthcheck.catalog_check.AttributeInfoError
The health check class for invalid.
This error is raised to indicate that
AttributeInfo
has invalid ‘type’ field.
- tensorbay.healthcheck.catalog_check.check_invalid_type(attribute_info: tensorbay.label.attributes.AttributeInfo) Iterator[tensorbay.healthcheck.catalog_check.InvalidTypeError] [source]¶
The health check method for invalid type.
AttributeInfo
‘type’ field.- Parameters
attribute_info – The
AttributeInfo
needs to be checked.- Yields
InvalidTypeError
indicating thatAttributeInfo
has invalid ‘type’ field.
- class tensorbay.healthcheck.catalog_check.InvalidEnumError(name: str)[source]¶
Bases:
tensorbay.healthcheck.catalog_check.AttributeInfoError
The health check class for invalid enum.
This error is raised to indicate that
AttributeInfo
has invalid ‘enum’ field.
- tensorbay.healthcheck.catalog_check.check_invalid_enum(attribute_info: tensorbay.label.attributes.AttributeInfo) Iterator[tensorbay.healthcheck.catalog_check.InvalidEnumError] [source]¶
The health check method for invalid enum.
AttributeInfo
‘enum’ field.- Parameters
attribute_info – The
AttributeInfo
needs to be checked.- Yields
InvalidEnumError
indicating thatAttributeInfo
has invalid ‘enum’ field.
- class tensorbay.healthcheck.catalog_check.NeitherTypeNorEnumError(name: str)[source]¶
Bases:
tensorbay.healthcheck.catalog_check.AttributeInfoError
The health check class for either type enum.
This error is raised to indicate
AttributeInfo
has neither ‘enum’ nor ‘type’.
- tensorbay.healthcheck.catalog_check.check_neither_type_nor_enum(attribute_info: tensorbay.label.attributes.AttributeInfo) Iterator[tensorbay.healthcheck.catalog_check.NeitherTypeNorEnumError] [source]¶
The health check method for
AttributeInfo
.which has neither ‘enum’ nor ‘type’ field.
- Parameters
attribute_info – The
AttributeInfo
needs to be checked.- Yields
NeitherTypeNorEnumError
indicating thatAttributeInfo
has neither ‘enum’ nor ‘type’ field.
- class tensorbay.healthcheck.catalog_check.RedundantTypeError(name: str)[source]¶
Bases:
tensorbay.healthcheck.catalog_check.AttributeInfoError
The health check class for redundant type error.
This error is raised to indicate that
AttributeInfo
has both ‘enum’ and ‘type’.
- tensorbay.healthcheck.catalog_check.check_redundant_type(attribute_info: tensorbay.label.attributes.AttributeInfo) Iterator[tensorbay.healthcheck.catalog_check.RedundantTypeError] [source]¶
The health check method for redundant type.
AttributeInfo
which has both ‘enum’ and ‘type’ field.- Parameters
attribute_info – The
AttributeInfo
needs to be checked.- Yields
RedundantTypeError
indicating thatAttributeInfo
has both ‘enum’ and ‘type’ field.
- class tensorbay.healthcheck.catalog_check.RangeNotSupportError(name: str)[source]¶
Bases:
tensorbay.healthcheck.catalog_check.AttributeInfoError
The health check class for range not support error.
This error is raised to indicate
AttributeInfo
has range for non number type.
- tensorbay.healthcheck.catalog_check.check_range_not_support(attribute_info: tensorbay.label.attributes.AttributeInfo) Iterator[tensorbay.healthcheck.catalog_check.RangeNotSupportError] [source]¶
The health check method for range not support.
AttributeInfo
which has range for non number type.- Parameters
attribute_info – The
AttributeInfo
needs to be checked.- Yields
RangeNotSupportError
indicating thatAttributeInfo
has range for non number type.
- class tensorbay.healthcheck.catalog_check.InvalidRangeError(name: str)[source]¶
Bases:
tensorbay.healthcheck.catalog_check.AttributeInfoError
The health check class for invalid range error.
This error is raised to indicate that
AttributeInfo
has invalid range.
- tensorbay.healthcheck.catalog_check.check_invalid_range(attribute_info: tensorbay.label.attributes.AttributeInfo) Iterator[tensorbay.healthcheck.catalog_check.InvalidRangeError] [source]¶
The health check method for invalid range.
AttributeInfo
which has invalid range.- Parameters
attribute_info – The
AttributeInfo
needs to be checked.- Yields
InvalidRangeError
indicating thatAttributeInfo
has invalid range.
- class tensorbay.healthcheck.catalog_check.InvalidParentCategories(name: str, invalid_parent_category: str)[source]¶
Bases:
tensorbay.healthcheck.catalog_check.AttributeInfoError
The health check class for invalid parent categories.
This error is raised to indicate that
AttributeInfo
has invalid parent categories.This means the category in parent_categories cannot be found in Subcatalog.categories.- Parameters
name – The name of the incorrect attribute.
invalid_parent_category – The name of the incorrect parent_category.
- class tensorbay.healthcheck.catalog_check.CheckParentCategories(categories: Optional[tensorbay.utility.name.NameList[tensorbay.label.supports.CategoryInfo]])[source]¶
Bases:
object
The health check class for parent categories.
This error is raised to indicate that
AttributeInfo
has invalid parent_categories.- Parameters
categories – The dictionary of
CategoryInfo
which indicates all valid parent categories.