Skip to main content

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

Project description

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

diffpy.srreal Package, https://github.com/diffpy/diffpy.srreal

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

If you prefer to install from sources, after installing the dependencies, obtain the source archive from GitHub. Once installed, cd into your diffpy.srreal directory and run the following

pip install .

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 Simon Billinge at sb2896@columbia.edu.

Acknowledgements

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

diffpy_srreal-1.4.0.tar.gz (138.0 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

diffpy_srreal-1.4.0-cp313-cp313-win_amd64.whl (1.9 MB view details)

Uploaded CPython 3.13Windows x86-64

diffpy_srreal-1.4.0-cp313-cp313-manylinux_2_39_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.39+ x86-64

diffpy_srreal-1.4.0-cp313-cp313-macosx_11_0_arm64.whl (990.4 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

diffpy_srreal-1.4.0-cp313-cp313-macosx_10_13_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.13macOS 10.13+ x86-64

diffpy_srreal-1.4.0-cp312-cp312-win_amd64.whl (1.9 MB view details)

Uploaded CPython 3.12Windows x86-64

diffpy_srreal-1.4.0-cp312-cp312-manylinux_2_39_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.39+ x86-64

diffpy_srreal-1.4.0-cp312-cp312-macosx_11_0_arm64.whl (990.4 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

diffpy_srreal-1.4.0-cp312-cp312-macosx_10_13_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.12macOS 10.13+ x86-64

diffpy_srreal-1.4.0-cp311-cp311-win_amd64.whl (1.9 MB view details)

Uploaded CPython 3.11Windows x86-64

diffpy_srreal-1.4.0-cp311-cp311-manylinux_2_39_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.39+ x86-64

diffpy_srreal-1.4.0-cp311-cp311-macosx_11_0_arm64.whl (985.6 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

diffpy_srreal-1.4.0-cp311-cp311-macosx_10_13_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.11macOS 10.13+ x86-64

File details

Details for the file diffpy_srreal-1.4.0.tar.gz.

File metadata

  • Download URL: diffpy_srreal-1.4.0.tar.gz
  • Upload date:
  • Size: 138.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for diffpy_srreal-1.4.0.tar.gz
Algorithm Hash digest
SHA256 34988d5e8e1bf321523de989a48fcac99cba5ff205de26c699e396b9c5a95365
MD5 e20831330273b7b67ec98dfa04e1a25d
BLAKE2b-256 52f973cce15c9714799712fe2ae1085066154d0214640b6c7bd55b5c5fd285da

See more details on using hashes here.

File details

Details for the file diffpy_srreal-1.4.0-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for diffpy_srreal-1.4.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 1d3e954130a13934d5c499f0c800e368501f1190c8506e6d21104fea6c28b997
MD5 e7cdaf531c177815ba3d2409308d04eb
BLAKE2b-256 8b47b05a15384cb19ead55115b183cc18e863a58e420aacc3d3c056374cc6c05

See more details on using hashes here.

File details

Details for the file diffpy_srreal-1.4.0-cp313-cp313-manylinux_2_39_x86_64.whl.

File metadata

File hashes

Hashes for diffpy_srreal-1.4.0-cp313-cp313-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 77f6af3c407bd3ed73d4106cfe5ef9feb8ebcd9ccdf995be12297af3422cb420
MD5 fcb5ae1338ee7846f96e3ea77dff05dd
BLAKE2b-256 3c2c4aacd85903745a52b4a17a43c0eadb67bd727a612fa0067c3c6388497cdb

See more details on using hashes here.

File details

Details for the file diffpy_srreal-1.4.0-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for diffpy_srreal-1.4.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 efdfd2b70d65d53c8c4bafde186aa1f9402574b45e8cf6b2a29b0caa35a692c5
MD5 5a61b64c250c48848c09cc02bfd637f9
BLAKE2b-256 8cb73b4c067ec786f39ea274c45ce8a8d53cdfd25d5415eb77ff54132eee1933

See more details on using hashes here.

File details

Details for the file diffpy_srreal-1.4.0-cp313-cp313-macosx_10_13_x86_64.whl.

File metadata

File hashes

Hashes for diffpy_srreal-1.4.0-cp313-cp313-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 af63ff747ad6992800ef8a9f612152e8d07468fedee6b13605d1e5bceaf79998
MD5 cf1da32fd446d57daba45c6dae86993f
BLAKE2b-256 c1a11c099ffdc0fbe9903eafa8ed87ae704f9fef8869a70d9311de6e653a9974

See more details on using hashes here.

File details

Details for the file diffpy_srreal-1.4.0-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for diffpy_srreal-1.4.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 30ee3f7bfe5712ce7116c8e23f2a06fbba0cbcb7366ffab2cc596500e1df9b2b
MD5 628211a446c9b214d575ed654b20009e
BLAKE2b-256 9051514b8bd16bd29e76960a9a5c9a18892135cca53e6cc6ac0a3d3ec679104f

See more details on using hashes here.

File details

Details for the file diffpy_srreal-1.4.0-cp312-cp312-manylinux_2_39_x86_64.whl.

File metadata

File hashes

Hashes for diffpy_srreal-1.4.0-cp312-cp312-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 fd8e1c6b56353348cf99ece2982b8773c8310b25cf27175a218bec6268c599b7
MD5 d9c1aec0165b047e0b00a06cf5b909f5
BLAKE2b-256 288033dbd1c51b9bc84d7d41cd99ac9616d60715ac4fc6b497223701a52e8c38

See more details on using hashes here.

File details

Details for the file diffpy_srreal-1.4.0-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for diffpy_srreal-1.4.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 93189334ae7806e1debe796254099ac825dd56c7c61000cc34340d0b44e1364d
MD5 2526983a84c6a5c1a41702c6c8bc569a
BLAKE2b-256 40a740c5fec3c932c20da6af45272bfce27f6e5589837bb211c2189363eb5a0c

See more details on using hashes here.

File details

Details for the file diffpy_srreal-1.4.0-cp312-cp312-macosx_10_13_x86_64.whl.

File metadata

File hashes

Hashes for diffpy_srreal-1.4.0-cp312-cp312-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 cca7e9b90bf875846d5a0bbdd3bf5a86783f25ddee768f12735dcda1f1d8befa
MD5 9a1d2db38e4079873312bfc75d9e80f4
BLAKE2b-256 c5544bf07a8e23f535d51e0759df7e704cb18435b5922c5d16efc6d2fbafb763

See more details on using hashes here.

File details

Details for the file diffpy_srreal-1.4.0-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for diffpy_srreal-1.4.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 435d622dc12a232a69abf764f556c28d19112c4ec3c7cd367f860aaa8c55cbd8
MD5 3edff8a58402444c46c17fe32a9417f3
BLAKE2b-256 3ab96d636ecff40cf3d17dc69b2f9298522ad11220ddb4c89c0b1a689f11ca50

See more details on using hashes here.

File details

Details for the file diffpy_srreal-1.4.0-cp311-cp311-manylinux_2_39_x86_64.whl.

File metadata

File hashes

Hashes for diffpy_srreal-1.4.0-cp311-cp311-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 74551dad6eb092bd30e0b9229ed228961a37d9833d930e1dafa9f62461e59f7f
MD5 96645c9879fa39c2c627d01913e8f185
BLAKE2b-256 271b6757ebcd1287a3761683ef1b3f523074058123d6610d792af7fd376e87c0

See more details on using hashes here.

File details

Details for the file diffpy_srreal-1.4.0-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for diffpy_srreal-1.4.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 fb0ce39287ee2fbae44fcbfe9227d8e83fcd7306859d860c55905d5a09747e00
MD5 523d6fbf1fd507eb472b97c224cb92d7
BLAKE2b-256 8a6d6e32d7234dee6be05fb459212f74280a660050b03ad408419f1eca71fe5f

See more details on using hashes here.

File details

Details for the file diffpy_srreal-1.4.0-cp311-cp311-macosx_10_13_x86_64.whl.

File metadata

File hashes

Hashes for diffpy_srreal-1.4.0-cp311-cp311-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 acf6853147cbeea52e3027bade63bb930c875419422fcc39fb247b036c1889e5
MD5 4cf122f01794f0aaf421c2d10b7ba584
BLAKE2b-256 d873e9cf83d0106d089a771685291b4d5cab656a3dfa214f8a10a7d5533c7385

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page