Validation

Validation class for ChemKED schema.

class pyked.validation.OurValidator(*args, **kwargs)[source]

Custom validator with rules for Quantities and references.

pyked.validation.compare_name(given_name, family_name, question_name)[source]

Compares a name in question to a specified name separated into given and family.

The name in question question_name can be of varying format, including “Kyle E. Niemeyer”, “Kyle Niemeyer”, “K. E. Niemeyer”, “KE Niemeyer”, and “K Niemeyer”. Other possibilities include names with hyphens such as “Chih-Jen Sung”, “C. J. Sung”, “C-J Sung”.

Examples

>>> compare_name('Kyle', 'Niemeyer', 'Kyle E Niemeyer')
True
>>> compare_name('Chih-Jen', 'Sung', 'C-J Sung')
True
Parameters:
  • given_name (str) – Given (or first) name to be checked against.

  • family_name (str) – Family (or last) name to be checked against.

  • question_name (str) – The whole name in question.

Returns:

The return value. True for successful comparison, False otherwise.

Return type:

bool

pyked.validation.row_uncertainty_kinds(metadata)[source]

The kinds of uncertainty that a profile’s metadata describes without giving a value.

A concentration profile row may end with an uncertainty of its own. The profile’s uncertainty metadata says what that last value is with the descriptive keys of one kind, such as evaluated-standard-deviation-type, given without the value of that kind, which is in the rows instead. Without such keys the last value of a row is an absolute uncertainty in the units of the profile.

Parameters:

metadata (dict) – The uncertainty metadata mapping of a concentration profile

Returns:

uncertainty and/or evaluated-standard-deviation, each kind whose descriptive keys are given without a value

Return type:

list

pyked.validation.units = <pint.registry.UnitRegistry object>

Unit registry to contain the units used in PyKED