schrodinger.application.jaguar.validation module

Jaguar keywords input validation and custom Exceptions

Copyright Schrodinger, LLC. All rights reserved.

exception schrodinger.application.jaguar.validation.JaguarKeywordException

Bases: schrodinger.application.jaguar.exceptions.JaguarUserFacingException

Base exception class for all custom Jaguar keyword validation errors

__init__(*args, **kwargs)
args
with_traceback()

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

exception schrodinger.application.jaguar.validation.JaguarKeywordError(keyword: str, allowed_keywords: List[str])

Bases: schrodinger.application.jaguar.validation.JaguarKeywordException

Exception class raised when nonexistant Jaguar keyword is requested

__init__(keyword: str, allowed_keywords: List[str])
Parameters
  • keyword – input keyword

  • allowed_keywords – 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: str, value: str, valid_type: str)

Bases: schrodinger.application.jaguar.validation.JaguarKeywordException

Exception class raised when Jaguar keyword value has wrong type

__init__(keyword: str, value: str, valid_type: str)
Parameters
  • keyword – input keyword

  • value – input value

  • valid_type – types as described in keywordsDB.py

args
with_traceback()

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

exception schrodinger.application.jaguar.validation.JaguarKeywordValueError(keyword: str, value: str, settings: List[schrodinger.application.jaguar.keywordDB.Setting])

Bases: schrodinger.application.jaguar.validation.JaguarKeywordException

Exception class raised when Jaguar keyword value is invalid

__init__(keyword: str, value: str, settings: List[schrodinger.application.jaguar.keywordDB.Setting])
Parameters
  • keyword – input keyword

  • value – input value

  • settings – 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: str)

Bases: schrodinger.application.jaguar.validation.JaguarKeywordException

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

__init__(token: str)
Parameters

token – 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: str, value: str) bool

Check if value has type equivalent to valid_type after converting string

Parameters
  • valid_type – types as described in keywordsDB.py

  • value – keyword value from input

schrodinger.application.jaguar.validation.keyword_value_pair_is_valid(keyword: str, value: str) bool

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

Parameters
  • keyword – e.g. ‘igeopt’

  • value – 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: str) bool

Validate a string of keyword=value pairs

Parameters

pairs – e.g. ‘-keyword1=val1 -keyword2=value2 -keyword3=value3’

Returns

True if all pairs valid, otherwise raise specialized exceptions.