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.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_interval seconds between each status check. On a successful status fetch the retry counter resets to zero. On a transient LDMLClientError or LDMLApiError the counter increments; if it reaches max_retries an LDMLClientError is raised.

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 LDMLClient instance.

  • 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.