Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

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

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

Built distributions (wheels)

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

Total release size: 15.1 MB

Release files / diffpy_srreal-1.5.1rc1.tar.gz

Download URL diffpy_srreal-1.5.1rc1.tar.gz
Size 511.1 kB
Tags Source
SHA-256 checksum
How to use checksums
ac2b519dcdb2930f829d831dad8bf2d3a6c0ccf120aa65d78932e1f9bb54be05
BLAKE2b-256 checksum
How to use checksums
266f84c195c24ff471aaacfbd1b3cc31f9d024d51b5d333b959770f9621b1e14
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.1rc1-cp314-cp314-win_amd64.whl

Download URL diffpy_srreal-1.5.1rc1-cp314-cp314-win_amd64.whl
Size 1.2 MB
Tags CPython 3.14 Windows x86-64
SHA-256 checksum
How to use checksums
7b218d1e032b21771a1bc0ad405925fc02fc71b044643d521781ec34064893dd
BLAKE2b-256 checksum
How to use checksums
bb9fda9b7993abaff5ab6a455167e7c993d6614e5b8fce2d87136b19fc64be7b
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.1rc1-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL diffpy_srreal-1.5.1rc1-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
a957f396fb85b5cd10709dea4aaa793308da05bce6b967b0e73be152c5b11a81
BLAKE2b-256 checksum
How to use checksums
9ae5525d6304650dbd826c0ea458567ce57e1f7fe613be7a33f6fa16f5890eab
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.1rc1-cp314-cp314-macosx_11_0_x86_64.whl

Download URL diffpy_srreal-1.5.1rc1-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
703c49a6529ffef47ca91c13e553ca84bbf1529dd6f3daf1af36c76b70d4f2fd
BLAKE2b-256 checksum
How to use checksums
2c6ce8c999efc12cf38f56a93d9e8b83fba9549ce482be8271443875363d83d5
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.1rc1-cp314-cp314-macosx_11_0_arm64.whl

Download URL diffpy_srreal-1.5.1rc1-cp314-cp314-macosx_11_0_arm64.whl
Size 942.7 kB
Tags CPython 3.14 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
3250df9d508e1beb5b12b88651b4ee5872ba9a69170e03e36ed07e2910143e98
BLAKE2b-256 checksum
How to use checksums
53f7562e6813b3d9e7e17eb862c30b9b9f7b4b2ffd9eff2db46970c64189ff08
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.1rc1-cp313-cp313-win_amd64.whl

Download URL diffpy_srreal-1.5.1rc1-cp313-cp313-win_amd64.whl
Size 1.1 MB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
e83929af73114902d750648ba607361e20f077a5d4725881c22d65e1643f2856
BLAKE2b-256 checksum
How to use checksums
87503f145e1b6987421f1a4dcfa14fcad257882669bb373f6d54730b77648749
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.1rc1-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL diffpy_srreal-1.5.1rc1-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
3ffaa577a0135bfda3fe902115b6e370bbdbfaf8b55a46bc4bd99f1918c6a87c
BLAKE2b-256 checksum
How to use checksums
fa6b0ca6b529c21555be6d70e3dd142a5b9828953d3892de46394cb573f213c7
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.1rc1-cp313-cp313-macosx_11_0_x86_64.whl

Download URL diffpy_srreal-1.5.1rc1-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
2a8a6f25d7cfa1bfeb71153460a5cf6607010f3cba0aa578a32a8439436737e3
BLAKE2b-256 checksum
How to use checksums
c545eaf3f2cbfe738be44884fc0671de09890875aebfcb0e8bfc593dbdb50878
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.1rc1-cp313-cp313-macosx_11_0_arm64.whl

Download URL diffpy_srreal-1.5.1rc1-cp313-cp313-macosx_11_0_arm64.whl
Size 942.7 kB
Tags CPython 3.13 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
b8ccc13dd055e4b7c0397ddf712b5e39cc16ec5966ea6251a7824896b64fe097
BLAKE2b-256 checksum
How to use checksums
7ba8e7729c2a9d8d3106131ba9ec364c0f7e3a86239416c611e28aef96a40e89
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.1rc1-cp312-cp312-win_amd64.whl

Download URL diffpy_srreal-1.5.1rc1-cp312-cp312-win_amd64.whl
Size 1.1 MB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
0a84de829cf19259746ce2e7cee2a808d217d0097dfedf4856bc82a68fd5b679
BLAKE2b-256 checksum
How to use checksums
254a3ef76f00772bbc39bdd138217843b4beda394eb5f7abea2f2f0ee39290e9
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.1rc1-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL diffpy_srreal-1.5.1rc1-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
769b5de17d19e537c54a12d70c31954722dd8aaafc4eae763c9def6f4ee010a8
BLAKE2b-256 checksum
How to use checksums
df935ba547cf3015292ee333d2b0d5487fb09fa0cd9e471db2ddc9620851e465
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.1rc1-cp312-cp312-macosx_11_0_x86_64.whl

Download URL diffpy_srreal-1.5.1rc1-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
42c33717f156b85064b2eb35d0e1aa005cc565cf2110dbe1657a7080633fe4a5
BLAKE2b-256 checksum
How to use checksums
e974e95b98fcb5dca06f9731ccd56bae9f86d590c2b8215a105c0dcc940fd83d
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.1rc1-cp312-cp312-macosx_11_0_arm64.whl

Download URL diffpy_srreal-1.5.1rc1-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
abc10206ae023a6b1a194808eea01c8edfe2237e4366ae272ccabb493552ba76
BLAKE2b-256 checksum
How to use checksums
2b7ade016c87d1de1cfb83470c98754c026ddc823d4efebb69c48beace46bac0
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.1rc1

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