Package schrodinger :: Package application :: Package jaguar :: Module file_logger :: Class FileLogger
[hide private]
[frames] | no frames]

Class FileLogger

object --+
         |
        FileLogger

Class to register output files. This is basically a wrapper for jobcontrol.

Instance Methods [hide private]
 
__init__(self, jobname, do_recover)
x.__init__(...) initializes x; see help(type(x)) for signature
 
__enter__(self)
Support context management "with" statement.
 
__exit__(self, exc_type, exc_value, exc_traceback)
Support context management "with" statement.
 
register_file(self, fname, logfile)
Register file in CWD as a jobcontrol output file.

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, jobname, do_recover)
(Constructor)

 

x.__init__(...) initializes x; see help(type(x)) for signature

Parameters:
  • jobname (str) - jobname
  • do_recover (bool) - if False, update the .recover file
Overrides: object.__init__

__enter__(self)

 

Support context management "with" statement. On entering the context, set a module variable so that we can conveniently use this class without passing a class instance around the backend scripts.

register_file(self, fname, logfile)

 

Register file in CWD as a jobcontrol output file.

If the file already exists, this call will also request JC to copy it to the launch machine imminently, which is useful for returning intermediate results before the whole workflow ends. e.g. such output files could be re-used in a recover/restart in case of job failure.

To stream the file, use logfile=True. But note this doesn't work well where the change cannot simply be appended.

Parameters:
  • fname (str) - file name
  • logfile (bool) - register as a streamed log file