schrodinger.application.models.datamodels.model_tree module

class schrodinger.application.models.datamodels.model_tree.ModelTree(definition: ModelDefinition, configs: list[ModelConfiguration])

Bases: object

Object that manages the relationships between a model definition and all of its configurations.

__init__(definition: ModelDefinition, configs: list[ModelConfiguration]) None
getOrderedConfigs() list[ModelConfiguration]

Return a flat list of configurations in display order for faketree

getDefinition() ModelDefinition

Return the model definition at the root of the tree.

getConfigDepth(config: ModelConfiguration) int

Return the depth of the given configuration in the tree. Top-level configs have depth 0.

getChildren(model: ModelInterface) list[ModelConfiguration]

Return a list of the immediate child configs of the given model object. No particular sort order is guaranteed.

getParent(model: ModelInterface) ModelInterface | None

Return the parent of the given model object, or None if it is the root.

getDescendants(model: ModelInterface) list[ModelConfiguration]

Return a list of all descendant configs of the given model object. No particular sort order is guaranteed.

buildComposite(model: ModelInterface) CompositeModel

Build a CompositeModel from a definition or configuration.

validate() ValidationSummary

Validate the entire model tree and return a summary of violations.