Analysis tools for tracking ion migration through crystallographic sites
Project description
site-analysis
site-analysis is a Python module for analysing molecular dynamics simulations of solid-state ion transport, by assigning positions of mobile ions to specific “sites” within the host structure.
The code is built on top of pymatgen and takes VASP XDATCAR files as molecular dynamics trajectory inputs.
The code can use the following definitions for assigning mobile ions to sites:
- Spherical cutoff: Atoms occupy a site if they lie within a spherical cutoff from a fixed position.
- Voronoi decomposition: Atoms are assigned to sites based on a Voronoi decomposition of the lattice into discrete volumes.
- Polyhedral decomposition: Atoms are assigned to sites based on occupation of polyhedra defined by the instantaneous positions of lattice atoms.
- Dynamic Voronoi sites: Sites using Voronoi decomposition but with centres calculated dynamically based on framework atom positions.
Quick Start
from site_analysis.builders import TrajectoryBuilder
from pymatgen.io.vasp import Xdatcar
# Load MD trajectory from VASP XDATCAR file
# (This example uses the provided example_data/XDATCAR file.
# For your own analysis, replace with your trajectory file path
# and adjust the mobile species and site definitions accordingly.)
xdatcar = Xdatcar("example_data/XDATCAR")
md_structures = xdatcar.structures
# Define sites and track Li+ ion movements between them
trajectory = (TrajectoryBuilder()
.with_structure(md_structures[0]) # Use first frame as reference
.with_mobile_species("Li")
.with_spherical_sites(centres=[[0.25, 0.25, 0.25],
[0.75, 0.25, 0.25]],
radii=1.5)
.build())
trajectory.trajectory_from_structures(md_structures)
# Get site occupancies over time
print(trajectory.atoms_trajectory) # Which site each atom occupies
print(trajectory.sites_trajectory) # Which atoms in each site
For detailed examples and tutorials, see the documentation.
Installation
Standard Installation
pip install site-analysis
Development Installation
For development or to access the latest features:
# Clone the repository
git clone https://github.com/bjmorgan/site-analysis.git
cd site-analysis
# Install in development mode with dev dependencies
pip install -e ".[dev]"
Documentation
Complete documentation, including tutorials, examples, and API reference, is available at Read the Docs.
Testing
Automated testing of the latest build happens on GitHub Actions.
To run tests locally:
# Using pytest (recommended)
pytest
# Using unittest
python -m unittest discover
The code requires Python 3.10 or above.
Project details
Release history Release notifications | RSS feed
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 site_analysis-1.2.7.tar.gz.
File metadata
- Download URL: site_analysis-1.2.7.tar.gz
- Upload date:
- Size: 98.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7860882f4188fd84d035b26e7b5fa219405005cdb491d079cdda4ef00714755e
|
|
| MD5 |
2e697a66a65c32d6d9a171aef805ea4f
|
|
| BLAKE2b-256 |
eb0e72aa411482dd10043566db1678eb7fcd2ad5205ea261b128a252cb5b5162
|
Provenance
The following attestation bundles were made for site_analysis-1.2.7.tar.gz:
Publisher:
python-publish.yml on bjmorgan/site-analysis
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
site_analysis-1.2.7.tar.gz -
Subject digest:
7860882f4188fd84d035b26e7b5fa219405005cdb491d079cdda4ef00714755e - Sigstore transparency entry: 975733769
- Sigstore integration time:
-
Permalink:
bjmorgan/site-analysis@e5ad7ab9574c2d1179ba2069983011e469bcd1a5 -
Branch / Tag:
refs/tags/1.2.7 - Owner: https://github.com/bjmorgan
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@e5ad7ab9574c2d1179ba2069983011e469bcd1a5 -
Trigger Event:
release
-
Statement type:
File details
Details for the file site_analysis-1.2.7-py3-none-any.whl.
File metadata
- Download URL: site_analysis-1.2.7-py3-none-any.whl
- Upload date:
- Size: 61.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
eec6f3a639f564ab12874a54f88df6135cd5d10fba7eb9087ac968b212af0997
|
|
| MD5 |
2a73d8c192096f8b285ccaf50f980fb6
|
|
| BLAKE2b-256 |
ddbc8edb1577cd359e1932b161e43150a564d87ee93c099afab3a97bae70a583
|
Provenance
The following attestation bundles were made for site_analysis-1.2.7-py3-none-any.whl:
Publisher:
python-publish.yml on bjmorgan/site-analysis
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
site_analysis-1.2.7-py3-none-any.whl -
Subject digest:
eec6f3a639f564ab12874a54f88df6135cd5d10fba7eb9087ac968b212af0997 - Sigstore transparency entry: 975733771
- Sigstore integration time:
-
Permalink:
bjmorgan/site-analysis@e5ad7ab9574c2d1179ba2069983011e469bcd1a5 -
Branch / Tag:
refs/tags/1.2.7 - Owner: https://github.com/bjmorgan
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@e5ad7ab9574c2d1179ba2069983011e469bcd1a5 -
Trigger Event:
release
-
Statement type: