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. CMake builds the SIMD kernels when it finds xsimd 14 or newer.

To enable the optional CUDA kernels in a source build, install the CUDA toolkit with nvcc and run

pip install . -C cmake.define.SRREAL_CUDA=ON

Set CUDACXX if nvcc is not in the PATH.

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 .

The default build type is Release. For example, to test a debug CUDA build

python -m pip install -e ".[test]" -C cmake.build-type=Debug -C cmake.define.SRREAL_CUDA=ON
python -m pytest

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

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.1
File Size Uploaded Provenance Actions
diffpy_srreal-1.5.1.tar.gz 511.1 kB Without provenance Details for diffpy_srreal-1.5.1.tar.gz

Built distributions (wheels)

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

Total release size: 15.1 MB

Release files / diffpy_srreal-1.5.1.tar.gz

Download URL diffpy_srreal-1.5.1.tar.gz
Size 511.1 kB
Tags Source
SHA-256 checksum
How to use checksums
a7b3f5a0ae6d4ed88535c17e53385753ea509a233db3a3609e97564822efb55b
BLAKE2b-256 checksum
How to use checksums
815fcf9095080e62c913d874d655dcecb2266f260ca868882ab0ff8f51c30c95
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.10

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

Download URL diffpy_srreal-1.5.1-cp314-cp314-win_amd64.whl
Size 1.2 MB
Tags CPython 3.14 Windows x86-64
SHA-256 checksum
How to use checksums
cb937aae03ba0521e267e3ca8e664ade709958bf4d29b519db7bce8707ed46f1
BLAKE2b-256 checksum
How to use checksums
437786b24b2a164dfa6ca84829a930b153634d488a3d48e4bcaed84a84738466
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.10

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

Download URL diffpy_srreal-1.5.1-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 1.8 MB
Tags CPython 3.14 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
879a6afe9d6607817b0f10f95ac8dcd2a26e5e86e3411e215ace92b2183adedf
BLAKE2b-256 checksum
How to use checksums
4373213ced59c7c2658f11a8fa06a4723a0b5b00fc5b7556cd6684b9da70d6e3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.10

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

Download URL diffpy_srreal-1.5.1-cp314-cp314-macosx_11_0_x86_64.whl
Size 1.0 MB
Tags CPython 3.14 macOS 11.0+ x86-64
SHA-256 checksum
How to use checksums
0ab9a1937538f8af7d0f7c3b6b5cb3f3a7a2511e7899872eba1980f105b88e6e
BLAKE2b-256 checksum
How to use checksums
e549420314cfecf835444d6fc6d686a08ffe49d5fd789a3b2ac4d9c30feabd8e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.10

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

Download URL diffpy_srreal-1.5.1-cp314-cp314-macosx_11_0_arm64.whl
Size 942.6 kB
Tags CPython 3.14 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
1880a94c0b7fddc4eaa58c631441623b480d73f7d64392297669e04755f20ced
BLAKE2b-256 checksum
How to use checksums
371385c89309561818e882351879164648a50111ad35ec0adc639e708e8c368a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.10

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

Download URL diffpy_srreal-1.5.1-cp313-cp313-win_amd64.whl
Size 1.1 MB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
1ff395762c0ccf6b236b56132238b4110deafb6629809df99fd449136df74bf7
BLAKE2b-256 checksum
How to use checksums
0d340987694d3e947f446de4d41fed34b0623d3bc4484a53c95483256a016dd9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.10

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

Download URL diffpy_srreal-1.5.1-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 1.8 MB
Tags CPython 3.13 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
89d418e8df6df81b4ab1b68949ab605ce274ed36aefc5eb5505f4cc404c61e9e
BLAKE2b-256 checksum
How to use checksums
ead421ec4700ba45669dfc65a690d1552684ece4f1b660cdc37b7ff7f6c60567
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.10

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

Download URL diffpy_srreal-1.5.1-cp313-cp313-macosx_11_0_x86_64.whl
Size 1.0 MB
Tags CPython 3.13 macOS 11.0+ x86-64
SHA-256 checksum
How to use checksums
468ea74eed421d1d7daa13ff77522ef8c57e515d8d941b3303c9b9b60557b53a
BLAKE2b-256 checksum
How to use checksums
7b742cdcb5060c5da4c87f72dd22d6012ebecaccbafcea751945617e6640edc8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.10

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

Download URL diffpy_srreal-1.5.1-cp313-cp313-macosx_11_0_arm64.whl
Size 942.6 kB
Tags CPython 3.13 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
87b6d847d531098c1de0d3f169b7092c7a0be71e5b373efaaae7bdf2a57b85a0
BLAKE2b-256 checksum
How to use checksums
fda610674d82e7675baae027516be2ada6d5c989f9c93afe1487ab6c93a98846
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.10

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

Download URL diffpy_srreal-1.5.1-cp312-cp312-win_amd64.whl
Size 1.1 MB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
9288f20cbc0b40f7456097f00ec6d2fc55b3b2073a57ecb28ba36cc63064f33d
BLAKE2b-256 checksum
How to use checksums
81c6e8ea58c684171f9033fb024ec0e87b01ab3a01254c241aab4c3dbe3f095b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.10

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

Download URL diffpy_srreal-1.5.1-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 1.8 MB
Tags CPython 3.12 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
504e58740b25c199a91808ec24cbc1b6cc610917b9d6037262bf6101c8557a17
BLAKE2b-256 checksum
How to use checksums
f43fb97728405d9ba8e2b38c94a92f52dffb4b2dd2d4f58bd3d76dfc80a5a22a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.10

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

Download URL diffpy_srreal-1.5.1-cp312-cp312-macosx_11_0_x86_64.whl
Size 1.0 MB
Tags CPython 3.12 macOS 11.0+ x86-64
SHA-256 checksum
How to use checksums
06ae3b30f4f52cb6f54366c0b71010dd2799916b924bb8e8088038cd8d7cb83c
BLAKE2b-256 checksum
How to use checksums
c40b33512083b6a963dfadb661ac3f8951a54b3b76ee88abb61889237f216814
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.10

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

Download URL diffpy_srreal-1.5.1-cp312-cp312-macosx_11_0_arm64.whl
Size 942.7 kB
Tags CPython 3.12 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
c2d36637bc5151a6abfcdedce775ebab443f04871b13a9d92fcb0bdb9272807e
BLAKE2b-256 checksum
How to use checksums
7970d6a3bf827bb1ba911966c25c15560f2d45adb7861979b5f982a0ea24d560
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.10

Security for diffpy.srreal 1.5.1

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