UnlockedModel

class UnlockedModel

Description

A SysML v2 and KerML model that needs to be locked before access.

Note that UnlockedModel is generally not intended to be instantiated directly. Ideally, use load_model_unlocked or LockedModel.unlock on a previously acquired LockedModel.

model : UnlockedModel = load_model_unlocked("file.sysml")

# Alternatively
locked_model : LockedModel = load_model("file.sysml")
...
model = locked_model.unlock()
Members defined in UnlockedModel (9 members)

all_documents

R

Documents as part of this model including the environment.

diagnostics

R

Diagnostics emitted while building this model.

documents

R

Documents as part of this model.

environment

R

The environment this model was built in.

index

R

Index of exported symbols.

lib

R

Standard library cache.

result

R

The model build result.

lock

Locks the model, allowing access to the contained documents.

to_environment

Convert this model to Environment for building other dependent models.

Attributes

property all_documents: Generator[syside.SharedMutex[syside.Document], None, None]

Documents as part of this model including the environment.

Environment documents are guaranteed to be after documents in this model.

property diagnostics: syside.Diagnostics

Diagnostics emitted while building this model.

property documents: list[T]

Documents as part of this model.

property environment: syside.Environment

The environment this model was built in.

property index: syside.StaticIndex

Index of exported symbols.

property lib: syside.Stdlib

Standard library cache.

property result: syside.ExecutionResult | None

The model build result.

Methods

lock(with_environment: bool = False) → syside.Model

Locks the model, allowing access to the contained documents.

Order of documents is preserved. Call unlock on the returned model once done, or use a with statement:

with unlocked_model.lock() as model:
    ...
Parameters:

with_environment – If true, the returned model will additionally lock all documents from the environment. Environment documents are guaranteed to be after documents in this model.

Returns:

A Model that gives access to all model documents and elements.

to_environment() → syside.Environment

Convert this model to Environment for building other dependent models.

The returned environment contains the union of documents from this model and its environment, in this order.