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

Environment Setup

Conda lockfiles, per-platform environments, dependency management, building installers

Contributing and Code Quality

Branching, commits, the DCO, review expectations, style and linting

Testing and QA

Test layout, pytest markers, the GUI test harness, what to write for a change

CI/CD and Releases

The pipeline, artifacts, versioning, release procedure

Design Documents

How and when to write one before a large change

Code signing is platform-specific: macOS · Windows.


Architecture#

Read these before changing anything that crosses subsystem boundaries.

Page

Covers

System Design

The overall shape of the application: processes, threads, the task system, storage

Application State

ApplicationState — datasets, ROIs, spectra, stretches, and the signals that tie them together

Data Caching

How raster data is held in memory and on disk

Plugin System

How plugins are discovered, loaded and dispatched

Plugin Dependencies

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

Viewport System

Panes, scroll and zoom state, how the views stay in step

Rendering Pipeline

Band data to pixels: normalization, conditioners, stretches, colormaps

Stretch Builder

The contrast-stretch dialog and the stretch classes behind it

Band Chooser

Band selection and colormap handling

Spectrum Plot

The plot widget, spectrum sources, collection and display

Band Math Internals

Grammar, parser, analyzer, evaluator, chunking and batch jobs

Raster Format Dispatch

How a file is matched to a loader, and how new formats are added

Georeferencer Internals

GCPs, transform fitting, residuals, warping

CRS Creator Internals

Building and validating custom coordinate reference systems

Mosaic Internals

Ingestion, tiling, compositing, materialisation, export

Save to Project

The .wiserproj format, the save plan, and self-contained bundles

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.