schrodinger.utils.sea.evalor module¶
Module for parameter validation. See schrodinger.utils.sea
for more details.
Copyright Schrodinger, LLC. All rights reserved.
-
class
schrodinger.utils.sea.evalor.
Evalor
(map, err_break='\n\n')¶ Bases:
object
This is the evaluator class for checking validity of parameters.
-
__init__
(map, err_break='\n\n')¶ - Parameters
map – ‘map’ contains all parameters to be checked.
-
property
err
¶
-
is_ok
()¶ Returns true if there is no error and unchecked maps.
-
record_error
(mapname=None, err='')¶ Records the error.
- Parameters
mapname – The name of the checked parameter.
err – The error message.
-
property
unchecked_map
¶ Returns a string that tell which parameters have not been checked.
-
copy_from
(ev)¶ Makes a copy from ‘ev’.
- Parameters
ev – A ‘Evalor’ object.
-
-
schrodinger.utils.sea.evalor.
check_map
(map, valid, ev, tag={})¶ Checks the validity of a map.
-
schrodinger.utils.sea.evalor.
is_powerof2
(x)¶ Returns True if ‘x’ is a power of 2, or False otherwise.
-
schrodinger.utils.sea.evalor.
reg_xcheck
(name, func)¶ Registers external checker.
- Parameters
name – Name of the checker.
func – Callable object that checks validity of a parameter. For interface requirement, see ‘_xchk_power2’, or ‘_xchk_file_exists’, or ‘_xchk_dir_exists’ for example.