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

Module user_config

User profiles and configuration support for Jaguar input files

Classes [hide private]
  JaguarConfigError
Functions [hide private]
 
_load_user_macros(fh)
Import the Jaguar configuration file.
 
_get_macro_dict()
Return the dictionary of macros.
 
_write_preprocessed_infile(macros, infile, outfile)
Write expanded file <outfile> based on file <infile> and macro definitions.
 
get_config_filename()
Return path to Jaguar config file
 
preprocess_infile(infile, outfile)
Preprocess macros in file <infile> and write postprocessed file <outfile>.
dict
get_macro(name, reread=False)
Return the dictionary of keywords set by the jaguar macro called name.
Variables [hide private]
  CONFIG_FILE = 'jaguar.config'
  _macros = {}
  __package__ = 'schrodinger.application.jaguar'
Function Details [hide private]

_load_user_macros(fh)

 

Import the Jaguar configuration file. The format is:

<name1> key1=value1 key2=value2 ... <name2> keyA=valueA keyB=valueB

where <name> is differentiated as any line NOT containing a "=" character.

Parameters:
  • fh (open file handle) - file handle to an open, readable Jaguar configuration file

_write_preprocessed_infile(macros, infile, outfile)

 

Write expanded file <outfile> based on file <infile> and macro definitions.

Parameters:
  • infile (str) - name of file to be preprocessed
  • outfile (str) - name of postprocessed file

preprocess_infile(infile, outfile)

 

Preprocess macros in file <infile> and write postprocessed file <outfile>. If files names are the same, <infile> is overwritten.

Parameters:
  • infile (str) - name of file to be preprocessed
  • outfile (str) - name of postprocessed file

get_macro(name, reread=False)

 

Return the dictionary of keywords set by the jaguar macro called name. If the macro does not exist, a ValueError is thrown.

The function will lazily initialize the global _macros variable.

Parameters:
  • name (str) - name of macro to convert into a dictionary
  • reread (bool) - whether the configuration file should be re-read
Returns: dict
dictionary of jaguar keywords
Raises:
  • ValueError - if name is not in the dictionary of known macros
  • JaguarConfigError - if there are problems with the config file