CIF2Dist is a python application to calculate the number and distance of coordination spheres of atoms in a lattice based on a cif.
Project description
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.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cif2dist-0.2.2.tar.gz.
File metadata
- Download URL: cif2dist-0.2.2.tar.gz
- Upload date:
- Size: 7.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0430f18a677a0c789cf012a1a616f97d62f27cc2962bdb138a24978702008a0b
|
|
| MD5 |
1289056d78d80839a8a287fc7092b274
|
|
| BLAKE2b-256 |
7e0d0e45624403af1c6e38cbcc350386c24be089e0b1b638d9e8b8473a14eed4
|
File details
Details for the file cif2dist-0.2.2-py3-none-any.whl.
File metadata
- Download URL: cif2dist-0.2.2-py3-none-any.whl
- Upload date:
- Size: 8.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cb2896db91cece0f0d60a9ad62e2fb5fbf12f8dc6d96d36adbd4976b8974f764
|
|
| MD5 |
fa5f3d9004c2fc60d81f6794efc728cd
|
|
| BLAKE2b-256 |
3046802e5794b8fc6a5e5b597b0a7ddd5050def782cf922ce86e473c2bbb14ca
|