pyrk.inp.validation module

pyrk.inp.validation.validate_g(valname, val, llim)[source]

Raises errors if the value is less than the lower limit (llim) or if it is of the wrong type

Parameters:
  • valname (string) – the name of the value being validated
  • val (should be a number (or pint.Quantity)) – the value to be validated
  • llim (the same type as val) – the lower limit of acceptable value for val
pyrk.inp.validation.validate_ge(valname, val, llim)[source]

Raises errors if the value is less than the lower limit (llim) or if it is of the wrong type

Parameters:
  • valname (string) – the name of the value being validated
  • val (should be a number (or pint.Quantity)) – the value to be validated
  • llim (the same type as val) – the lower limit of acceptable value for val
pyrk.inp.validation.validate_le(valname, val, ulim)[source]

Raises errors if the value is greater than the upper limit (ulim) or if it is of the wrong type

Parameters:
  • valname (string) – the name of the value being validated
  • val (should be a number (or pint.Quantity)) – the value to be validated
  • ulim (the same type as val) – the upper limit of acceptable value for val
pyrk.inp.validation.validate_not_none(valname, val)[source]

Checks that val is not None

Parameters:
  • valname (string) – the name of the value being validated
  • val (any) – the value to be validated
pyrk.inp.validation.validate_num(valname, val)[source]

Checks that val is a number

Parameters:
  • valname (string) – the name of the value being validated
  • val (should be a number (or pint.Quantity)) – the value to be validated
pyrk.inp.validation.validate_supported(valname, val, supported)[source]

Checks that val is not None

Parameters:
  • valname (string) – the name of the value being validated
  • val (any) – the value to be validated
  • supported (list, tuple, anything with “in” functionality) – a list or tuple of allowed values for val