Metadata-Version: 2.5
Name: cubievis
Version: 0.0.1
Summary: Data visualisation and integrator GUI for Cubie
Project-URL: Homepage, https://github.com/cubiepy/cubievis
Project-URL: Issues, https://github.com/cubiepy/cubievis/issues
Author: Chris Cameron
License-Expression: MIT
License-File: LICENSE
Requires-Python: >=3.11
Requires-Dist: attrs
Requires-Dist: cubie>=0.15.1
Requires-Dist: fastplotlib>=0.7
Requires-Dist: numba
Requires-Dist: numpy>=2.0
Requires-Dist: pyqt6
Requires-Dist: qtpy
Provides-Extra: test
Requires-Dist: pytest; extra == 'test'
Requires-Dist: pytest-qt; extra == 'test'
Description-Content-Type: text/markdown

# CubieVis

Qt GUI for [cubie](https://github.com/ccam80/cubie): define a system, pick an integrator, enter a batch, solve, view the traces.

## Install and run

```
uv venv; uv pip install -e .[test]
.venv/Scripts/python -m cubievis
```

`cubie[cuda12]`/`cubie[cuda13]` adds a CUDA toolkit when the machine has none.

Worktrees share the main checkout's `.venv`: `python tools/worktree_setup.py` (run by orca through `orca.yaml`) layers a `.venv` that imports the worktree's `src`.

## Using it

1. **Add system…**: equations (`dx = ...`), a Python `f(t, y, p)`, or a `.txt`/`.py`/`.cellml` file; **Parse** fills the category tables (CellML shows its parsed equations); **Edit system…** reopens the current one; **Make constant**/**Make parameter** move selected rows, here and on the main window's tables.
2. Enter **y0** and **parameters** as numbers, lists or numpy expressions; pick grid type, variables to save/summarise (**All**/**None**), their cadences, and summary metrics (`peaks` takes `n` in its second column).
3. Pick an **integrator** (type to search) by **Go**; step sizes and tolerances sit beside it, **All settings…** holds the rest; a row passes only when its checkbox is set.
4. Set timing, directory and results folder; the label by **Go** estimates runs and disk size; the log shows phase, elapsed time, then the result path. **Set y0 from run** copies a run's final state into y0.
5. The viewer opens the batch; summaries are a second dataset in it. X, Y, Z and Sweep each take time, a swept input, or a variable or its first or second time derivative, with log/lin (log by default for log-spaced inputs) and limits. Y (holding time or an input) cycles axis/collapse/animate; Sweep cycles collapse/animate. **Lines/Surface** switches the drawing; inputs on no axis get sliders; zooming time in 2D reloads that span at finer resolution; hovering names the run. Older `dataset.json` batches are converted to a store when opened.
6. **File → Save/Load session…** keeps systems, inputs and settings in a JSON file.

## Layout

| Module | Role |
|---|---|
| `schema.py` | Solver settings read from cubie's attrs classes: names, kinds, choices, defaults, applicability per algorithm and controller. |
| `systems.py` | Build a `SymbolicODE` from a `SystemSpec` (equations, Python source, CellML); category tables. |
| `inputs.py` | Values text and data files to arrays; `DriverSamples`; final states from a saved batch. |
| `estimate.py` | Run count and on-disk size estimates shown beside Go. |
| `session_store.py` | Session save/load as JSON. |
| `jobs.py` | The one worker thread for cubie calls; phase and elapsed time from `default_timelogger.events`. |
| `run.py` | Go: `build_grid`, `solve`, write the store. |
| `store.py` | Batch store: raw (run, time) traces per variable plus min/max pyramids of the values and their first two time derivatives; windowed line queries; `dataset.json` import. |
| `view_model.py` | Axis choices to lines, frames, colours, world coordinates and ticks. |
| `session.py` | Built systems, the current solver, the worker. |
| `widgets/` | One Qt module per pane; no cubie calls outside the worker. The viewer pane draws with fastplotlib. |

## Tests

```
NUMBA_ENABLE_CUDASIM=1 .venv/Scripts/python -m pytest --ignore=tests/gui/test_main_window.py --ignore=tests/gui/test_viewer_pane.py
.venv/Scripts/python -m pytest tests/gui/test_main_window.py tests/gui/test_viewer_pane.py tests/test_run.py   # GPU, needs a display
.venv/Scripts/python bench/speed_check.py store|render <batch>     # store build and raw render timings
.venv/Scripts/python bench/viewer_check.py <batch> <store>         # each viewer mode
```

## AI slop warning

Any AI input into Cubie is reviewed line-by-line, so it is largely slop-free and the poor design choices are all human-made. This GUI did not get the same degree of human care - if it steers cubie, is usable, and looks ok, then it is clean enough. The code is therefore an AI wasteland - it will get cleaned up when it starts to fight development, not before, so read it at your peril.
