Skip to main content

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.11 or newer. The test workflow covers Python 3.11-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, mayavi 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.

Release files for Stoner 0.11.5

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.11.5
File Size Uploaded
stoner-0.11.5.tar.gz 46.3 MB Details

Built distribution (wheel)

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

Total release size: 49.6 MB

Release files / stoner-0.11.5.tar.gz

Download URL stoner-0.11.5.tar.gz
Size 46.3 MB
Tags Source
SHA-256 checksum
How to use checksums
4f30e1ff81b60bdd8a819236b3d358a9e163921248407bdaa53fd26fcf8cce69
BLAKE2b-256 checksum
How to use checksums
243ef10a5abb9a48dd14ec3408dccf5cdc56248f4446c5fc6b117bf868737e24
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.11.5-py3-none-any.whl

Download URL stoner-0.11.5-py3-none-any.whl
Size 3.2 MB
Tags Python 3
SHA-256 checksum
How to use checksums
cf20a7191a0f34950eb0408a18076effe7a100434f0a9477c8d09cbccd8c9ce1
BLAKE2b-256 checksum
How to use checksums
0b3a519bf557198c4e018d7174b97ddd88edf272b1fa59f1b278b8de9d8bcc7b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release history Release notifications | RSS feed

This release

0.11.5 This release

2 release files

0.11.4

2 release files

0.11.0

2 release files

0.10.8

1 release file

0.10.7

1 release file

0.10.4

2 release files

0.10.3

2 release files

0.10.0

2 release files

0.9.6

2 release files

0.9.4

2 release files

0.9.3

2 release files

0.9.0

2 release files

0.8.2

2 release files

0.8.1

2 release files

0.8.0

2 release files

0.7.2

2 release files

0.7.1

1 release file

0.7.0

1 release file

0.6.6

1 release file

0.6.5

1 release file

0.6.4

2 release files

0.6.2

1 release file

0.6.1

1 release file

0.6.0

1 release file

0.5.1

1 release file

0.5.0

1 release file

0.1.0

1 release file

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