syside.try_load_model

try_load_model(paths: Iterable[str | os.PathLike[Any]]) tuple[syside.Model, syside.Diagnostics]
try_load_model(paths: Iterable[str | os.PathLike[Any]], environment: syside.Environment) tuple[syside.Model, syside.Diagnostics]
try_load_model(*, sysml_source: str, kerml_source: str | None = ...) tuple[syside.Model, syside.Diagnostics]
try_load_model(*, kerml_source: str, sysml_source: str | None = ...) tuple[syside.Model, syside.Diagnostics]

Load a SysMLv2 model.

At least one of paths, sysml_source, and kerml_source must not be none.

Parameters:
  • paths – The paths to SysMLv2 or KerML files to load. These files must have correct file extensions (.sysml or .kerml).

  • environment – The environment to be used for the model. If this parameter is left to None, uses the default environment.

  • sysml_source – A SysMLv2 source to be loaded as an in-memory file.

  • kerml_source – A KerML source to be loaded as an in-memory file.

Returns:

Model and Diagnostics pair. Note that models may only be partial if parsing failed, however even a partial model may be of interest for analysis.