Simulate json or beb model from the command line

This commit is contained in:
2026-07-24 16:30:31 +02:00
parent b09caa3475
commit 46b8dd8263
6 changed files with 328 additions and 41 deletions

View File

@@ -0,0 +1,29 @@
from __future__ import annotations
import matplotlib
import pytest
from bedit_simulation import SimulationResult
from bedit_util.simulate import create_results_figure
matplotlib.use("Agg")
@pytest.mark.unit
def test_creates_result_figure_with_trace_controls() -> None:
import matplotlib.pyplot as plt
result = SimulationResult(
model_name="Example",
data={
"time": [0.0, 1.0],
"x": [1.0, 2.0],
"y": [3.0, 4.0],
},
)
figure = create_results_figure(result)
assert {line.get_label() for line in figure.axes[0].lines} == {"x", "y"}
assert len(figure._bedit_widgets) == 3 # type: ignore[attr-defined]
plt.close(figure)