schrodinger.application.jaguar.file_logger module¶
General classes and functions related to output files, in particular when running under jobcontrol.
- exception schrodinger.application.jaguar.file_logger.FileLoggerError¶
Bases:
Exception
- schrodinger.application.jaguar.file_logger.register_file(fname: str, logfile: bool = 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: str, do_recover: bool)¶
Bases:
object
Class to register output files. This is basically a wrapper for jobcontrol.
- __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.
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 – 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 0x7f8a0ecbb9c0>)¶
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.