McSAS3GUI is the desktop application for McSAS3. It guides you through loading SAXS/SANS data, previewing a model fit, running the Monte Carlo optimization, and turning the result into histograms.
If you are unfamiliar with Python environments, start with one of the two paths below. The rest of this README is mostly for people who want to script, customize, or build McSAS3GUI themselves.
For prebuilt standalone binaries, see the latest GitHub release:
Release assets are built for tagged releases. This is the easiest path when a release is available for your operating system.
If uv is installed, run:
uvx --python 3.14 --from mcsas3gui m3guiThe first run may take a few minutes. uvx creates an isolated Python
environment, installs McSAS3GUI and McSAS3, and then starts the m3gui
application. You do not need to create or activate a virtual environment.
If uv is not installed yet:
curl -LsSf https://astral.sh/uv/install.sh | shOn Windows PowerShell:
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"After installing uv, close and reopen the terminal if the uvx command is not
found.
For regular use from the terminal, install the GUI command once:
uv tool install --python 3.14 mcsas3gui
m3gui- Open the Getting Started tab.
- Choose Quick Start demo from the template list.
- Use the loaded example settings to preview the data and model.
- Run the optimization.
- Run histogramming to create the distribution plot.
The optimization produces an HDF5 result file. Histogramming adds distribution results to that file and writes a PDF plot next to it.
- Getting Started loads complete example workflows.
- Data Loading tells McSAS3 how to read your data file.
- Run Settings sets the scattering model and optimization limits.
- McSAS3 Optimization runs one or more optimizations.
- Histogram Settings defines the distributions to calculate.
- (Re-)Histogramming recalculates histograms from existing optimization results, without rerunning the optimization.
Both optimization buttons are abortable. While running, they change to
Running... Click to abort. and forward a stop request to the core McSAS3
runner.
McSAS3GUI requires Python 3.12 or newer. The examples in this README use Python 3.14, the current recommended runtime.
Install the released GUI package with pip:
pip install mcsas3guiIf you prefer a manually managed uv environment:
uv venv --python 3.14
source .venv/bin/activate
uv pip install mcsas3gui
m3guiOn Windows, activate the environment with .venv\Scripts\activate instead of
source.
You can also install the in-development version with pip:
pip install git+https://github.com/BAMresearch/mcsas3gui.git@mainor, from a local source checkout with uv:
uv venv --python 3.14
source .venv/bin/activate
uv pip install ../McSAS3 .
mcsas3gui --versionRun the local source command from the McSAS3GUI repository with the McSAS3
repository checked out next to it.
After activating an environment, these launch commands all work:
mcsas3gui
m3gui
python -m mcsas3guiA standalone build path is available for local packaging and CI:
tox -e standaloneThis produces a platform-specific standalone bundle under dist/standalone/, including the
windowed McSAS3GUI app and the bundled mcsas3-histogrammer helper used by the histogramming
tabs.
Linux standalone release artifacts are built in a manylinux_2_34 container so the produced
bundle stays compatible with systems that provide GLIBC 2.34 or newer. Local Linux builds need the
Qt xcb runtime packages listed in ci/requirements_linux.txt.
Standalone release assets are produced by the GitHub Actions workflow in
.github/workflows/standalone-release.yml.
The release workflow:
- checks out both
McSAS3GUIandMcSAS3 - runs
tox -e standaloneon Linux, macOS, and Windows, with Linux built from a GLIBC 2.34 baseline - signs the macOS
.appbundle with a Developer ID certificate - notarizes and staples the macOS bundle with
notarytoolandstapler - uploads the platform zip archives to the GitHub release
For local development builds, tox -e standalone produces the same bundle layout, but notarization
only happens in the release workflow because it requires GitHub secrets and Apple credentials.
The macOS release build requires these GitHub Actions secrets:
MACOS_CERT_P12_BASE64MACOS_CERT_P12_PASSWORDMACOS_CODESIGN_IDENTITYMACOS_KEYCHAIN_PASSWORDMACOS_NOTARY_KEY_IDMACOS_NOTARY_ISSUER_IDMACOS_NOTARY_API_KEY
You can prepare all of them in one step with:
tools/prepare_github_secrets.sh \
--p12-path ~/Downloads/mcsas3gui-signing-cert.p12 \
--p12-password '<p12-password>' \
--p8-path ~/Downloads/AuthKey_ABC123XYZ.p8 \
--issuer-id 12345678-1234-1234-1234-123456789abcThe helper script:
- base64-encodes the
.p12signing certificate asMACOS_CERT_P12_BASE64 - reuses the supplied
.p12password asMACOS_CERT_P12_PASSWORD - imports the
.p12into a temporary macOS keychain to discoverMACOS_CODESIGN_IDENTITY - emits
MACOS_KEYCHAIN_PASSWORDfor the temporary runner keychain used in CI - reads the raw
.p8contents intoMACOS_NOTARY_API_KEY - infers
MACOS_NOTARY_KEY_IDfromAuthKey_<KEYID>.p8when possible - requires
MACOS_NOTARY_ISSUER_IDexplicitly because Apple does not store it in the.p8file
Store the emitted values in GitHub under Settings, Secrets and variables, Actions.
The shipped example configurations live under:
src/mcsas3gui/configurations/readdatasrc/mcsas3gui/configurations/runsrc/mcsas3gui/configurations/histogramsrc/mcsas3gui/configurations/prefab
The shipped example datasets live under:
src/mcsas3gui/testdata
Read configurations declare source data units with QUnits: "1/nm" and IUnits: "1/(m sr)".
Run configurations keep logRandom: true enabled, which is the recommended standard mode for
log-uniform parameter sampling.
The GUI is organized into:
gui/main_window.pyfor tab assemblygui/*_tab.pymodules for tab-specific UI behaviorgui/mcsas3_bridge.pyfor canonical McSAS3 integrationgui/optimization_worker.pyandutils/base_worker.pyfor background execution- shared GUI helpers in
gui/*_helpers.pyandutils/task_runner_mixin.py
The generated dependency overview is documented in the GUI structure page.
We welcome contributions! Please ensure your code follows the project's coding style and includes relevant tests and documentation.
This project is licensed under the MIT license
See which tests are available (arguments after -- get passed to pytest which runs the tests):
tox -e py -- --co
Run a specific test only:
tox -e py -- -k <test_name from listing before>
Run all tests with:
tox -e pyGet the next version number and how the GIT history would be interpreted for that:
pip install python-semantic-release
semantic-release -v version --print
This prints its interpretation of the commits in detail. Make sure to supply the --print
argument to not raise the version number which is done automatically by the release job
of the GitHub Action Workflows.
Update the project configuration from the copier template and make sure the required packages are installed:
pip install copier jinja2-time
copier update --trust --skip-answered