This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
SciQLopPlots is a high-performance scientific plotting library for the SciQLop platform. It's a C++20/Qt6 library with Python bindings generated via Shiboken6 (PySide6's binding generator). Built on top of QCustomPlot (via a fork called NeoQCP).
Uses Meson with meson-python as the Python build backend.
STOP — do not run a bare
meson setup build/meson compile -C build. Qt is not on the default PATH and the stale top-levelbuild/dir will trigger a doomed reconfigure. Use the dedicated in-tree venv +build-venvrecipe below. Never build against (orcp .sointo) the SciQLop runtime venv during dev.
# One-time: dedicated in-tree venv (Qt/PySide6 6.11.1, meson pinned to 1.10.2)
cd /var/home/jeandet/Documents/prog/SciQLopPlots
uv venv .venv --python 3.13
VIRTUAL_ENV=$(pwd)/.venv uv pip install \
pyside6==6.11.1 shiboken6==6.11.1 shiboken6-generator==6.11.1 \
numpy meson==1.10.2 ninja meson-python pytest pytest-qt scipy
# Every build: Qt MUST be on PATH (6.11.1 first, 6.11.0 after it for `qsb`)
VENV=$(pwd)/.venv
export PATH="$VENV/bin:/home/jeandet/Qt/6.11.1/gcc_64/bin:/home/jeandet/Qt/6.11.0/gcc_64/bin:$PATH"
export PKG_CONFIG_PATH="/home/jeandet/Qt/6.11.1/gcc_64/lib/pkgconfig:$PKG_CONFIG_PATH"
$VENV/bin/meson setup build-venv --buildtype=debugoptimized # first time only
$VENV/bin/meson compile -C build-venv
# Run tests from /tmp so the source pkg doesn't shadow the build (no LD_LIBRARY_PATH!)
cd /tmp && PYTHONPATH=<PROJ>/build-venv $VENV/bin/python -m pytest <PROJ>/tests/integration -qAlways --buildtype=debugoptimized (never plain debug: -O0 makes CPU code unusably slow).
After switching branches, a stale shiboken wrapper can fail to regenerate — rm the
offending build-venv/SciQLopPlots/bindings/.../**_wrapper.cpp and meson setup --reconfigure build-venv to force a clean regen.
pip install . # produces a wheel; NOT for iterative devFor iterative development use the build-venv recipe above and cp build-venv/SciQLopPlots/*.so build-venv/SciQLopPlots/*.py into the target venv — never pip install -e . (it disturbs the venv).
| Option | Type | Default | Description |
|---|---|---|---|
trace_refcount |
bool | false | Enable reference count tracing |
tracy_enable |
bool | false | Enable Tracy profiling |
with_opengl |
bool | true | Enable OpenGL support |
- Qt6 (Core, Widgets, Gui, Svg, PrintSupport, OpenGL)
- PySide6 == 6.11.0 and matching shiboken6/shiboken6_generator
- Python >= 3.10, < 3.15
- numpy
- OpenGL
- C++20 compiler
- NeoQCP: Fork of QCustomPlot - the core plotting engine
- cpp_utils: C++ utility library
- hedley: Compiler portability macros
- fmt: Formatting library
- magic_enum: Enum reflection
- tracy: Optional profiling (when
tracy_enable=true)
include/SciQLopPlots/- Public C++ headerssrc/- C++ implementation filesSciQLopPlots/- Python package (contains__init__.pyand binding infrastructure)SciQLopPlots/bindings/- Shiboken binding definitionsbindings.xml- Shiboken typesystem XML (defines what gets exposed to Python)bindings.h- Master include for bindings generationhelper_scripts/- Shiboken/build helper scripts
tests/manual-tests/- Python-based example/test scripts (run viameson test)
Plot hierarchy (include/SciQLopPlots/):
SciQLopPlotInterface(QFrame base) ->SciQLopPlot->SciQLopTimeSeriesPlot,SciQLopNDProjectionPlot
Plotables (include/SciQLopPlots/Plotables/):
SciQLopGraphInterface->SciQLopGraphComponent(individual trace)- Concrete types:
SciQLopLineGraph,SciQLopCurve,SciQLopColorMap,SciQLopNDProjectionCurves - Each plotable has a corresponding Resampler (
Resamplers/) that runs in a worker thread for downsampling large datasets
Multi-plot containers (include/SciQLopPlots/MultiPlots/):
SciQLopMultiPlotPanel- panel containing multiple vertically stacked plotsSciQLopPlotCollection,SciQLopPlotContainer- layout managementAxisSynchronizer,XAxisSynchronizer,TimeAxisSynchronizer- keep axes aligned across plotsVPlotsAlign- vertical alignment of plot margins
Items (include/SciQLopPlots/Items/): Overlay items like vertical spans, tracers, straight lines, shapes, text, pixmaps
Inspector (include/SciQLopPlots/Inspector/): Tree model/view for inspecting and editing plot properties at runtime
Products (include/SciQLopPlots/Products/): Tree model for browsable data products (drag-and-drop sources)
Python interface (include/SciQLopPlots/Python/): PythonInterface.hpp defines PyBuffer and GetDataPyCallable types for bridging numpy arrays and Python callbacks to C++
Runtime tracer (include/SciQLopPlots/Tracing.hpp + src/Tracing.cpp): always-compiled-in event logger that emits Chrome trace JSON (Perfetto / Speedscope / chrome://tracing). Toggle via tracing.enable("path.json") / disable() / flush() from C++ or Python (from SciQLopPlots import tracing), or auto-enable with the SCIQLOP_TRACE env var. ~1 ns when off (single relaxed atomic load + branch). Profiling.hpp's PROFILE_HERE_N feeds both this tracer and Tracy (when tracy_enable=true at build time) — instrument once, view in either tool.
bindings.xmldefines the typesystem for Shibokenshiboken-gen.py/shiboken-helper.pyinvoke shiboken6 to generate C++ wrapper code- The generated code is compiled into
SciQLopPlotsBindingsextension module SciQLopPlots/__init__.pyimports and patches the bindings (adds a unifiedplot()method to plot classes)
Version is tracked in meson.build and SciQLopPlots/__init__.py, managed via bumpversion (configured in setup.cfg).