Install and run your first model¶
Install from this checkout¶
Python 3.10 or newer is required by the SDK and engine. From the repository root:
python -m venv .venv
# Activate .venv using your shell, then:
python -m pip install ./python_api
# Optional local modeling and simulation:
python -m pip install .
The sysml-studio-client distribution name is provisional and this version
has not been published to PyPI. Install this checkout during development.
The optional modeling extra assumes a compatible published core package;
installing . explicitly selects the engine implemented here.
Connect to Studio¶
Create an API key in the application’s supported account UI, then set
SYSML_STUDIO_API_KEY in your environment. Keys, scopes and entitlements are
checked by the server. Use https://api.dimmara.com without an /api suffix.
Remote URLs require verified HTTPS; loopback development URLs can use HTTP.
The following example creates a saved model and submits real remote work:
from sysml_studio import Client
source = """package Example {
part counter {
attribute value = 0;
attribute rate = 2;
action increment { assign value := value + rate; }
}
}"""
with Client("https://api.dimmara.com") as studio:
access = studio.check_access()
model = studio.submit_model("Counter", source)
checked = studio.validate_execution(model.id, version=model.version)
if not checked.result["valid"]:
raise ValueError(checked.result["diagnostics"])
job = studio.simulate(model.id, version=model.version,
end_time=5, step_size=1)
result = studio.results(job.id)
print(result["columns"])
print(result["rows"][-1])
Model.version is the revision you inspected. Passing it when creating a job
prevents a concurrent save from changing the root revision used for that job.
Creating/saving source alone does not validate it.
Validation choices¶
Operation |
What it checks |
|---|---|
|
Executable grammar, scopes, types, units, inputs and connections. Inspect
the returned report’s |
|
Syntax and semantic checks using the server’s pinned reference compiler. This does not establish executable support for every accepted construct. |
|
Reference check of the local complete source bundle; requires local Java, compiler JAR and matching SysML library. |
Typed Python is parsed without executing the supplied source. It must pass scope/profile and reference checks before use. Arbitrary imports, functions and callbacks outside the translatable subset are unsupported. For local typed Python, see Local engine reference; remote-only workflows need no local Java.
Next steps¶
Linked models, jobs and results: revisions, dependency pins, inputs, jobs and downloads.
Executable local examples: executable examples without an account or server.
Client API reference: every exported SDK class and public method.