schrodinger.application.models.library.abstract_client module

exception schrodinger.application.models.library.abstract_client.ModelExistsError(id: str, version: str, is_definition: bool = True)

Bases: Exception

Raised when trying to upload a model definition or configuration that already exists in the library.

__init__(id: str, version: str, is_definition: bool = True) None
exception schrodinger.application.models.library.abstract_client.ModelNotFoundError(id: str, version: str | None = None, is_definition: bool = True)

Bases: Exception

Raised when trying to download a model definition or configuration that does not exist in the library.

__init__(id: str, version: str | None = None, is_definition: bool = True) None
exception schrodinger.application.models.library.abstract_client.UpdateVersionError(id: str, attempted_version: str, latest_version: str, is_definition: bool = True)

Bases: Exception

Raised when trying to update a non-latest version of a model definition or configuration. Only the latest version can be updated.

__init__(id: str, attempted_version: str, latest_version: str, is_definition: bool = True) None
exception schrodinger.application.models.library.abstract_client.ExecutionRecordExistsError(record_id: str)

Bases: Exception

Raised when trying to upload an execution record that already exists in the library.

__init__(record_id: str) None
exception schrodinger.application.models.library.abstract_client.ExecutionRecordNotFoundError(record_id: str)

Bases: Exception

Raised when trying to download an execution record that does not exist in the library.

__init__(record_id: str) None
class schrodinger.application.models.library.abstract_client.AbstractLibraryClient

Bases: object

Abstract base class for library clients.

Defines the core interface that all client implementations must support for CRUD operations.

createDefinition(model_def: ModelDefinition) ModelDefinition

Add a model definition to the library and return the added definition.

Parameters:

model_def – The model definition to upload

Raises:

ModelExistsError – If a definition with the same ID and version already exists

getDefinition(def_id: str, version: str | None = None) ModelDefinition

Read and return a model definition from the library.

Parameters:
  • def_id – The definition ID to download

  • version – The specific version to download, or None for latest

Returns:

The model definition

Raises:

ModelNotFoundError – If the definition is not found

updateDefinition(model_def: ModelDefinition) ModelDefinition

Update an existing model definition in the library and return the updated definition.

Parameters:

model_def – The model definition to update

Raises:

ModelNotFoundError – If the definition ID is not found

createConfiguration(model_config: ModelConfiguration) ModelConfiguration

Add a model config to the library and return the added configuration.

Parameters:

model_config – The model config to upload

Raises:

ModelExistsError – If an configuration with the same ID and version already exists

getConfiguration(config_id: str, version: str | None = None) ModelConfiguration

Read and return a model config from the library.

Parameters:
  • config_id – The configuration ID to download

  • version – The specific version to download, or None for latest

Returns:

The model config

Raises:

ModelNotFoundError – If the configuration is not found

updateConfiguration(model_config: ModelConfiguration) ModelConfiguration

Update an existing model config in the library and return the updated config.

Parameters:

model_config – The model config to update

Raises:

ModelNotFoundError – If the config ID is not found

getAllDefinitionIds() list[str]

Get all definition IDs in the library.

Returns:

List of unique definition IDs

getAllConfigurationIds() list[str]

Get all configuration IDs in the library.

Returns:

List of unique configuration IDs

getDefinitionVersions(def_id: str) list[str]

Get all available versions for a definition ID.

Parameters:

def_id – The definition ID

Returns:

List of version strings, in order they were created

Raises:

ModelNotFoundError – If the definition ID is not found

getConfigurationVersions(config_id: str) list[str]

Get all available versions for an configuration ID.

Parameters:

config_id – The configuration ID

Returns:

List of version strings, in order they were created

Raises:

ModelNotFoundError – If the configuration ID is not found

createExecutionRecord(record: ExecutionRecord) ExecutionRecord

Add an execution record to the library and return the added record.

Parameters:

record – The execution record to upload

Raises:

ExecutionRecordExistsError – If a record with the same ID already exists

getExecutionRecord(record_id: str) ExecutionRecord

Read and return the specified execution record.

Parameters:

record_id – The ID of the execution record to download

Raises:

ExecutionRecordNotFoundError – If the record is not found

getAllExecutionRecordIds() list[str]

Get all execution record IDs in the library.

Returns:

List of unique execution record IDs

getCurrentUser() str

Return the username of the current user.

getDefinitions(def_ids: list[str], version: str | None = None) list[ModelDefinition]

Get multiple model definitions from the library.

Parameters:
  • def_ids – List of definition IDs to download

  • version – The specific version to download for all definitions, or None for latest

Returns:

List of model definitions in the same order as def_ids

Raises:

ModelNotFoundError – If any definition is not found

getConfigurations(config_ids: list[str], version: str | None = None) list[ModelConfiguration]

Get multiple model configs from the library.

Parameters:
  • config_ids – List of configuration IDs to download

  • version – The specific version to download for all configurations, or None for latest

Returns:

List of model configs in the same order as config_ids

Raises:

ModelNotFoundError – If any configuration is not found