Skip to main content

Icon diffpy.srreal

PyPI Forge PythonVersion PR

CI Codecov Black Tracking

Calculators for PDF, bond valence sum, and other quantities based on atom pair interaction.

The diffpy.srreal package provides calculators for atomic pair distribution function (PDF), bond valence sums (BVS), atom overlaps for a hard-sphere model, bond distances and directions up to specified maximum distance. The atomic structure models are represented with internal classes as non-periodic, periodic or structures with space group symmetries. The package provides implicit adapters from diffpy.structure classes or from Crystal or Molecule objects from pyobjcryst. Adapters can be easily defined for any other structure representations in Python allowing their direct use with the calculators. Calculators support two evaluation models - BASIC, which performs a full pair-summation every time, and OPTIMIZED, which updates only pair contributions that have changed since the last evaluation. Calculations can be split among parallel jobs using Python multiprocessing package or any other library that provides parallel map function. PDF calculations can be done in two modes - either as a real-space summation of peak profiles (PDFCalculator) or as a reciprocal-space Debye summation and Fourier transform of the total scattering structure function (DebyePDFCalculator).

The diffpy.srreal package is a Python binding to the C++ library libdiffpy (https://github.com/diffpy/libdiffpy). Calculators are created as objects of a given calculator type and so multiple instances of the same calculator type can exist with different configurations. Calculators are composed of other objects that perform lower-level tasks, such as calculating peak profile or looking up atom scattering factors. These objects can be re-assigned at runtime allowing to easily customize the calculation procedure. New classes can be defined using object inheritance either in Python or in C++ and used with the existing calculators; as an example, this allows to calculate PDF with a user-defined profile function. A new calculator class can be also defined for any quantity that is obtained by iteration over atom pairs, by defining only the function that processes atom-pair contributions.

For more information about the diffpy.srreal library, please consult our online documentation.

Citation

If you use diffpy.srreal in a scientific publication, we would like you to cite this package as

Juhás, P.; Farrow, C. L.; Yang, X.; Knox, K. R.; Billinge, S. J. L. Complex Modeling: A Strategy and Software Program for Combining Multiple Information Sources to Solve Ill Posed Structure and Nanostructure Inverse Problems. Acta Crystallogr A Found Adv 2015, 71 (6), 562–568. https://doi.org/10.1107/S2053273315014473.

Installation

The preferred method is to use Miniconda Python and install from the “conda-forge” channel of Conda packages.

To add “conda-forge” to the conda channels, run the following in a terminal.

conda config --add channels conda-forge

We want to install our packages in a suitable conda environment. The following creates and activates a new environment named diffpy.srreal_env

conda create -n diffpy.srreal_env diffpy.srreal
conda activate diffpy.srreal_env

To confirm that the installation was successful, type

python -c "import diffpy.srreal; print(diffpy.srreal.__version__)"

The output should print the latest version displayed on the badges above.

If the above does not work, you can use pip to download and install the latest release from Python Package Index. To install using pip into your diffpy.srreal_env environment, type

pip install diffpy.srreal

To build from Git, install the dependencies, then clone the repository with its libdiffpy submodule

git clone --recurse-submodules https://github.com/diffpy/diffpy.srreal.git
cd diffpy.srreal
pip install .

For an existing checkout, initialize or update the submodule before building

git submodule update --init --recursive

The parent repository pins the libdiffpy commit in extern/libdiffpy. CMake compiles those sources directly without downloading them or updating the submodule. Version information is read from the submodule and included in source distributions as a generated header.

Packaged source distributions (sdists) include libdiffpy, so they can be extracted and built with pip install . without Git or a separate libdiffpy download. GitHub’s automatically generated source archives omit submodule contents; use a recursive clone or a packaged sdist instead. A C++23 compiler, Boost.Serialization, GSL, and the Python build dependencies must still be installed separately, including for an offline build.

Getting Started

You may consult our online documentation for tutorials and API references.

Support and Contribute

Diffpy user group is the discussion forum for general questions and discussions about the use of diffpy.srreal. Please join the diffpy.srreal users community by joining the Google group. The diffpy.srreal project welcomes your expertise and enthusiasm!

If you see a bug or want to request a feature, please report it as an issue and/or submit a fix as a PR. You can also post it to the Diffpy user group.

Feel free to fork the project and contribute. To install diffpy.srreal in a development mode, with its sources being directly used by Python rather than copied to a package directory, use the following in the root directory

pip install -e .

To ensure code quality and to prevent accidental commits into the default branch, please set up the use of our pre-commit hooks.

  1. Install pre-commit in your working environment by running conda install pre-commit.

  2. Initialize pre-commit (one time only) pre-commit install.

Thereafter your code will be linted by black and isort and checked against flake8 before you can commit. If it fails by black or isort, just rerun and it should pass (black and isort will modify the files so should pass after they are modified). If the flake8 test fails please see the error messages and fix them manually before trying to commit again.

Improvements and fixes are always appreciated.

Before contributing, please read our Code of Conduct.

Contact

For more information on diffpy.srreal please visit the project web-page or email the maintainers Simon Billinge(sbillinge@ucsb.edu).

Acknowledgements

diffpy.srreal is built and maintained with scikit-package.

Metadata

Release files for diffpy.srreal 1.5.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 diffpy.srreal 1.5.0
File Size Uploaded Provenance Actions
diffpy_srreal-1.5.0.tar.gz 431.6 kB Without provenance Details for diffpy_srreal-1.5.0.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for diffpy.srreal 1.5.0
File Actions
diffpy_srreal-1.5.0-cp314-cp314-win_amd64.whl CPython 3.14 CPython 3.14 Windows x86-64 Details for diffpy_srreal-1.5.0-cp314-cp314-win_amd64.whl
diffpy_srreal-1.5.0-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.14 CPython 3.14 Linux glibc 2.27+ x86-64, Linux glibc 2.28+ x86-64 Details for diffpy_srreal-1.5.0-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
diffpy_srreal-1.5.0-cp314-cp314-macosx_11_0_x86_64.whl CPython 3.14 CPython 3.14 macOS 11.0+ x86-64 Details for diffpy_srreal-1.5.0-cp314-cp314-macosx_11_0_x86_64.whl
diffpy_srreal-1.5.0-cp314-cp314-macosx_11_0_arm64.whl CPython 3.14 CPython 3.14 macOS 11.0+ ARM64 Details for diffpy_srreal-1.5.0-cp314-cp314-macosx_11_0_arm64.whl
diffpy_srreal-1.5.0-cp313-cp313-win_amd64.whl CPython 3.13 CPython 3.13 Windows x86-64 Details for diffpy_srreal-1.5.0-cp313-cp313-win_amd64.whl
diffpy_srreal-1.5.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.27+ x86-64, Linux glibc 2.28+ x86-64 Details for diffpy_srreal-1.5.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
diffpy_srreal-1.5.0-cp313-cp313-macosx_11_0_x86_64.whl CPython 3.13 CPython 3.13 macOS 11.0+ x86-64 Details for diffpy_srreal-1.5.0-cp313-cp313-macosx_11_0_x86_64.whl
diffpy_srreal-1.5.0-cp313-cp313-macosx_11_0_arm64.whl CPython 3.13 CPython 3.13 macOS 11.0+ ARM64 Details for diffpy_srreal-1.5.0-cp313-cp313-macosx_11_0_arm64.whl
diffpy_srreal-1.5.0-cp312-cp312-win_amd64.whl CPython 3.12 CPython 3.12 Windows x86-64 Details for diffpy_srreal-1.5.0-cp312-cp312-win_amd64.whl
diffpy_srreal-1.5.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.27+ x86-64, Linux glibc 2.28+ x86-64 Details for diffpy_srreal-1.5.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
diffpy_srreal-1.5.0-cp312-cp312-macosx_11_0_x86_64.whl CPython 3.12 CPython 3.12 macOS 11.0+ x86-64 Details for diffpy_srreal-1.5.0-cp312-cp312-macosx_11_0_x86_64.whl
diffpy_srreal-1.5.0-cp312-cp312-macosx_11_0_arm64.whl CPython 3.12 CPython 3.12 macOS 11.0+ ARM64 Details for diffpy_srreal-1.5.0-cp312-cp312-macosx_11_0_arm64.whl

Total release size: 15.3 MB

Release files / diffpy_srreal-1.5.0.tar.gz

Download URL diffpy_srreal-1.5.0.tar.gz
Size 431.6 kB
Tags Source
SHA-256 checksum
How to use checksums
37a62396f95b0d08be13259fcbd8b85437c54b31629cef18126cd7daa218a535
BLAKE2b-256 checksum
How to use checksums
9ad2849ac041576c802e19616c2cacc14cd7c6295376384c20db385b0c14d2c2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.9

Release files / diffpy_srreal-1.5.0-cp314-cp314-win_amd64.whl

Download URL diffpy_srreal-1.5.0-cp314-cp314-win_amd64.whl
Size 1.0 MB
Tags CPython 3.14 Windows x86-64
SHA-256 checksum
How to use checksums
dde4ae8d0092ca58c8b96cf95ab3aedcbd3dec8bb7f97ef2a207b4c51548ad9e
BLAKE2b-256 checksum
How to use checksums
fc18c77cce57b09419533684bdfdc904e50e1b8b2eeb4c6e69b5d034f74a6260
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.9

Release files / diffpy_srreal-1.5.0-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL diffpy_srreal-1.5.0-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 1.6 MB
Tags CPython 3.14 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
c7ab2fe9ec720d32703ec328eb628721fc6e9ce6e5e2e7601a70c7040edbe6a2
BLAKE2b-256 checksum
How to use checksums
839c7792e86712d04c2c1f446dd8012a16697a905df192b02511c1238a028af5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.9

Release files / diffpy_srreal-1.5.0-cp314-cp314-macosx_11_0_x86_64.whl

Download URL diffpy_srreal-1.5.0-cp314-cp314-macosx_11_0_x86_64.whl
Size 1.2 MB
Tags CPython 3.14 macOS 11.0+ x86-64
SHA-256 checksum
How to use checksums
fafe4f1da34a237672852dec6099d2e844cef4f9a5b951fad6ff476b2be63f95
BLAKE2b-256 checksum
How to use checksums
c7e76ad08990d56a2b6773d5a70e0a47f0041979b81b75a6d0fe77f225716938
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.9

Release files / diffpy_srreal-1.5.0-cp314-cp314-macosx_11_0_arm64.whl

Download URL diffpy_srreal-1.5.0-cp314-cp314-macosx_11_0_arm64.whl
Size 1.1 MB
Tags CPython 3.14 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
04ebaf2af31535643dd7ad581c38dbd2062aa10351de259847a445480baffc9b
BLAKE2b-256 checksum
How to use checksums
c472f38c8fc499bc1e2c67aa477b622635d5a7e381c09cb2a375e040827e9bc6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.9

Release files / diffpy_srreal-1.5.0-cp313-cp313-win_amd64.whl

Download URL diffpy_srreal-1.5.0-cp313-cp313-win_amd64.whl
Size 1.0 MB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
241b40500a248c475cd38a33deeb7816ed5434e2ac6e1ea25b1763999ba82517
BLAKE2b-256 checksum
How to use checksums
df53cef57460924ad7d78527feefd652d1dd1840a4eb1700da03cbee0af68db1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.9

Release files / diffpy_srreal-1.5.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL diffpy_srreal-1.5.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 1.6 MB
Tags CPython 3.13 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
1d6de154870cba8fb0a2ef87c178ac14984c8cd5c834eeaac23e21bd8442f9bf
BLAKE2b-256 checksum
How to use checksums
ee7ab3e0307fd117d5cc3a42d8e0c42dd43f50918ceff04562d5e9543f49f54c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.9

Release files / diffpy_srreal-1.5.0-cp313-cp313-macosx_11_0_x86_64.whl

Download URL diffpy_srreal-1.5.0-cp313-cp313-macosx_11_0_x86_64.whl
Size 1.2 MB
Tags CPython 3.13 macOS 11.0+ x86-64
SHA-256 checksum
How to use checksums
d296b995c9af17c5eec3ce5b4c4751172b64f2a35dcd63435b8ad4e20ce2428d
BLAKE2b-256 checksum
How to use checksums
10b6258a9089e4a5269406350f423357a98654c6e20692e156b78a9772f839ad
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.9

Release files / diffpy_srreal-1.5.0-cp313-cp313-macosx_11_0_arm64.whl

Download URL diffpy_srreal-1.5.0-cp313-cp313-macosx_11_0_arm64.whl
Size 1.1 MB
Tags CPython 3.13 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
9479cb09ed5f4be9f8f242d7d69d3654545ca2e971c0372384981101f928a98d
BLAKE2b-256 checksum
How to use checksums
8ca822dd282fb24e9e592a5b7815e2147523f0c7af17f88f071a3a19077f487b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.9

Release files / diffpy_srreal-1.5.0-cp312-cp312-win_amd64.whl

Download URL diffpy_srreal-1.5.0-cp312-cp312-win_amd64.whl
Size 1.0 MB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
21df260de1fe139b49c4d98eeb5d109770dcbed447a00725e1ccf0c05b53669c
BLAKE2b-256 checksum
How to use checksums
e68f2621711bc1d49e7baa976a45d765d45eac5dcb142477825d5a1c9a7dfa4f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.9

Release files / diffpy_srreal-1.5.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL diffpy_srreal-1.5.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 1.6 MB
Tags CPython 3.12 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
dbc69304c59321af86479c7e60e17a018187a2b3bc80916a9bc71ca6dc0ae4c6
BLAKE2b-256 checksum
How to use checksums
8f5a8118b54b9c3490fb0a7d6d9c3a2b86b26fa74f07d845a62e78b3e71195fc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.9

Release files / diffpy_srreal-1.5.0-cp312-cp312-macosx_11_0_x86_64.whl

Download URL diffpy_srreal-1.5.0-cp312-cp312-macosx_11_0_x86_64.whl
Size 1.2 MB
Tags CPython 3.12 macOS 11.0+ x86-64
SHA-256 checksum
How to use checksums
ecb5faf28e198f035231b918cb5b92ebc2958910f12fe451514b80848264b4ba
BLAKE2b-256 checksum
How to use checksums
cae912e2ae96d4248ffa7d5a391abf6cae5cc09694937f51bd7f401ffc27918e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.9

Release files / diffpy_srreal-1.5.0-cp312-cp312-macosx_11_0_arm64.whl

Download URL diffpy_srreal-1.5.0-cp312-cp312-macosx_11_0_arm64.whl
Size 1.1 MB
Tags CPython 3.12 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
d27a7a8b123ad798484576ea4226f9c4d9bc0c681c38b0b39fbbf34988ce849a
BLAKE2b-256 checksum
How to use checksums
b083d2575967ec3f3d0b52f59f4c0f30e5f6d8a6e83d89cd110b998f9b181278
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.9

Security for diffpy.srreal 1.5.0

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.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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