Catalog PyPI
Back to packageRELEASE DETAILS

0.3.0

PyPI

abinslib

Inelastic neutron-scattering intensities from phonons.

Published21 Sept 2026
Direct dependencies3
Transitive dependenciesNot calculated

README

Version 0.3.0 documentation

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%.

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Declared dependencies 3

Native requirements
3 direct targetsNot calculated transitive count
Package / targetRequirementRelationship
euphonic
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": ">=3.11",
  "evaluation": "NOT_EVALUATED"
}
euphonic<3,>=2.0.0runtime
resins
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": ">=3.11",
  "evaluation": "NOT_EVALUATED"
}
resins==0.1.0runtime
pooch
Environment
{
  "extras": "",
  "marker": "extra == \"tutorial\"",
  "requires_python": ">=3.11",
  "evaluation": "NOT_EVALUATED"
}
pooch~=1.9; extra == "tutorial"runtime

Distribution files

2 collected
abinslib-0.3.0-py3-none-any.whl

bdist_wheel · 30.67 KB · Python py3

Source file
abinslib-0.3.0.tar.gz

sdist · 36.45 KB · Python source

Source file

Repository

PENDING
isisneutronmuon/abins_lib

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 17:26 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package_version:bfe318f082a8b88bee2cef5b263b4c89ed4121a85b11453ad94b9fc0cc99bf72

Other collected versions

View all collected versions →