schrodinger.test.stu.fep_test_utils module

schrodinger.test.stu.fep_test_utils.get_job_spec_from_args(argv: List[str]) schrodinger.job.launchapi.JobSpecification
schrodinger.test.stu.fep_test_utils.handle_environment_and_directory_context(extra_environment_variables: Optional[Dict[str, str]] = None)

Context manager to set appropriate environment variables, and switch to the results directory (creating it if needed), and undo these when concluded.

Parameters

extra_environment_variables – additional environment variables to be set outside of the default STU test ones defined in CONST_ENV_VAR_MAP

schrodinger.test.stu.fep_test_utils.get_run_types_in_test_environment(test_name: str, run_types: Iterable[schrodinger.test.stu.fep_stu_constants.RunType] = <enum 'RunType'>, skip_pdf: bool = False, remove_lambda_hopping: bool = False, extra_environment_variables: Optional[Dict[str, str]] = None) Generator[schrodinger.test.stu.fep_stu_constants.RunType, None, None]

Yield the user-specified run types in the approprate testing environment, cleaning up the run after each run_type. Cleans up the subjob once the generator has been exhausted.

Parameters
  • test_name – the associated name with this test run

  • run_types – the user-specified set of run types to execute

  • skip_pdf – whether the fmp_to_pdf script should be skipped upon job conclusion

  • remove_lambda_hopping – whether lamdbda hopping files should be removed upon job completion

  • extra_environment_variables – additional environment variables outside of the default STU test ones defined in CONST_ENV_VAR_MAP

Yield

the next run_type specified by the user

schrodinger.test.stu.fep_test_utils.launch_job(jobdj: schrodinger.job.queue.JobDJ, fep_plus_cmd: List[str], fail_workup_fn: Optional[Callable] = None)

Adds given FEP command to job queue, and attempts to run the job.

Parameters
  • jobdj – the job DJ used to launch jobs

  • fep_plus_cmd – job control command

  • fail_workup_fn – workup function to be run upon encountering an error, to determine whether error should be raised

Raises

RuntimeError – when the launched job raises RuntimeError without succeeding

schrodinger.test.stu.fep_test_utils.run_fmp_to_pdf(jobname: str) List[str]

Return the command to convert the output fmp to a pdf.

schrodinger.test.stu.fep_test_utils.cleanup_run(output_dirname: str)

Cleanup after a run. This will copy the output files to output_dirname and remove generated pdfs, in preparation for the next run.

Parameters

output_dirname – Directory name for the output files.

schrodinger.test.stu.fep_test_utils.cleanup_subjob(jobname: str)

Remove the subjob folders (those matching ‘{jobname}_’) and the corresponding -out.tgz.

Used to reduce the output size.

schrodinger.test.stu.fep_test_utils.parse_input_stu_args(*argv)