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.Error

This 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 Catalog needs to be checked.

Yields

The label type and AttributeInfoError indicating that AttributeInfo has 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.AttributeInfoError

The health check class for invalid.

This error is raised to indicate that AttributeInfo has 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 AttributeInfo needs to be checked.

Yields

InvalidTypeError indicating that AttributeInfo has invalid ‘type’ field.

Return type

Iterator[tensorbay.healthcheck.catalog_check.InvalidTypeError]

class tensorbay.healthcheck.catalog_check.InvalidEnumError(name)[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.

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 AttributeInfo needs to be checked.

Yields

InvalidEnumError indicating that AttributeInfo has invalid ‘enum’ field.

Return type

Iterator[tensorbay.healthcheck.catalog_check.InvalidEnumError]

class tensorbay.healthcheck.catalog_check.NeitherTypeNorEnumError(name)[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’.

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 AttributeInfo needs to be checked.

Yields

NeitherTypeNorEnumError indicating that AttributeInfo has 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.AttributeInfoError

The health check class for redundant type error.

This error is raised to indicate that AttributeInfo has 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.

AttributeInfo which has both ‘enum’ and ‘type’ field.

Parameters

attribute_info (tensorbay.label.attributes.AttributeInfo) – The AttributeInfo needs to be checked.

Yields

RedundantTypeError indicating that AttributeInfo has 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.AttributeInfoError

The health check class for range not support error.

This error is raised to indicate AttributeInfo has 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.

AttributeInfo which has range for non number type.

Parameters

attribute_info (tensorbay.label.attributes.AttributeInfo) – The AttributeInfo needs to be checked.

Yields

RangeNotSupportError indicating that AttributeInfo has 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.AttributeInfoError

The health check class for invalid range error.

This error is raised to indicate that AttributeInfo has 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.

AttributeInfo which has invalid range.

Parameters

attribute_info (tensorbay.label.attributes.AttributeInfo) – The AttributeInfo needs to be checked.

Yields

InvalidRangeError indicating that AttributeInfo has 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.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 (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: object

The health check class for parent categories.

This error is raised to indicate that AttributeInfo has invalid parent_categories.

Parameters

categories (Optional[tensorbay.utility.name.NameList[tensorbay.label.supports.CategoryInfo]]) – The dictionary of CategoryInfo which indicates all valid parent categories.

Return type

None