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: str, logfile: bool = False)

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

Jaguar jobs that support the recover mechanism must run inside the FileLogger context, but for normal (or null) file registration, we allow this function to also be called outside a FileLogger context.

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

Bases: object

Class to register output files and handle the Jaguar recover mechanism. In particular, any output paths registered inside this context will be added to the recover file, unless this is already a recover job.

__init__(jobname: str, do_recover: bool)
Parameters:
  • jobname – jobname

  • do_recover – if False, update the .recover file

register_file(fname: str, logfile: bool)

Register file in CWD as a jobcontrol output file, and record path with the recover mechanism unless this is already a recover job.

Parameters:
  • fname – file name

  • logfile – register as a streamed log file

schrodinger.application.jaguar.file_logger.launch_path() str

Get the path from which the job was launched. If it’s a local job it will be the CWD.

schrodinger.application.jaguar.file_logger.relative_path() str

Return the path to the CWD, relative to the current job’s launch directory. If the CWD is the same as the launch directory, then the path is returned as an empty string (does not contain ‘.’)

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

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: str)

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

schrodinger.application.jaguar.file_logger.transfer_subjob_files(job_id: <property object at 0x75bf0417c810>)

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 id

schrodinger.application.jaguar.file_logger.slugify(mystr: str, replace: bool = False) str
schrodinger.application.jaguar.file_logger.make_outmaefile(outmaefile: str, infiles: list[str], status: dict, write_jname: bool = False, include_failures: bool = False)

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

Parameters:
  • outmaefile – name of output .mae file

  • infiles – subjob input files, including suffix, e.g. mol1.in

  • status – status of each subjob indexed by filename

  • write_jname – add JNAME property to structure

  • include_failures – If True include failures in output maestro file and group structures by status. If False only successful jobs are retained.

schrodinger.application.jaguar.file_logger.make_smapfile(outmaefile: str, smapfile: str)

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.