schrodinger.application.jaguar.file_logger module

General classes and functions related to output files, in particular when running under jobcontrol.

schrodinger.application.jaguar.file_logger.register_file(fname, logfile=False)

Convenience wrapper for FileLogger.register_file() when using “with FileLogger:” context management. See FileLogger docstring for more details.

class schrodinger.application.jaguar.file_logger.FileLogger(jobname, do_recover)

Bases: object

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

__init__(jobname, do_recover)
Parameters:
  • jobname (str) – jobname
  • do_recover (bool) – if False, update the .recover file
__enter__()

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.

__exit__(exc_type, exc_value, exc_traceback)

Support context management “with” statement.

register_file(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
__class__

alias of builtins.type

__delattr__

Implement delattr(self, name).

__dict__ = mappingproxy({'__module__': 'schrodinger.application.jaguar.file_logger', '__doc__': '\n Class to register output files. This is basically a wrapper for jobcontrol.\n ', '__init__': <function FileLogger.__init__>, '__enter__': <function FileLogger.__enter__>, '__exit__': <function FileLogger.__exit__>, 'register_file': <function FileLogger.register_file>, '__dict__': <attribute '__dict__' of 'FileLogger' objects>, '__weakref__': <attribute '__weakref__' of 'FileLogger' objects>})
__dir__() → list

default dir() implementation

__eq__

Return self==value.

__format__()

default object formatter

__ge__

Return self>=value.

__getattribute__

Return getattr(self, name).

__gt__

Return self>value.

__hash__

Return hash(self).

__init_subclass__()

This method is called when a class is subclassed.

The default implementation does nothing. It may be overridden to extend subclasses.

__le__

Return self<=value.

__lt__

Return self<value.

__module__ = 'schrodinger.application.jaguar.file_logger'
__ne__

Return self!=value.

__new__()

Create and return a new object. See help(type) for accurate signature.

__reduce__()

helper for pickle

__reduce_ex__()

helper for pickle

__repr__

Return repr(self).

__setattr__

Implement setattr(self, name, value).

__sizeof__() → int

size of object in memory, in bytes

__str__

Return str(self).

__subclasshook__()

Abstract classes can override this to customize issubclass().

This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).

__weakref__

list of weak references to the object (if defined)

schrodinger.application.jaguar.file_logger.launch_path()

Get the path from which the job was launched. if its a local job it will be the cwd.

schrodinger.application.jaguar.file_logger.relative_path()

return the path to the cwd, relative to a launch directory If the cwd the same as the launch directory the path is returned as an empty string (does not contain ‘.’)

schrodinger.application.jaguar.file_logger.set_structure_file(fname)

Register the file fname as the output structure file with jobcontrol, assumes the file fname, is in the cwd.

schrodinger.application.jaguar.file_logger.copy_file(fname)

Copy the file fname running under jobcontrol to the launch dir.

schrodinger.application.jaguar.file_logger.transfer_subjob_files(job_id)

Register files held in a job record from the working dir to the launch dir associated with a jobcontrol backend. This function can handle jobs launched in subdirectories.

Parameters:job_id (jobcontrol.Job.JobID) – jobcontrol job id
schrodinger.application.jaguar.file_logger.slugify(mystr)

Transform a string to a valid file and job name

schrodinger.application.jaguar.file_logger.make_outmaefile(outmaefile, infiles, status, write_jname=False)

Collect output CTs from Jaguar jobs into a single .mae file

Parameters:
  • outmaefile (str) – name of output .mae file
  • infiles (list of strs) – subjob input files, including suffix, e.g. mol1.in
  • status (dictionary) – status of each subjob indexed by filename
schrodinger.application.jaguar.file_logger.make_smapfile(outmaefile, smapfile)

Write a .smap file containing the associations between CT index numbers in the outmaefile, and .vib, .vis, .spm files. This function relies on CT’s in the .mae file having a property ‘s_j_jname’ (stored in JNAME) which maps to the name of the .vib etc file.