Metadata-Version: 2.4
Name: bernardyn
Version: 0.0.1b1
Summary: Publication-oriented plotting workbench for small-angle scattering data
Author: Jan Ilavsky
License-Expression: MIT
Project-URL: Homepage, https://github.com/jilavsky/Bernardyn
Project-URL: Repository, https://github.com/jilavsky/Bernardyn
Project-URL: Issues, https://github.com/jilavsky/Bernardyn/issues
Keywords: SAXS,SANS,USAXS,WAXS,scattering,visualization
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Science/Research
Classifier: Operating System :: MacOS
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering :: Physics
Requires-Python: <3.14,>=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy>=2.0
Requires-Dist: h5py>=3.0
Requires-Dist: PyOpenGL>=3.1.7
Requires-Dist: pyirena[qtplot]<2,>=1.1.0b12
Requires-Dist: pyqtgraph>=0.13.7
Requires-Dist: PySide6!=6.9.1,>=6.8
Provides-Extra: dev
Requires-Dist: pytest>=7; extra == "dev"
Requires-Dist: pytest-cov; extra == "dev"
Requires-Dist: pytest-qt>=4.2; extra == "dev"
Requires-Dist: ruff; extra == "dev"
Requires-Dist: build; extra == "dev"
Requires-Dist: twine; extra == "dev"
Dynamic: license-file

# 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.
- 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-v1.md`](bernardyn/schemas/graph-package-v1.md).
User-facing workflow and file-format documentation is in
[`docs/`](docs/README.md).

## Install and run

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:

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

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

```bash
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:

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

To diagnose an installation:

```bash
bernardyn-doctor
bernardyn-doctor --json
```

The OpenGL renderer needs a usable graphics context. If it cannot initialize,
Bernardyn displays a 2D offset-waterfall fallback and retains the 3D document
configuration.

## Development

```bash
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`](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.
