Package schrodinger :: Package application :: Package jaguar :: Module validation
[hide private]
[frames] | no frames]

Module validation

Jaguar keywords input validation and specialized exceptions

Classes [hide private]
  JaguarKeywordException
Base exception class for all custom Jaguar keyword validation errors
  JaguarKeywordError
Exception class raised when nonexistant Jaguar keyword is requested
  JaguarKeywordValueTypeError
Exception class raised when Jaguar keyword value has wrong type
  JaguarKeywordValueError
Exception class raised when Jaguar keyword value is invalid
  JaguarKeywordFormatError
Exception class raised when a string not in the keyword=value format is found
Functions [hide private]
 
value_is_type(valid_type, value)
Check if value has type equivalent to valid_type after converting string
 
keyword_value_pair_is_valid(keyword, value)
Validate a specific keyword=value pair.
 
keyword_value_pairs_are_valid(pairs)
Validate a string of keyword=value pairs
Variables [hide private]
  STRING = 'string'
  INTEGER = 'integer'
  REAL = 'real'
Function Details [hide private]

value_is_type(valid_type, value)

 

Check if value has type equivalent to valid_type after converting string

Parameters:
  • valid_type (string) - types as described in keywordsDB.py
  • value (string) - keyword value from input
Returns:
True or False

keyword_value_pair_is_valid(keyword, value)

 

Validate a specific keyword=value pair. The checks are case insensitive.

Parameters:
  • keyword (string) - e.g. 'igeopt'
  • value (string) - e.g. '2' or '0.004' or any string
Returns:
True if all pairs valid, otherwise raise specialized exceptions.

keyword_value_pairs_are_valid(pairs)

 

Validate a string of keyword=value pairs

Parameters:
  • pairs (string) - e.g. '-keyword1=val1 -keyword2=value2 -keyword3=value3'
Returns:
True if all pairs valid, otherwise raise specialized exceptions.