schrodinger.application.models.datamodels.composite module

Classes to represent a composite model combining a model definition with configuration values and inheritance chain.

Many of these classes inherit CompoundParam, which is built upon QtCore.QObject. CompoundParam implements features such as serialization, versioning adapters, and Qt signals. As such, it’s a useful base class for data classes.

exception schrodinger.application.models.datamodels.composite.IncompatibleModelsError(model_1, model_2)

Bases: ValueError

__init__(model_1, model_2)
class schrodinger.application.models.datamodels.composite.CompositeInput(*args, _param_type=<object object>, **kwargs)

Bases: _BaseInput

The composite information about a particular model input.

val: str

A parameter of the class.

child_inheritance_mode: ChildInheritanceMode

A parameter of the class.

castValueString()
classmethod fromComponents(input_def: InputDef, input_config_chain: list[InputConfig] | None = None) Self
Parameters:
  • input_def – The definition for this input.

  • input_config_chain – The input configuration chain from oldest to youngest, if any, that can be used to determine the most recently defined data for the input.

child_inheritance_modeChanged

A pyqtSignal emitted by instances of the class.

child_inheritance_modeReplaced

A pyqtSignal emitted by instances of the class.

nameChanged

A pyqtSignal emitted by instances of the class.

nameReplaced

A pyqtSignal emitted by instances of the class.

typeChanged

A pyqtSignal emitted by instances of the class.

typeReplaced

A pyqtSignal emitted by instances of the class.

valChanged

A pyqtSignal emitted by instances of the class.

valReplaced

A pyqtSignal emitted by instances of the class.

class schrodinger.application.models.datamodels.composite.ColumnInput(*args, _param_type=<object object>, **kwargs)

Bases: _BaseInput

column_id: str

A parameter of the class.

column_idChanged

A pyqtSignal emitted by instances of the class.

column_idReplaced

A pyqtSignal emitted by instances of the class.

nameChanged

A pyqtSignal emitted by instances of the class.

nameReplaced

A pyqtSignal emitted by instances of the class.

typeChanged

A pyqtSignal emitted by instances of the class.

typeReplaced

A pyqtSignal emitted by instances of the class.

class schrodinger.application.models.datamodels.composite.Output(*args, _param_type=<object object>, **kwargs)

Bases: CompoundParam

Represents an output definition for model execution.

Variables:
  • name – The output name

  • type – The output type (from OutputType enum)

name: str

A parameter of the class.

type: OutputType

A parameter of the class.

convertToValueString(value, row_source_id=None)
nameChanged

A pyqtSignal emitted by instances of the class.

nameReplaced

A pyqtSignal emitted by instances of the class.

typeChanged

A pyqtSignal emitted by instances of the class.

typeReplaced

A pyqtSignal emitted by instances of the class.

class schrodinger.application.models.datamodels.composite.CompositeModel(*args, _param_type=<object object>, **kwargs)

Bases: CompoundParam

A composite model combining a model definition with configuration values.

This class provides a complete view of a model ready for execution, including the logic to run, input values, and output definitions.

Variables:
  • inputs – Non-column input values mapped by name

  • col_inputs – Column input definitions mapped by name

  • col_outputs – Column output definitions mapped by name

  • logic – The logic/code to execute

inputs: dict[str, CompositeInput]

A parameter of the class.

col_inputs: dict[str, ColumnInput]

A parameter of the class.

col_outputs: dict[str, Output]

A parameter of the class.

logic: Logic

A parameter of the class.

__init__(*args, **kwargs)
row_source

This class can be used to declare a public attribute on a CompoundParam. Declared public attributes can be used without error.

Example usage:

class Coord(CompoundParam):
    x: int
    y: int
    note = NonParamAttribute()

coord = Coord()
coord.note = "hello" # No error
row_sink

This class can be used to declare a public attribute on a CompoundParam. Declared public attributes can be used without error.

Example usage:

class Coord(CompoundParam):
    x: int
    y: int
    note = NonParamAttribute()

coord = Coord()
coord.note = "hello" # No error
initConcrete(model_def: ModelDefinition = None, model_config: ModelConfiguration = None, model_config_chain: list[ModelConfiguration] = None, **kwargs)

Initialize the composite model with model definition and configuration data from constructor kwargs.

Parameters:
  • model_def – The model definition

  • model_config – The model.config

  • model_config_chain – The full inheritance chain from oldest to youngest (optional, will be computed if model_config is provided)

makeChangedInputConfigs(other: Self) list[InputConfig]

Return a list of input configurations from this composite model that differ between this and another compatible model.

getConfigurationId() str | None

Return the configuration ID of the most recent model.config in the chain.

getConfigurationVersion() int | None

Return the version of the most recent model.config in the chain.

col_inputsChanged

A pyqtSignal emitted by instances of the class.

col_inputsReplaced

A pyqtSignal emitted by instances of the class.

col_outputsChanged

A pyqtSignal emitted by instances of the class.

col_outputsReplaced

A pyqtSignal emitted by instances of the class.

inputsChanged

A pyqtSignal emitted by instances of the class.

inputsReplaced

A pyqtSignal emitted by instances of the class.

logicChanged

A pyqtSignal emitted by instances of the class.

logicReplaced

A pyqtSignal emitted by instances of the class.