csdms

wmtexe.audit module

Tools for checking a wmt-exe environment.

wmtexe.audit.audit(environ)[source]

Check a wmt-exe environment.

Parameters:

environ : dict

Environment variables.

Returns:

str

Warnings/errors.

wmtexe.audit.check_is_component(module_name, component, python='python', env=None)[source]

Check whether the input name is a component.

Parameters:

module_name : str

Name of module.

component : str

Name of component.

python : str, optional

Python executable (default is ‘python’).

env : dict, optional

Environment variables.

Returns:

str

Human-readable message.

wmtexe.audit.check_is_dir(path_to_dir)[source]

Check whether a path is a directory.

Parameters:

path_to_dir : str

A path.

Returns:

str

Human-readable message.

wmtexe.audit.check_is_executable(program)[source]

Check whether a program is executable.

Parameters:

program : str

Program name.

Returns:

str

Human-readable message.

wmtexe.audit.check_is_module(module_name, python='python', env=None)[source]

Check whether the input name is a module.

Parameters:

module_name : str

Name of module.

python : str, optional

Python executable (default is ‘python’).

env : dict, optional

Environment variables.

Returns:

str

Human-readable message.

wmtexe.audit.find_components(python='python', env=None)[source]

Get a list of components.

Parameters:

python : str, optional

Python executable (default is ‘python’).

env : dict, optional

Environment variables.

Returns:

list

Component names, or an empty list if no components are found.

wmtexe.audit.path_to_python_module(module_name, python='python', env=None)[source]

Get the path to the given module.

Parameters:

module_name : str

Name of module.

python : str, optional

Python executable (default is ‘python’).

env : dict, optional

Environment variables.

Returns:

str

A fully qualified path, or None on error.

wmtexe.audit.result_message(assertion, checking)[source]

Create a color-coded message.

Parameters:

assertion : bool

checking : str

Returns:

str

Human-readable message.