Skip to main content

Bernardyn

Bernardyn is a PySide6/PyQtGraph workbench for publication-oriented plotting of small-angle scattering and diffraction curves. It keeps scientific arrays out of widgets and stores complete, source-independent graphs in portable HDF5 packages.

Current capabilities

  • Browse all discoverable NXcanSAS/simple-HDF5 entries and 2–4 column text data.
  • Add saved pyIrena results (Unified Fit, Size Distribution, Modeling, Simple Fits, WAXS Peak Fit, Carbon fitting) from the same data selector as I(Q) data: measured data with fits and components, residuals, and size distributions, with units read from the files.
  • Keep a workspace-wide dataset catalog and independent graph tabs.
  • Plot General I(Q), Guinier, rod/sheet Guinier, Kratky, dimensionless Kratky, Porod, modified Porod, Zimm, and Debye–Bueche views.
  • Style each curve, errors, labels, axes, legends, typography, and annotations.
  • Render 3D line waterfalls and common-grid surfaces with an isolated, lazily-loaded PyQtGraph OpenGL backend and 2D fallback.
  • Save one graph or a deduplicated multi-graph workspace as *.bernardyn.h5, including canonical data, resolved snapshots, configuration, checksums, previews, and 3D renderer data.
  • Export PNG/JPEG/SVG, CSV, Igor ITX, and canonical data through PyIrena's H5XP writer. H5XP export is data interoperability, not Bernardyn graph persistence.

The native schema is documented in bernardyn/schemas/graph-package-v3.md; packages written by any Bernardyn release since the betas remain readable, and settings written by newer releases are preserved when an older one resaves. User-facing workflow and file-format documentation is on Read the Docs. Scripts and automation can use the typed Python facade or bernardyn-plot CLI; see headless recipes. Local MCP-capable agents can use the five-tool bernardyn-mcp server for the same recipe workflow.

User-visible changes are recorded in CHANGELOG.md.

Install and run

From PyPI (Python 3.10–3.13):

python -m pip install bernardyn
python -m pip install "bernardyn[mcp]"   # optional: local MCP server for agents
bernardyn-doctor
bernardyn

Bernardyn targets Python 3.10–3.13 and shares its Qt plotting dependencies with PyIrena. For development, keep the Bernardyn and pyirena repositories next to each other and create the pinned Conda environment from the Bernardyn root:

conda env create -f environment.yml
conda activate bernardyn
bernardyn-doctor
bernardyn

To check the installed version, run bernardyn --version (also accepts -version, --v, or -V), or use About Bernardyn in the app menu on macOS or the Help menu on Windows/Linux. The version also appears in the status bar. On Windows, where the bernardyn GUI launcher has no console, use python -m bernardyn --version to print the version in a terminal.

The environment file installs both repositories in editable mode. If an older bernardyn environment already exists with Python 3.14, remove and recreate it:

conda deactivate
conda env remove -n bernardyn
conda env create -f environment.yml
conda activate bernardyn

For an already compatible Python 3.10–3.13 environment, installation can also be performed manually:

python -m pip install -e "../pyirena[qtplot]"
python -m pip install -e ".[dev]"
bernardyn

To diagnose an installation:

bernardyn-doctor
bernardyn-doctor --json

If an existing environment reports that the PyIrena shared API is missing with No module named 'six', repair that older environment with python -m pip install six. New Bernardyn installations install this compatibility dependency automatically.

The OpenGL renderer needs a usable graphics context. Before enabling a 3D renderer, Bernardyn checks that Qt can create the required OpenGL/GLX widget in a separate process. If that check fails (for example on a remote or headless X session), Bernardyn stays running, displays a 2D offset-waterfall fallback, and retains the 3D document configuration. bernardyn-doctor also reports whether the actual 3D context is ready.

Development

pytest
ruff check bernardyn tests
python -m build
twine check dist/*

Extension entry points are bernardyn.sources, bernardyn.transforms, and bernardyn.renderers; see bernardyn/EXTENDING.md.

Scope

Version 1.0 is a plotting and presentation application. Model fitting, reduction, destructive source modification, movies, and calibrated 2D detector workflows are intentionally outside 1.0. Existing experimental 0.1 containers are not treated as compatible graph packages.

Bernardyn is distributed under the MIT License.

Metadata

Release files for bernardyn 1.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bernardyn 1.2.0
File Size Uploaded Provenance Actions
bernardyn-1.2.0.tar.gz 239.0 kB With provenance Details for bernardyn-1.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for bernardyn 1.2.0
File Interpreter ABI Platform Actions
bernardyn-1.2.0-py3-none-any.whl Python 3 none any Details for bernardyn-1.2.0-py3-none-any.whl

Total release size: 438.7 kB

Release files / bernardyn-1.2.0.tar.gz

Download URL bernardyn-1.2.0.tar.gz
Size 239.0 kB
Tags Source
SHA-256 checksum
How to use checksums
6bf7510228b42b90263e5575e14b1142a7dd67965f73c5b9067f813aa8447465
BLAKE2b-256 checksum
How to use checksums
0792d78cacdae898d4c9395a3e9eb1fb5ba1eed7e67a9cc5559e1de55897b852
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 23, 2026.

Transparency log

Release files / bernardyn-1.2.0-py3-none-any.whl

Download URL bernardyn-1.2.0-py3-none-any.whl
Size 199.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e3e0141f51654ee768ea07fba80209d9f1c357b5df1041768ef88782a981e974
BLAKE2b-256 checksum
How to use checksums
30647864cccf4f7fd6434be012e4b5fbd8b6fa36fa1cdd96ddc4475115e3bf6a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 23, 2026.

Transparency log

Security for bernardyn 1.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for bernardyn-1.2.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 23, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page