schrodinger.job.jobhandler module¶
- class schrodinger.job.jobhandler.JobHandler(cmd: List[str], viewname: Optional[str] = None, launch_dir: Optional[str] = None)¶
Bases:
schrodinger.job.jobhandler._AbstractJobHandler
A Job Handler for running and waiting on jobs. To use, initialize with a list of strings that you would use with JobViewFilter.launchJob. Then connect
my_jobhandler.jobCompleted
to any slots that need to be executed after the job is finished. The job handler also has a wait method that will pause execution of the current event until the job is finished. Note that during the wait, other ui events will continue to be processed.
- class schrodinger.job.jobhandler.AsyncJobHandler(*args, **kwargs)¶
Bases:
schrodinger.job.jobhandler._AbstractJobHandler
A jobhandler that launches jobs asynchronously (i.e. launchJob doesn’t wait for the job to actually start before returning).
- jobStarted¶
pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.
- jobLaunchFailed¶
pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.
- __init__(*args, **kwargs)¶
See _AbstractJobHandler for arguments.
- schrodinger.job.jobhandler.job_incorporated(job_id: str, first_entry_id: int, last_entry_id: int)¶
The function which is called after successful incorporation of the job from maestro. It is called only if job output is incorporated through maestro job incorporation. If individual panels have their own incorporation handler registered via maestro.job_incorporation_function_add(), and the panel is currently open and has handled the incorporation, this function will not be called by Maestro.
- Parameters
job_id – The id of the incorporated job
first_entry_id – The id of the first entry imported in the project from the output structure file associated with the given job.
last_entry_id – The id of the last entry imported in the project from the output structure file associated with the given job.
- schrodinger.job.jobhandler.connect_job_manager_signals()¶
Called by maestro to connect job manager signals to Python slots.
- schrodinger.job.jobhandler.launch_job_with_callback(cmd: List[str], callback: Callable[[schrodinger.job.jobcontrol.Job], None], launch_dir: Optional[str] = None) schrodinger.job.jobcontrol.Job ¶
Launch the given job, and call the specified callback when the job completes (either successfully or with a failure).
- Parameters
cmd – Command list
callback – Function to call when the job completes (either successfully or with a failure), with Job object as the only parameter.
launch_dir – Directory to launch job under
- Raises
RuntimeError – if the job fails to start.
- schrodinger.job.jobhandler.is_auto_download_active()¶
- Returns
Whether job auto-downloading is enabled