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
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
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.