schrodinger.application.jaguar.validation module

Jaguar keywords input validation and custom Exceptions

exception schrodinger.application.jaguar.validation.JaguarKeywordException

Bases: schrodinger.application.jaguar.exceptions.JaguarUserFacingException

Base exception class for all custom Jaguar keyword validation errors

__init__

Initialize self. See help(type(self)) for accurate signature.

args
with_traceback()

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception schrodinger.application.jaguar.validation.JaguarKeywordError(keyword, allowed_keywords)

Bases: schrodinger.application.jaguar.validation.JaguarKeywordException

Exception class raised when nonexistant Jaguar keyword is requested

__init__(keyword, allowed_keywords)
Parameters:
  • keyword (string) – input keyword
  • allowed_keywords (list) – list of allowed keywords
args
with_traceback()

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception schrodinger.application.jaguar.validation.JaguarKeywordValueTypeError(keyword, value, valid_type)

Bases: schrodinger.application.jaguar.validation.JaguarKeywordException

Exception class raised when Jaguar keyword value has wrong type

__init__(keyword, value, valid_type)
Parameters:
  • keyword (string) – input keyword
  • value (string) – input value
  • valid_type (string) – types as described in keywordsDB_mod.py
args
with_traceback()

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception schrodinger.application.jaguar.validation.JaguarKeywordValueError(keyword, value, settings)

Bases: schrodinger.application.jaguar.validation.JaguarKeywordException

Exception class raised when Jaguar keyword value is invalid

__init__(keyword, value, settings)
Parameters:
  • keyword (string) – input keyword
  • value (string) – input value
  • settings (list of Settings objects) – settings associated with a keyword
args
with_traceback()

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception schrodinger.application.jaguar.validation.JaguarKeywordFormatError(token)

Bases: schrodinger.application.jaguar.validation.JaguarKeywordException

Exception class raised when a string not in the keyword=value format is found

__init__(token)
Parameters:token (string) – The token that violates the keyword=value format
args
with_traceback()

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

schrodinger.application.jaguar.validation.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

schrodinger.application.jaguar.validation.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.

schrodinger.application.jaguar.validation.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.