Developer Guide#
Everything needed to build, test, extend and understand WISER.
If you want to add functionality without modifying WISER, you probably want Extending WISER instead — the plugin API adds Tools-menu actions, context-menu operations and band-math functions with no rebuild.
Start here#
Page |
Covers |
|---|---|
Conda lockfiles, per-platform environments, dependency management, building installers |
|
Branching, commits, the DCO, review expectations, style and linting |
|
Test layout, pytest markers, the GUI test harness, what to write for a change |
|
The pipeline, artifacts, versioning, release procedure |
|
How and when to write one before a large change |
Architecture#
Read these before changing anything that crosses subsystem boundaries.
Page |
Covers |
|---|---|
The overall shape of the application: processes, threads, the task system, storage |
|
|
|
How raster data is held in memory and on disk |
|
How plugins are discovered, loaded and dispatched |
|
How a plugin’s third-party dependencies are resolved at runtime |
Subsystem internals#
One page per subsystem: the classes involved, the signals they exchange, and which component owns what.
Page |
Covers |
|---|---|
Panes, scroll and zoom state, how the views stay in step |
|
Band data to pixels: normalization, conditioners, stretches, colormaps |
|
The contrast-stretch dialog and the stretch classes behind it |
|
Band selection and colormap handling |
|
The plot widget, spectrum sources, collection and display |
|
Grammar, parser, analyzer, evaluator, chunking and batch jobs |
|
How a file is matched to a loader, and how new formats are added |
|
GCPs, transform fitting, residuals, warping |
|
Building and validating custom coordinate reference systems |
|
Ingestion, tiling, compositing, materialisation, export |
|
The |
Code Documentation describes the conventions these pages follow.
Regenerating the tutorial screenshots#
Every figure in the tutorials is produced by a script that drives the real application, so the images cannot drift away from the UI:
# make sure the generated Qt modules exist
make -C src/wiser/gui && make -C src generated
# list the scenes
python doc/sphinx-general-wiser-docs/tools/make_tutorial_figures.py --list
# re-shoot one, or all of them
python doc/sphinx-general-wiser-docs/tools/make_tutorial_figures.py --only first_look
python doc/sphinx-general-wiser-docs/tools/make_tutorial_figures.py
# headless Linux
xvfb-run -a python doc/sphinx-general-wiser-docs/tools/make_tutorial_figures.py
Each figure comes from a scene — a function that opens the same data the tutorial uses, drives the same dialogs, and grabs the widget it is describing. When you change a dialog, re-run its scene and commit the new PNG with the code change. Adding a figure means adding or extending a scene, not hand-capturing a screenshot.
Two traps the harness works around
WiserTestModel.run() ends in QApplication.quit(), which in Qt 6 closes
every top-level window — including result windows a task has just opened, such
as the PCA scree plot, and modeless dialogs created with WA_DeleteOnClose.
The harness provides soft_pump() for use while such a window is on screen,
and swaps in a plain QMainWindow.closeEvent so AppServices survives the
loop.
MainView opens the Savitzky–Golay and smoothing dialogs with exec_(), which
blocks a script; the filters scene builds the same dialogs directly instead.
Offscreen, a scroll area never gets the resize event that would refresh its
scrollbar ranges after the image is rescaled, so frame_region() sets the
range from the pixmap itself before scrolling. It also runs from inside
shot(..., frame=BOX), after a throwaway grab(): the first grab of a scene
is what makes the dock panes claim their space, and framing before that measures
the wrong viewport.
Building the documentation#
cd doc/sphinx-general-wiser-docs
pip install -r requirements.txt
make html # output in build/html
The build should be warning-free apart from autodoc2.dup_item notices. Treat
a new warning as a broken link.