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:
_BaseInputThe 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
pyqtSignalemitted by instances of the class.
- child_inheritance_modeReplaced¶
A
pyqtSignalemitted by instances of the class.
- nameChanged¶
A
pyqtSignalemitted by instances of the class.
- nameReplaced¶
A
pyqtSignalemitted by instances of the class.
- typeChanged¶
A
pyqtSignalemitted by instances of the class.
- typeReplaced¶
A
pyqtSignalemitted by instances of the class.
- valChanged¶
A
pyqtSignalemitted by instances of the class.
- valReplaced¶
A
pyqtSignalemitted 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
pyqtSignalemitted by instances of the class.
- column_idReplaced¶
A
pyqtSignalemitted by instances of the class.
- nameChanged¶
A
pyqtSignalemitted by instances of the class.
- nameReplaced¶
A
pyqtSignalemitted by instances of the class.
- typeChanged¶
A
pyqtSignalemitted by instances of the class.
- typeReplaced¶
A
pyqtSignalemitted by instances of the class.
- class schrodinger.application.models.datamodels.composite.Output(*args, _param_type=<object object>, **kwargs)¶
Bases:
CompoundParamRepresents 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
pyqtSignalemitted by instances of the class.
- nameReplaced¶
A
pyqtSignalemitted by instances of the class.
- typeChanged¶
A
pyqtSignalemitted by instances of the class.
- typeReplaced¶
A
pyqtSignalemitted by instances of the class.
- class schrodinger.application.models.datamodels.composite.CompositeModel(*args, _param_type=<object object>, **kwargs)¶
Bases:
CompoundParamA 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.
- __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_configis 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
pyqtSignalemitted by instances of the class.
- col_inputsReplaced¶
A
pyqtSignalemitted by instances of the class.
- col_outputsChanged¶
A
pyqtSignalemitted by instances of the class.
- col_outputsReplaced¶
A
pyqtSignalemitted by instances of the class.
- inputsChanged¶
A
pyqtSignalemitted by instances of the class.
- inputsReplaced¶
A
pyqtSignalemitted by instances of the class.
- logicChanged¶
A
pyqtSignalemitted by instances of the class.
- logicReplaced¶
A
pyqtSignalemitted by instances of the class.