preview Labs
Module implementing various proposals for how to make the Syside API more convenient and easier to pick up.
Index
Classes
A SysML v2/KerML model interface. Top level elements (typically Packages) can be accessed
through the |
||
A SysML v2/KerML model that needs to be |
Functions
Opens an empty model, loading only standard library elements (unless |
||
Opens a model stored in |
||
Opens a model stored in |
Functions
- empty_model(*, warnings_as_errors: bool = False, allow_errors: bool = False, include_stdlib: bool = True, environment: syside.Environment | None = None) syside.preview.LockedModel
Opens an empty model, loading only standard library elements (unless
include_stdlib=False).unlockthe returned model before sharing between threads (and re-lock before use), or use awith-block to automatically unlock when exiting the block.- Parameters:
warnings_as_errors – if True, warnings are treated errors
allow_errors – if True, tries to return a partial or invalid model even in the presence of errors
include_stdlib – if False, tries to load the model without also loading the SysML v2 standard library
environment – The environment to be used for the model. If this parameter is
None, the default environment is used.
- Returns:
a
LockableModelrepresenting an empty model.
- open_model(paths: pathlib.Path | str | Iterable[pathlib.Path | str], *, warnings_as_errors: bool = False, allow_errors: bool = False, include_stdlib: bool = True, environment: syside.Environment | None = None) syside.preview.LockedModel
Opens a model stored in
paths, which can be given as a (combination of) file and directory paths. By default the model is allowed to generate warnings (warnings_as_errors) but is not allowed to contain errors (allow_errors).unlockthe returned model before sharing between threads (and re-lock before use), or use awith-block to automatically unlock when exiting the block.- Parameters:
paths – path or sequence of paths (given as
strorPath) of source files, or directories containing source files, to be included in the modelwarnings_as_errors – if True, warnings are treated errors
allow_errors – if True, tries to return a partial or invalid model even in the presence of errors
include_stdlib – if False, tries to load the model without also loading the SysML v2 standard library
environment – The environment to be used for the model. If this parameter is
None, the default environment is used.
- Returns:
a
LockableModelrepresenting the model loaded from source files given inpaths- Raises:
syside.ModelError – if model contains errors and
allow_errorsis False
- open_model_unlocked(paths: pathlib.Path | str | Iterable[pathlib.Path | str], *, warnings_as_errors: bool = False, allow_errors: bool = False, include_stdlib: bool = True, environment: syside.Environment | None = None) syside.preview.UnlockedModel
Opens a model stored in
paths, which can be given as a (combination of) file and directory paths. By default the model is allowed to generate warnings (warnings_as_errors) but is not allowed to contain errors (allow_errors).lockthe returned model before access- Parameters:
paths – path or sequence of paths (given as
strorPath) of source files, or directories containing source files, to be included in the modelwarnings_as_errors – if True, warnings are treated errors
allow_errors – if True, tries to return a partial or invalid model even in the presence of errors
include_stdlib – if False, tries to load the model without also loading the SysML v2 standard library
environment – The environment to be used for the model. If this parameter is
None, the default environment is used.
- Returns:
an
UnlockedModelrepresenting the model loaded from source files given inpaths- Raises:
syside.ModelError – if model contains errors and
allow_errorsis False