openmnglab.datamodel.pandas.model.IPandasDataSchema#

class openmnglab.datamodel.pandas.model.IPandasDataSchema[source]#

Bases: Generic[TPanderaSchema], IDataSchema, ABC

Contains a Pandera schema with all elements named

__init__()#

Methods

__init__()

accepts(output_data_scheme)

Assess whether this scheme would accept the other data scheme as input.

validate(data_container)

Validates that a data container fits this scheme.

Attributes

pandera_schema

abstract accepts(output_data_scheme: IDataSchema) bool#

Assess whether this scheme would accept the other data scheme as input.

If the schemes are incompatible, the function may either raise an exception containing further details on why the other data scheme is not accepted as input or just return False

Raises:

DataSchemeCompatibilityError – If the data schemes are not compatible and further details are available

Parameters:

output_data_scheme – Output data scheme to check for compatibility

Returns:

True if the output data scheme is accepted as input, False otherwise

abstract validate(data_container: IDataContainer) bool#

Validates that a data container fits this scheme.

If this is not the case, the function may either raise an exception containing further details on why the validation failed or just return False :raise DataSchemeConformityError: If the schemes are not compatible to each other and detailed information is available :param data_container: Data container to validate :return: True if the data container conforms to this scheme, False otherwise.