CIF2Dist
CIF2Dist is a command-line tool and python package for calculating interatomic distances from a CIF (crystallography information file). It is authored by Marco Gurbisz and Tom Förster.
Installation
To use CIF2Dist, you need
- Python 3.9 or later installed
- pip (Python's package installer)
For installation, you can either
- clone the git repository and install the package locally:
git clone https://github.com/MGurbisz/CIF2Dist.git
cd CIF2Dist
pip install .
- Or install using pip directly
pip install CIF2Dist
Then run from command line
CIF2Dist --help
If the CIF2Dist command is not found, you may need to add Python's Scripts Folder to your Path: For Windows, search for 'Environment Variables' and open 'Edit the system environment variables'. There open 'Environment Variables'. Under 'User Variables' find Path and click Edit. Select 'New' and add this:
%LOCALAPPDATA%\Packages\PythonSoftwareFoundation.Python.3.###\LocalCache\local-packages\Python3###\Scripts
Alternatively, you can run it using:
python -m cif2dist.cli --help
Use CIF2Dist as a package
To use CIF2Dist inside a virtual environment (venv) use the following inside your project directory:
python -m venv venv
venv\Scripts\activate # On Windows
venv/bin/activate # On macOS, GNU Linux
python -m pip install cif2dist
python -m myscript
Inside your script make sure to use:
import cif2dist
from cif2dist.core import compute_distances
compute_distances is the main funtion of this package and is defined as:
def compute_distances(cif_path, user_site: str, cutoff_dist: float, filter: str) -> list[tuple[str, int, float]]:
Input
Input a CIF using its path and filename, and specify a site with -s to calculate the distance to its neighbors. For the stom site input you can use the atom label (e. g. "Y1") directly. Otherwise stating the Wyckoff site (e. g. '4a') or Wyckoff letter (e. g. 'a') or the element (e. g. 'Y') can be done, if it's unambiguous (i. e. there is only one match for the input and a atom label).
Arguments
The tool supports multiple Arguments
Help --help, -h
Displays the help site and exits
Version --version, -v
Displays the version number and exits
Center site --site, -s
Specifies center site for calculation. See Subsection 'Input'
Cutoff Distance --cutoff, -c
Specifies cutoff distance for the calculation. The default value is 10 Ångstrom.
Filter --filter, -f
Specifies the output filter. It accepts Wyckoff sites and letters, site labels and elements. The output will contain the specified site distances only.
No Version Check --no-version-check
Disables automatic version check.
Output
After running the code, you'll get an output file called 'summary.txt'. It contains the Site labels, the number of atoms on this site at the same distance and then the distance itself in Å all separated by a tab space character.
Metadata
Release files for CIF2Dist 0.2.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| cif2dist-0.2.2.tar.gz | 7.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| cif2dist-0.2.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 15.7 kB
Release files / cif2dist-0.2.2.tar.gz
| Download URL | cif2dist-0.2.2.tar.gz |
|---|---|
| Size | 7.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0430f18a677a0c789cf012a1a616f97d62f27cc2962bdb138a24978702008a0b
|
|
BLAKE2b-256 checksum How to use checksums |
7e0d0e45624403af1c6e38cbcc350386c24be089e0b1b638d9e8b8473a14eed4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.10
|
Release files / cif2dist-0.2.2-py3-none-any.whl
| Download URL | cif2dist-0.2.2-py3-none-any.whl |
|---|---|
| Size | 8.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
cb2896db91cece0f0d60a9ad62e2fb5fbf12f8dc6d96d36adbd4976b8974f764
|
|
BLAKE2b-256 checksum How to use checksums |
3046802e5794b8fc6a5e5b597b0a7ddd5050def782cf922ce86e473c2bbb14ca
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.10
|