Skip to main content

PDFfit2 - real space structure refinement program.

Project description

PyPi Forge PythonVersion PR

CI Codecov Black Tracking

PDFfit2 - real space structure refinement of the atomic pair distribution function

The diffpy.pdffit2 package provides functions for the calculation and refinement of atomic Pair Distribution Functions (PDF) from crystal structure models. It is used as a computational engine by PDFgui. All refinements possible in PDFgui can be done by writing python scripts directly with diffpy.pdffit2, although less conveniently and with a fair knowledge of Python. However, we recommend using diffpy-cmi for carrying out more advanced, python-scripted refinements of nanostructure.

The PDFfit2 package includes an extension for the interactive IPython shell, these days commonly used within Jupyter notebooks, which tries to mimic the old PDFFIT program. To start IPython with this extension and also with plotting functions enabled, use

ipython --ext=diffpy.pdffit2.ipy_ext --pylab

The IPython extension is suitable for interactive use, however refinement scripts should be preferably written as a standard Python code. This is more reliable and needs only a few extra statements.

To learn more about diffpy.pdffit2 library, see the examples directory included in this distribution or the API documentation at http://www.diffpy.org/doc/pdffit2.

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

Citation

If you use diffpy.pdffit2 in a scientific publication, we would like you to cite the following paper:

