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)[source]#
Bases:
tensorbay.healthcheck.report.ErrorThis class defines
AttributeInfoError.- Parameters
name (str) – The name of the attribute which has error.
- Return type
None
- tensorbay.healthcheck.catalog_check.check_catalog(catalog)[source]#
The health check method for
Catalog.- Parameters
catalog (tensorbay.label.catalog.Catalog) – The
Catalogneeds to be checked.- Yields
The label type and
AttributeInfoErrorindicating thatAttributeInfohas invalid ‘type’, ‘enum’, ‘range’ or ‘parent categories’ field.- Return type
Iterator[Tuple[str, tensorbay.healthcheck.catalog_check.AttributeInfoError]]
- class tensorbay.healthcheck.catalog_check.InvalidTypeError(name)[source]#
Bases:
tensorbay.healthcheck.catalog_check.AttributeInfoErrorThe health check class for invalid.
This error is raised to indicate that
AttributeInfohas invalid ‘type’ field.- Parameters
name (str) –
- Return type
None
- tensorbay.healthcheck.catalog_check.check_invalid_type(attribute_info)[source]#
The health check method for invalid type.
AttributeInfo‘type’ field.- Parameters
attribute_info (tensorbay.label.attributes.AttributeInfo) – The
AttributeInfoneeds to be checked.- Yields
InvalidTypeErrorindicating thatAttributeInfohas invalid ‘type’ field.- Return type
Iterator[tensorbay.healthcheck.catalog_check.InvalidTypeError]
- class tensorbay.healthcheck.catalog_check.InvalidEnumError(name)[source]#
Bases:
tensorbay.healthcheck.catalog_check.AttributeInfoErrorThe health check class for invalid enum.
This error is raised to indicate that
AttributeInfohas invalid ‘enum’ field.- Parameters
name (str) –
- Return type
None
- tensorbay.healthcheck.catalog_check.check_invalid_enum(attribute_info)[source]#
The health check method for invalid enum.
AttributeInfo‘enum’ field.- Parameters
attribute_info (tensorbay.label.attributes.AttributeInfo) – The
AttributeInfoneeds to be checked.- Yields
InvalidEnumErrorindicating thatAttributeInfohas invalid ‘enum’ field.- Return type
Iterator[tensorbay.healthcheck.catalog_check.InvalidEnumError]
- class tensorbay.healthcheck.catalog_check.NeitherTypeNorEnumError(name)[source]#
Bases:
tensorbay.healthcheck.catalog_check.AttributeInfoErrorThe health check class for either type enum.
This error is raised to indicate
AttributeInfohas neither ‘enum’ nor ‘type’.- Parameters
name (str) –
- Return type
None
- tensorbay.healthcheck.catalog_check.check_neither_type_nor_enum(attribute_info)[source]#
The health check method for
AttributeInfo.which has neither ‘enum’ nor ‘type’ field.
- Parameters
attribute_info (tensorbay.label.attributes.AttributeInfo) – The
AttributeInfoneeds to be checked.- Yields
NeitherTypeNorEnumErrorindicating thatAttributeInfohas neither ‘enum’ nor ‘type’ field.- Return type
Iterator[tensorbay.healthcheck.catalog_check.NeitherTypeNorEnumError]
- class tensorbay.healthcheck.catalog_check.RedundantTypeError(name)[source]#
Bases:
tensorbay.healthcheck.catalog_check.AttributeInfoErrorThe health check class for redundant type error.
This error is raised to indicate that
AttributeInfohas both ‘enum’ and ‘type’.- Parameters
name (str) –
- Return type
None
- tensorbay.healthcheck.catalog_check.check_redundant_type(attribute_info)[source]#
The health check method for redundant type.
AttributeInfowhich has both ‘enum’ and ‘type’ field.- Parameters
attribute_info (tensorbay.label.attributes.AttributeInfo) – The
AttributeInfoneeds to be checked.- Yields
RedundantTypeErrorindicating thatAttributeInfohas both ‘enum’ and ‘type’ field.- Return type
Iterator[tensorbay.healthcheck.catalog_check.RedundantTypeError]
- class tensorbay.healthcheck.catalog_check.RangeNotSupportError(name)[source]#
Bases:
tensorbay.healthcheck.catalog_check.AttributeInfoErrorThe health check class for range not support error.
This error is raised to indicate
AttributeInfohas range for non number type.- Parameters
name (str) –
- Return type
None
- tensorbay.healthcheck.catalog_check.check_range_not_support(attribute_info)[source]#
The health check method for range not support.
AttributeInfowhich has range for non number type.- Parameters
attribute_info (tensorbay.label.attributes.AttributeInfo) – The
AttributeInfoneeds to be checked.- Yields
RangeNotSupportErrorindicating thatAttributeInfohas range for non number type.- Return type
Iterator[tensorbay.healthcheck.catalog_check.RangeNotSupportError]
- class tensorbay.healthcheck.catalog_check.InvalidRangeError(name)[source]#
Bases:
tensorbay.healthcheck.catalog_check.AttributeInfoErrorThe health check class for invalid range error.
This error is raised to indicate that
AttributeInfohas invalid range.- Parameters
name (str) –
- Return type
None
- tensorbay.healthcheck.catalog_check.check_invalid_range(attribute_info)[source]#
The health check method for invalid range.
AttributeInfowhich has invalid range.- Parameters
attribute_info (tensorbay.label.attributes.AttributeInfo) – The
AttributeInfoneeds to be checked.- Yields
InvalidRangeErrorindicating thatAttributeInfohas invalid range.- Return type
Iterator[tensorbay.healthcheck.catalog_check.InvalidRangeError]
- class tensorbay.healthcheck.catalog_check.InvalidParentCategories(name, invalid_parent_category)[source]#
Bases:
tensorbay.healthcheck.catalog_check.AttributeInfoErrorThe health check class for invalid parent categories.
This error is raised to indicate that
AttributeInfohas invalid parent categories.This means the category in parent_categories cannot be found in Subcatalog.categories.- Parameters
name (str) – The name of the incorrect attribute.
invalid_parent_category (str) – The name of the incorrect parent_category.
- Return type
None
- class tensorbay.healthcheck.catalog_check.CheckParentCategories(categories)[source]#
Bases:
objectThe health check class for parent categories.
This error is raised to indicate that
AttributeInfohas invalid parent_categories.- Parameters
categories (Optional[tensorbay.utility.name.NameList[tensorbay.label.supports.CategoryInfo]]) – The dictionary of
CategoryInfowhich indicates all valid parent categories.- Return type
None