Skip to main content

Ruff Run tests Documentation License

abinslib

A library for dynamical structure factor calculations from phonon data in the harmonic approximation.

This is still in alpha: if using for production, pin a minor version number (e.g. abinslib~=0.3.0)

Abinslib implements a variety of simulation methods for inelastic neutron scattering (INS) from phonons, in the general CLIMAX/abINS lineage. Most of these approximations have not been rigorously compared, so this is intended to provide both

  • reference implementations that can be called by user-facing simulation software; and
  • a playground for method development and validation in this area.

Testing and linting

Install with testing dependency group, e.g. from this directory

pip install . --group test

and run with pytest

pytest

You may need to update Pip to access the --group feature.

New code should be accompanied with appropriate tests; use

pytest --cov --cov-report term-missing

to get a breakdown of which lines are not covered by tests. (This can also be found in the Github Actions output when making a Pull Request.) As well as unit testing, code contributions must pass linting with ruff check and ruff format.

The pytest-regressions package is used to create/test reference outputs for functions given particular input. This gives confidence that results do not change unexpectedly between versions, but such "regression tests" are not necessarily validated against an ideal or external reference.

Validation status

So far we have implemented some of the calculation methods from Mantid-Abins: 1D fundamental spectra in the fully-isotropic and almost-isotropic incoherent approximation, and 1D second-order spectra in the almost-isotropic incoherent approximation. This is benchmarked against the equivalent calculation in Mantid: a Snakemake workflow in dev/validation is used to produce reference data, and this is plotted against abinslib calculations in the documentation gallery.

To reproduce the result so closely it was necessary to apply similar implementation details: the q_scaling_isotropic_incoherent_spectra function computes mode intensities at Q = 1Å and bins them to a dense spectrum before applying Q^n2/n! scaling and Debye—Waller factor for the bin-centre Q values. In practice this gives an acceptable discretisation error of ~0.1%.

Release files for abinslib 0.3.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 abinslib 0.3.0
File Size Uploaded
abinslib-0.3.0.tar.gz 37.3 kB Details

Built distribution (wheel)

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

Total release size: 68.7 kB

Release files / abinslib-0.3.0.tar.gz

Download URL abinslib-0.3.0.tar.gz
Size 37.3 kB
Tags Source
SHA-256 checksum
How to use checksums
5290595ab79bf961b4e901a29744c94c4250c994296d91e34f8b420f95cfe9f5
BLAKE2b-256 checksum
How to use checksums
322c01133bce90ee6ed042aaa18ace0a09d1484725d1b15e468c568f5e30cd2e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 21, 2026.

Transparency log

Release files / abinslib-0.3.0-py3-none-any.whl

Download URL abinslib-0.3.0-py3-none-any.whl
Size 31.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9d1d04f05de8fcf57d59b9d4986ef7dcf0331ebe2258957f521782a38955b575
BLAKE2b-256 checksum
How to use checksums
f2a9f05a7d61dbb7a5b3290d2c9ed6c54b6e71d9371161666ff97b726d04c982
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 21, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 release files

0.2.0

2 release files

0.1.0

2 release files

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