hats.io.validation#

Functions#

is_valid_catalog(→ bool)

Checks if a catalog is valid for a given base catalog pointer

is_valid_collection(→ bool)

Checks if a COLLECTION is valid for a given base catalog pointer

is_collection_info_valid(→ bool)

Checks if collection.properties file is valid for a given base catalog pointer

Module Contents#

is_valid_catalog(pointer: str | pathlib.Path | upath.UPath, strict: bool = False, fail_fast: bool = False, verbose: bool = True) bool[source]#

Checks if a catalog is valid for a given base catalog pointer

NB: This method uses logging to issue INFO, WARNING, and ERROR messages. Configure your logging environment to appropriately channel messages.

Parameters:
pointerstr | Path | UPath

pointer to base catalog directory

strictbool

should we perform additional checking that every optional file exists, and contains valid, consistent information, AS WELL AS all expected data partitions for the catalog’s partitions. (Default value = False)

fail_fastbool

DEPRECATED - will be removed in a future version.

verbosebool

DEPRECATED - will be removed in a future version.

Returns:
bool

True if both the properties and partition_info files are valid, False otherwise

is_valid_collection(pointer: str | pathlib.Path | upath.UPath, strict: bool = False, fail_fast: bool = False, verbose: bool = True) bool[source]#

Checks if a COLLECTION is valid for a given base catalog pointer

NB: This method uses logging to issue INFO, WARNING, and ERROR messages. Configure your logging environment to appropriately channel messages.

Parameters:
pointerstr | Path | UPath

pointer to base catalog collection directory

strictbool

should we perform additional checking that every optional file exists, and contains valid, consistent information, AS WELL AS strict checking on all sub-catalogs (primary, margin, and index). (Default value = False)

fail_fastbool

DEPRECATED - will be removed in a future version.

verbosebool

DEPRECATED - will be removed in a future version.

Returns:
bool

True if the collection properties are valid, and all sub-catalogs pass validation.

is_collection_info_valid(pointer: str | pathlib.Path | upath.UPath) bool[source]#

Checks if collection.properties file is valid for a given base catalog pointer