mnoorchenar commited on
Commit
da5759b
·
verified ·
1 Parent(s): dd394fe

Fix Chart 500, new demo GIF

Browse files
Files changed (4) hide show
  1. README.md +2 -2
  2. docs/demo.gif +2 -2
  3. statagent/tools.py +3 -1
  4. 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 | 15 |
36
  |:---:|:---:|:---:|:---:|
37
- | cited regulatory and PubMed passages | retrieval hit@5 on the eval set | statistical checks passing | automated tests (9 R, 6 Python) |
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

  • SHA256: 9e61a818828eaf35c59fe7153c2f2b091ab7c092b1826acf18ce12fb70bfc1e1
  • Pointer size: 131 Bytes
  • Size of remote file: 455 kB

Git LFS Details

  • SHA256: c82e414cd53f63e36055d168dfb7284da9c3a09d842e13cd2500980c37bfde1a
  • Pointer size: 131 Bytes
  • Size of remote file: 464 kB
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); return {"x": df.iloc[:, 0].tolist(), "y": df[column].tolist()}
 
 
 
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"])