schrodinger.application.models.datamodels.factories module

Factory functions for creating ModelDefinition and ModelConfiguration instances.

These functions handle the orchestration of wiring new objects into a hierarchy, while the data classes themselves remain simple data holders.

schrodinger.application.models.datamodels.factories.make_config(parent: ModelInterface, source_config: ModelConfiguration | None = None) ModelConfiguration

Create a new ModelConfiguration as a child of the given parent.

Parameters:
  • parent – The parent model (definition for root configs, config for child/sibling configs).

  • source_config – Optional config to copy values from.

Returns:

A new ModelConfiguration wired to the parent.

schrodinger.application.models.datamodels.factories.make_child_input_config(name: str, parent_constraint: ChildConstraint = ChildConstraint.OVERRIDABLE) InputConfig

Create a new child InputConfig that inherits from its parent.

Parameters:
  • name – The name of the input.

  • parent_constraint – The constraint from the parent model.

Returns:

A new InputConfig with inherited value and parent’s constraint.

schrodinger.application.models.datamodels.factories.make_definition(source_def: ModelDefinition | None = None) ModelDefinition

Create a new ModelDefinition.

Parameters:

source_def – Optional definition to copy values from.

Returns:

A new ModelDefinition.