A toolkit to load, validate, visualize, create, and update Water Valve Calibrations and Spotchecks used in VR foraging rigs.
- Display rig schemas, calibrations, and spotchecks
- Validate calibrations (regression, consistency, aging, bounds)
- Create and save manual calibrations entries
- Create and save spotcheck entries
- Update rig schema JSON from any WaterCal file
src/
│
├─ cascada.py # Streamlit entrypoint
│
├─ config.py # Default paths and constants
│
├── models
│ ├── watercal_model.py # Calibration model validation and regression logic
│ ├── watercal_dataset.py # Calibration dataset loader and record indexing
│ └── spotcheck_model.py # Spotcheck models and loader
│
├── services/
│ ├── cache.py # Streamlit caching helpers
│ ├── dataset_loader.py # Wrappers for loading datasets
│ └── plotting.py # Matplotlib → PNG conversion
│
├─ ui/
│ ├─ filters.py # Filters
│ └─ blocks.py # Streamlit expanders
│
├─ subpages/ # Streamlit pages
│ ├─ rig_dashboard.py
│ ├─ watercal_dashboard.py
│ ├─ spotcheck_dashboard.py
│ ├─ new_spotcheck.py
│ └─ manual_calibration.py
│
├─ PyGUI.py # Terminal interface
│
└─ extras/ # Other scripts
*/water_calibration.json (Contains the measurements and regression)
*/behavior/logs/rig_input.json (Contains rig info)
*/water_calibration.json (Contains the measurements and regression)
*/rig_info.json (Contains rig info)
*/[computer_name]/**.json (Contains both the rig info and the water calibration data):
- JSON load & structure
- repeat_count ≥ 21
- at least 2 measurement rows
- interval_average consistency
- positive and finite values
- regression recomputation and thresholds
- calibration age checks
- View calibrations inside rig schemas
- Show errors/warnings
- Plot regression & intervals
- Update a rig’s calibration block in-place preserving all other keys and creates a .bak backup
- Historical standalone calibrations
- Diagnostics + plots
- All rigs: Displays a table with data from the last calibration and spotchecks
- Single rig: KPIs, Ratio-to-target plot, Error % timeline plot
- Allows the user to select a rig and schema to auto‑compute repeat count & valve time, and then enter delivered mass
- OK/Strike/Fail shown visually
- Save spotcheck JSON
- Enter new measurements
- Shows diagnostics + regression plot
- Save the results in calibration folder