Fix Chart 500, new demo GIF
Browse files- README.md +2 -2
- docs/demo.gif +2 -2
- statagent/tools.py +3 -1
- tests/test_python.py +8 -0
README.md
CHANGED
|
@@ -32,9 +32,9 @@ Ask a plain-English question about experiment or manufacturing data. The agent r
|
|
| 32 |
|
| 33 |
</div>
|
| 34 |
|
| 35 |
-
| 125 | 8 / 8 | 4 / 4 |
|
| 36 |
|:---:|:---:|:---:|:---:|
|
| 37 |
-
| cited regulatory and PubMed passages | retrieval hit@5 on the eval set | statistical checks passing | automated tests (9 R,
|
| 38 |
|
| 39 |
## Features
|
| 40 |
|
|
|
|
| 32 |
|
| 33 |
</div>
|
| 34 |
|
| 35 |
+
| 125 | 8 / 8 | 4 / 4 | 16 |
|
| 36 |
|:---:|:---:|:---:|:---:|
|
| 37 |
+
| cited regulatory and PubMed passages | retrieval hit@5 on the eval set | statistical checks passing | automated tests (9 R, 7 Python) |
|
| 38 |
|
| 39 |
## Features
|
| 40 |
|
docs/demo.gif
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
statagent/tools.py
CHANGED
|
@@ -52,4 +52,6 @@ def power_calc(delta: float, sd: float, power: float = 0.8, alpha: float = 0.05)
|
|
| 52 |
|
| 53 |
def series(dataset, column):
|
| 54 |
"""Raw series for plotting."""
|
| 55 |
-
df = load(dataset)
|
|
|
|
|
|
|
|
|
| 52 |
|
| 53 |
def series(dataset, column):
|
| 54 |
"""Raw series for plotting."""
|
| 55 |
+
df = load(dataset)
|
| 56 |
+
# JSON has no NaN: missing readings (SECOM has some) become null, which the UI plots as gaps
|
| 57 |
+
return {"x": df.iloc[:, 0].tolist(), "y": [None if v != v else v for v in df[column].tolist()]}
|
tests/test_python.py
CHANGED
|
@@ -21,3 +21,11 @@ def test_human_gate(tmp_path, monkeypatch):
|
|
| 21 |
assert audit.proposals("pending")[0]["id"] == pid # created pending, nothing executed
|
| 22 |
audit.decide(pid, True)
|
| 23 |
assert audit.proposals("approved") and any(e["event"] == "proposal_approved" for e in audit.entries())
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 21 |
assert audit.proposals("pending")[0]["id"] == pid # created pending, nothing executed
|
| 22 |
audit.decide(pid, True)
|
| 23 |
assert audit.proposals("approved") and any(e["event"] == "proposal_approved" for e in audit.entries())
|
| 24 |
+
|
| 25 |
+
|
| 26 |
+
def test_series_is_json_safe():
|
| 27 |
+
import json
|
| 28 |
+
from statagent import tools
|
| 29 |
+
out = tools.series("secom", "sensor_542")
|
| 30 |
+
json.dumps(out, allow_nan=False) # raises on NaN, which made /series return HTTP 500
|
| 31 |
+
assert any(v is None for v in out["y"])
|