C. L. Farrow, P. Juhás, J. W. Liu, D. Bryndin, E. S. Božin, J. Bloch, Th. Proffen and S. J. L. Billinge, PDFfit2 and PDFgui: computer programs for studying nanostructure in crystals (https://stacks.iop.org/0953-8984/19/335219), J. Phys.: Condens. Matter, 19, 335219 (2007)

Installation

diffpy.pdffit2 supports Python 3.11, 3.12, and 3.13.

Windows, macOS (non-Arm64), Linux

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

Add the “conda-forge” channel by running the following command in a terminal:

conda config --add channels conda-forge

Create a new environment named diffpy.pdffit2_env and install diffpy.pdffit2:

conda create -n diffpy.pdffit2_env diffpy.pdffit2

Activate the environment:

conda activate diffpy.pdffit2_env

Confirm that the installation was successful:

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

macOS (Arm64)

Create a new conda environment diffpy.pdffit2_env:

conda create -n diffpy.pdffit2_env python=3.13

Activate the environment:

conda activate diffpy.pdffit2_env

Install pdffit2 using pip to download and install the latest version from Python Package Index:

pip install diffpy.pdffit2

Confirm that the installation was successful:

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

Build from source

For advanced users, obtain the source archive, and in the diffpy.pdffit2 directory, run

conda create -n diffpy.pdffit2_env python=3.13 \
        --file requirements/test.txt \
        --file requirements/conda.txt \
        --file requirements/build.txt

Activate the environment, build the package, and run unit tests by following commands sequentially:

conda activate diffpy.pdffit2_env
pip install . --no-deps
pytest

Support and Contribute

PDFfit2 is not developed anymore and is only maintained due to its status of a sole computational engine for PDFgui. We don’t expect any major developments to the code beyond simple bug fixes and compatibility features. The source code to PDFfit2 is available in a git repository at https://github.com/diffpy/diffpy.pdffit2.

For an actively developed codes for PDF simulations see the DiffPy-CMI framework at http://www.diffpy.org.


Diffpy user group is the discussion forum for general questions and discussions about the use of diffpy.pdffit2. Please join the diffpy.pdffit2 users community by joining the Google group. The diffpy.pdffit2 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.pdffit2 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.pdffit2 please visit the project web-page or email Prof. Simon Billinge at sb2896@columbia.edu.

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_pdffit2-1.5.1.tar.gz (154.2 kB view details)

Uploaded Source

Built Distributions

diffpy.pdffit2-1.5.1-cp313-cp313-win_amd64.whl (1.3 MB view details)

Uploaded CPython 3.13Windows x86-64

diffpy.pdffit2-1.5.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (8.2 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

diffpy.pdffit2-1.5.1-cp313-cp313-macosx_13_0_x86_64.whl (261.1 kB view details)

Uploaded CPython 3.13macOS 13.0+ x86-64

diffpy.pdffit2-1.5.1-cp313-cp313-macosx_13_0_arm64.whl (238.0 kB view details)

Uploaded CPython 3.13macOS 13.0+ ARM64

diffpy.pdffit2-1.5.1-cp312-cp312-win_amd64.whl (1.3 MB view details)

Uploaded CPython 3.12Windows x86-64

diffpy.pdffit2-1.5.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (8.2 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

diffpy.pdffit2-1.5.1-cp312-cp312-macosx_13_0_x86_64.whl (261.1 kB view details)

Uploaded CPython 3.12macOS 13.0+ x86-64

diffpy.pdffit2-1.5.1-cp312-cp312-macosx_13_0_arm64.whl (238.0 kB view details)

Uploaded CPython 3.12macOS 13.0+ ARM64

diffpy.pdffit2-1.5.1-cp311-cp311-win_amd64.whl (1.3 MB view details)

Uploaded CPython 3.11Windows x86-64

diffpy.pdffit2-1.5.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (8.2 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

diffpy.pdffit2-1.5.1-cp311-cp311-macosx_13_0_x86_64.whl (261.0 kB view details)

Uploaded CPython 3.11macOS 13.0+ x86-64

diffpy.pdffit2-1.5.1-cp311-cp311-macosx_13_0_arm64.whl (237.9 kB view details)

Uploaded CPython 3.11macOS 13.0+ ARM64

File details

Details for the file diffpy_pdffit2-1.5.1.tar.gz.

File metadata

  • Download URL: diffpy_pdffit2-1.5.1.tar.gz
  • Upload date:
  • Size: 154.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.1

File hashes

Hashes for diffpy_pdffit2-1.5.1.tar.gz
Algorithm Hash digest
SHA256 78e5ceb714d42ae7333e64c77d5c0b6aa07b1fbf7a9f29ba8323fbeb8d7cbb8f
MD5 800a9fdac73be18d2c71f05b6f417984
BLAKE2b-256 fb6b0d69d67384257f8ed2538797c33d4f02f575bd8ff0f8b5d2c7f991de1d42

See more details on using hashes here.

File details

Details for the file diffpy.pdffit2-1.5.1-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for diffpy.pdffit2-1.5.1-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 26cef8fc915ca1ff98c19603728fae0d31c0bb06c2c99f96ad4762b4697b9929
MD5 67453da836cd5442783e3425b34c5f38
BLAKE2b-256 8e938239b7cd3bb4c134295c1c07318c6fac06fe920b0f615787bb67738e867a

See more details on using hashes here.

File details

Details for the file diffpy.pdffit2-1.5.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for diffpy.pdffit2-1.5.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b9c923513238795ba5ab859b94922519486174f97d08f3bc17f344d47ae17932
MD5 7a81ce5c4f770d166125b3ed720a67d4
BLAKE2b-256 dc47807e225343ee50f71132bc6185d62230c8f6950e3e6a6e161ae11eed9495

See more details on using hashes here.

File details

Details for the file diffpy.pdffit2-1.5.1-cp313-cp313-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for diffpy.pdffit2-1.5.1-cp313-cp313-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 93d0b66b4d976dd2a451673958a7fa7c586dfd281282fcf3963fcdbe31e7a37c
MD5 8f59076c202764a8bf81cac969a2531c
BLAKE2b-256 eda11aec6b9c471074a184c93ffe95fa16593ebd96a017b1a08a4aebed5cd6c6

See more details on using hashes here.

File details

Details for the file diffpy.pdffit2-1.5.1-cp313-cp313-macosx_13_0_arm64.whl.

File metadata

File hashes

Hashes for diffpy.pdffit2-1.5.1-cp313-cp313-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 6da76be187c7529c659cac7b67a5ec27a615b4c9f9f77eed0348abd37c578891
MD5 6179878a7beabf9b7771aa9b7157abd8
BLAKE2b-256 43d9e96af817e50310f9891dd67399e8e9fd651b21a7c8be13ed21d04ceaeb61

See more details on using hashes here.

File details

Details for the file diffpy.pdffit2-1.5.1-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for diffpy.pdffit2-1.5.1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 5bea349b3c16d32b5762bb7ad9d08ee0d9cde0f3e341c36f6087e4b9fe093090
MD5 326545ec4b9d393006eb2952a98bb5e9
BLAKE2b-256 58849cdf13d8e2edf724a670506a5263871d2e4dca30bb91068e5948fb3e20dd

See more details on using hashes here.

File details

Details for the file diffpy.pdffit2-1.5.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for diffpy.pdffit2-1.5.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 78005ed407e5e06a5ccf5c9d633e68cdb4192819433c494c6f560c34d4907379
MD5 fbbb93b8474874950377127baa1b05af
BLAKE2b-256 f884fe36eb9dd6cf823767717700efbe9f7ace2b582352c8f1dc352a31587f64

See more details on using hashes here.

File details

Details for the file diffpy.pdffit2-1.5.1-cp312-cp312-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for diffpy.pdffit2-1.5.1-cp312-cp312-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 c0116caba39c543edaf3b51e470d5704806e5bb0606d94f5184aafd6e44539e3
MD5 8d8fab6edb3568fada06ffea6775212e
BLAKE2b-256 4fa520aca46182c308c1b5abd31b06c18e579c1e17a4ffa17595790ee941002e

See more details on using hashes here.

File details

Details for the file diffpy.pdffit2-1.5.1-cp312-cp312-macosx_13_0_arm64.whl.

File metadata

File hashes

Hashes for diffpy.pdffit2-1.5.1-cp312-cp312-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 3a256397672cd54f255c223be76cf4919dcf2d96dd4c3ace9c72b666a22131b5
MD5 ec5417101bc2260932b7df400163e4ae
BLAKE2b-256 46b8deaadfe1752a707efa7accfa2a02ec84f6de1176fc4352ab2157e54b2a89

See more details on using hashes here.

File details

Details for the file diffpy.pdffit2-1.5.1-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for diffpy.pdffit2-1.5.1-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 6472d19cdf97c1143594df4c428ba46afd5fadc9d73ad90a6f7850994a9b6bf2
MD5 a0842d5f319fee66e2b94bf32dbbbe25
BLAKE2b-256 59b75464cb1ffcf0cfaf34b8fb1604c23982855d453c987ccb18cb273b547e9f

See more details on using hashes here.

File details

Details for the file diffpy.pdffit2-1.5.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for diffpy.pdffit2-1.5.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 906aa50dd51df45e452619bccc51ee3bdf1607de44eef394edbeb552344032ed
MD5 658ec98191acb41057ee58d86934dd80
BLAKE2b-256 1f8a3308fe30660a0a585b7bc4b68b216ce6dc63d69fe9cbff9bd97ca411a8f9

See more details on using hashes here.

File details

Details for the file diffpy.pdffit2-1.5.1-cp311-cp311-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for diffpy.pdffit2-1.5.1-cp311-cp311-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 29a99cfc173a5ec90c7eda576bbf1d550208a6d4c41d5af184b33e9012f3a251
MD5 2c813416e0cb123159bb5f9830730736
BLAKE2b-256 85c65cfa31bb0ac6fd0a1370bdced0640eb8821fe6b10ffd5f00dbe77e4721aa

See more details on using hashes here.

File details

Details for the file diffpy.pdffit2-1.5.1-cp311-cp311-macosx_13_0_arm64.whl.

File metadata

File hashes

Hashes for diffpy.pdffit2-1.5.1-cp311-cp311-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 660b88756b20e6a1eeb04e957de42a7ca099466846810eabd2771d13caff2fc7
MD5 2bfa385bd2daefc31ac8f513de70be3f
BLAKE2b-256 7c2647f142b99ad0e5d0e1e94beb7d05e6bed0cfd84669c263df382f5b6ce99b

See more details on using hashes here.

Supported by

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