Validate

The Validate class validates the outputs of a data wranglng Method.

class whyqd.validate.validate.Validate(directory: str, source: Optional[str] = None, method: Optional[whyqd.models.method_model.MethodModel] = None)

Validate an existing method.

Parameters:
  • directory (str) – Working path for validating methods, interim data files and final output.
  • source (str, default None) – Path to a json file containing a saved method.
  • method (MethodModel, default None) – A json file containing a saved method.
describe

Get the method name, title and description.

  • name: Term used for filename and referencing. Will be lower-cased and spaces replaced with _
  • title: Human-readable term used as name.
  • description: Detailed description for the method. Reference its objective and use-case.
Returns:
Return type:dict or None
get

Get the method model.

Returns:
Return type:MethodModel or None
set(source: Optional[str] = None, method: Optional[whyqd.models.method_model.MethodModel] = None) → None

Initialise an existing method for validation.

Parameters:
  • source (str, default None) – Path to a json file containing a saved method.
  • method (MethodModel, default None) – A json file containing a saved method.
import_input_data(path: Union[str, List[str]]) → None

Import a list of paths to input data to be used for build validation.

Parameters:path (str or list of str) – Full path to associated source data.
Raises:ValueError if checksums fail to match.
import_restructured_data(path: str) → None

Import restructured data to be used for build validation.

Parameters:path (str) – Full path to associated source data.
validate() → bool

Validate the build process and all data checksums. Will perform all actions on each interim data source.

Raises:ValueError if any steps fail to validate.
Returns:
Return type:bool