schrodinger.application.livedesign_ml.ldml_utils module¶
Utility functions for LiveDesign ML (LDML) operations.
This module provides higher-level convenience functions that build on top of
the LDMLClient API, such as polling for job completion.
- schrodinger.application.livedesign_ml.ldml_utils.get_job_metadata(job_dir: Path, job_name: str, logger: logging.Logger | None = None) dict | None¶
Read job metadata from an LDML monitoring job checkpoint file.
- Parameters:
job_dir – Directory containing the monitoring job output.
job_name – Monitoring job name.
logger – Logger used to report unavailable or invalid metadata.
- Returns:
Job metadata, or None if it is unavailable or invalid.
- schrodinger.application.livedesign_ml.ldml_utils.poll_ldml_job(get_status: Callable[[str], LDMLJobStatus], job_id: str, polling_interval: int = 600, max_retries: int = 5, logger: logging.Logger | None = None) LDMLJobStatus¶
Poll an LDML job until completion or failure.
Sleeps for
polling_intervalseconds between each status check. On a successful status fetch the retry counter resets to zero. On a retriable error (network or API-call failure) the counter increments; if it reachesmax_retriesanLDMLClientErroris raised. A definitive (non-retriable) error propagates immediately.- Parameters:
get_status – Callable that accepts a job ID and returns the current
LDMLJobStatus.job_id – The LDML job ID to poll.
polling_interval – Seconds between status polls.
max_retries – Max consecutive polling errors before failure.
logger – Logger instance to use. Defaults to this module’s logger.
- Returns:
Final job status.
- Raises:
LDMLClientError – If max retries exceeded.
- schrodinger.application.livedesign_ml.ldml_utils.poll_retrosynth_job(client: LDMLClient, job_id: str, project_name: str, polling_interval: int = 600, max_retries: int = 5, logger: logging.Logger | None = None) LDMLJobStatus¶
Poll a retrosynthesis job until completion or failure.
- Parameters:
client – An
LDMLClientinstance.job_id – The LDML job ID to poll.
project_name – RetroSynthesis project name.
polling_interval – Seconds between status polls.
max_retries – Max consecutive polling errors before failure.
logger – Logger instance to use. Defaults to this module’s logger.
- Returns:
Final job status.
- Raises:
LDMLClientError – If max retries exceeded.