Environment
- class Environment
Standard library environment for use with user models.
Members defined in
Environment(4 members)
RWConstruct the environment from the given documents.
RWConstruct the environment from the given stdlib files.
RWGet a default constructed standard library environment. This will only be executed on the first call, and any subsequent calls will return a cached value. Standard library environment is cached based on the assumption that it WILL NOT change during runtime, saving resources when loading other models.
Returns a copy of the environment index for use in dependent models. A copy is required so that dependent models do not affect this environment and other dependent models.
Attributes
- classmethod from_documents(documents: Iterable[syside.SharedMutex[syside.Document]], index: syside.StaticIndex | None = None) syside.Environment
Construct the environment from the given documents.
- Parameters:
documents – The documents from which to construct the SysMLv2 environment.
index – The index to be used in models. If
None, creates a new index. If notNone, clones the index to avoid mutating the argument.
- classmethod from_stdlib_files(stdlib_files: list[pathlib.Path]) syside.Environment
Construct the environment from the given stdlib files.
- Parameters:
stdlib_files – The paths to SysMLv2 or KerML files representing the stdlib. These files must have correct file extensions (
.sysmlor.kerml).
- classmethod get_default() syside.Environment
Get a default constructed standard library environment. This will only be executed on the first call, and any subsequent calls will return a cached value. Standard library environment is cached based on the assumption that it WILL NOT change during runtime, saving resources when loading other models.
Methods
- index() syside.StaticIndex
Returns a copy of the environment index for use in dependent models. A copy is required so that dependent models do not affect this environment and other dependent models.