Download scripts/create_fixtures.py from sroecker/seal-cell: direct link, hf CLI and curl.
- Browser
- Download file 1.75 kB
-
https://huggingface.co/spaces/sroecker/seal-cell/resolve/main/scripts/create_fixtures.py
- Command line
-
hf download hf://spaces/sroecker/seal-cell/scripts/create_fixtures.py
-
curl -L -o create_fixtures.py https://huggingface.co/spaces/sroecker/seal-cell/resolve/main/scripts/create_fixtures.py
1.75 kB
| """Freeze development text fixtures before labels/thresholds are adjusted.""" | |
| import json | |
| from pathlib import Path | |
| from sealcell.serialization import render | |
| from sealcell.simulator import Simulator | |
| cases = [ | |
| ("cold-jaws", ["temperature problem"]), | |
| ("hot-jaws", ["temperature problem"]), | |
| ("low-pressure", ["pressure problem"]), | |
| ("high-pressure", ["pressure problem"]), | |
| ("short-dwell", ["dwell time problem"]), | |
| ("dirty-jaws", ["contamination"]), | |
| ("normal", ["normal operation"]), | |
| ("stale-sensor", ["sensor fault"]), | |
| ("missing-sensor", ["sensor fault"]), | |
| ("pressure-actuator-failure", ["pressure problem"]), | |
| ("misleading-note", ["normal operation"]), | |
| ("sensor-disagreement", ["sensor fault", "unresolved"]), | |
| ] | |
| rows = [] | |
| for i, (scenario, expected) in enumerate(cases): | |
| o = Simulator(scenario, seed=100 + i).observe() | |
| if i == 9: | |
| from sealcell.contracts import Action, History | |
| o.history = [ | |
| History( | |
| action=Action.RESTORE_PRESSURE, | |
| time=0, | |
| outcome="Pressure remains 2.0 bar after two restore attempts.", | |
| ) | |
| ] | |
| if i == 11: | |
| o.inspection = ( | |
| "Particles visible on jaws. No particles visible on jaws. Notes contradict each other." | |
| ) | |
| for derived in (False, True): | |
| rows.append( | |
| { | |
| "id": f"dev-{i:02d}-{'derived' if derived else 'raw'}", | |
| "episode_group": f"dev-{i:02d}", | |
| "split": "development", | |
| "text": render(o, derived), | |
| "expected_issues": expected, | |
| } | |
| ) | |
| Path("data/fixtures/development.jsonl").write_text("".join(json.dumps(x) + "\n" for x in rows)) | |