Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Stoner

Scientific data analysis for experimental condensed matter physics.

Tests Test coverage Code quality PyPI version Conda version Documentation status Citation DOI

Stoner helps you load experimental measurements, preserve their metadata, fit physical models, process images and apply the same analysis to collections of files. It originated in the Condensed Matter Physics group at the University of Leeds and builds on NumPy, SciPy, Matplotlib and lmfit.

Start with the user guide, browse the API reference, or explore the example scripts and sample data in the repository.

Working with measurements

The five main classes are available directly from Stoner:

  • Data: a numerical table with masks, column roles and experimental metadata; includes loading, transformations, plotting and curve fitting.

  • DataFolder: collections of measurements that can be filtered, grouped and processed together, with access to their combined metadata.

  • ImageFile: an image with metadata, masks and image-processing methods.

  • ImageFolder: collections of images with grouping and bulk operations.

  • ImageStack: images held together in a three-dimensional array for stack operations.

Many analysis methods modify the object in place and return that same object for chaining. Other methods return results, arrays or plotting objects; check individual method documentation. Use data.clone when you need an independent copy before processing.

Registered loaders recognise supported instrument and facility formats. HDF5 and ZIP support lives in Stoner.formats and Stoner.folders; support for specific layouts does not imply that every arbitrary HDF5 file can be read.

Installation

The current source requires Python 3.12 or newer. The test workflow covers Python 3.12-3.14 on Linux and Python 3.14 on macOS. Published package versions may lag behind the source branch; consult the selected release’s requirements.

We recommend a Conda-based Python distribution, such as Anaconda or Miniforge. Create a dedicated environment using the phygbu and conda-forge channels:

conda create -n stoner -c phygbu -c conda-forge python=3.14 stoner
conda activate stoner

Alternatively, install the published package into an activated Python virtual environment with pip:

python -m pip install Stoner

Optional features

Core installation does not require OCR, specialist format readers or a Qt GUI. For pip installations, extras select additional functionality, for example:

python -m pip install "Stoner[TDMS,image_alignment,ocr]"

Other extras include facility_formats, hyperspy, plot_styles, PrettyPrint, mimetype_detection, numba, cv2 and qt. Their declarations are in pyproject.toml. In Conda environments, install optional packages from the Conda channels where available.

OCR is optional. The ocr extra installs the Python wrapper pytesseract; text recognition also needs the separate Tesseract executable. For a Conda environment, both can be installed with:

conda install -c conda-forge pytesseract tesseract

A small example

Create a measurement, label its columns and attach experimental metadata:

import numpy as np
from Stoner import Data

data = Data(np.array([[0.0, 1.0], [2.0, 5.0], [1.0, 3.0]]),
            column_headers=["Field", "Signal"], setas="xy")
data["Temperature"] = 4.2
ordered = data.clone.sort("Field")
ordered.plot()

For loading real measurements and fitting models, see the user guide and example scripts.

Development and contributions

The maintained source is on the stable branch of the repository. To work on the code with its test dependencies:

git clone --branch stable https://github.com/stonerlab/Stoner-PythonCode.git
cd Stoner-PythonCode
conda env create -f tests/test-env.yml
conda run -n test-environment python -m pip install --no-deps -e .
conda run -n test-environment python -m pytest

Read the contributor guide for documentation builds and extension points, AGENTS.md for repository conventions, and the maintenance plan for current work. Report reproducible problems through the issue tracker. Release tags and earlier source are available in the repository.

Contact, licence and citation

The lead developer is Gavin Burnell (g.burnell@leeds.ac.uk), with contributions from current and former members of the Leeds Condensed Matter Physics group. See the user guide for contributor credits.

Copyright University of Leeds and contributors, except where individual files state otherwise. Stoner is licensed under the GNU General Public License v3; see LICENSE.md. Please cite the package using its Zenodo DOI.

Metadata

Release files for Stoner 0.12.0a2

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

Source distribution (sdist)

Source distribution for Stoner 0.12.0a2
File Size Uploaded Provenance
stoner-0.12.0a2.tar.gz 46.8 MB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for Stoner 0.12.0a2
File Interpreter ABI Platform
stoner-0.12.0a2-py3-none-any.whl Python 3 none any Details

Total release size: 50.0 MB

Release files / stoner-0.12.0a2.tar.gz

Download URL stoner-0.12.0a2.tar.gz
Size 46.8 MB
Tags Source
SHA-256 checksum
How to use checksums
c8b5573f9cc59ee2fc7ebee8a1d0494c49dca3edf6a2a89f5c5fdf0da8800c98
BLAKE2b-256 checksum
How to use checksums
36657f8b98fb56a442144a3003384f788e6e7d4b6e0e54b4186bfa560d2c9c7d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release files / stoner-0.12.0a2-py3-none-any.whl

Download URL stoner-0.12.0a2-py3-none-any.whl
Size 3.3 MB
Tags Python 3
SHA-256 checksum
How to use checksums
d0533b179caf41d1ec549a82ccd01ffd72d04d4a506316d562a31c6379a0e468
BLAKE2b-256 checksum
How to use checksums
49a6aa586d725ac8ae9e1db86aca875c39244b3775295d19cfbb9c96c389036b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Security for Stoner 0.12.0a2

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.

Release history Release notifications | RSS feed

This release
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