graphatoms
The Chemical Core Class for Graph Theory Analysis.
Overview
The graphatoms is a Python library designed for chemical graph theory analysis. It provides core classes for representing chemical systems and reactions with graph-based data structures.
Features
- Graph-based Chemical System Representation: Represent chemical systems, clusters, and gas molecules using graph theory
- Reaction Modeling: Support for reaction classes, KMC (Kinetic Monte Carlo) events, and MC (Monte Carlo) moves
- Geometry Operations: Bond lists, distance calculations, neighbor lists, rotations, MIC (Minimum Image Convention), and sampling
- Data Storage: Support for HDF5 and SQLite databases for efficient data persistence
- Dataclasses: Pydantic-based data models for type-safe data handling
- Array API Compatibility: Full support for array API standard for cross-framework compatibility (NumPy, PyTorch, JAX, CuPy, etc.)
- Subgraph Operations: Backend-agnostic subgraph extraction with relabeling support using array-api-compat and array-api-extra
Module Structure
src/graphatoms/
├── arrayapi/ # Array API compatibility layer
├── dataclasses/ # Pydantic-based data models
├── geometry/ # Geometric operations
├── reaction/ # Reaction classes and KMC events
│ ├── base/ # Abstract base classes
│ ├── event/ # KMC events (adsorption, desorption, reaction)
│ ├── mcmove/ # Monte Carlo moves
│ ├── mdwarpper/ # MD wrapper
│ └── network/ # Reaction network
├── system/ # Core system classes
│ ├── atoms/ # Atomic structure handling
│ ├── database/ # Database storage backends
│ └── graph/ # Graph-based system representation
└── utils/ # Utility functions
└── subgraph.py # Array API compatible subgraph operations
Requirements
- Python >= 3.12
- ase
- pymatgen > 2023.6
- rdkit >= 2025
- scikit-learn >= 1.5
- array-api-compat >= 1.15.0
- array-api-extra >= 0.11.0
- pyarrow
- igraph >= 0.11
- h5py >= 3.16
- hydra-core
- numpy >= 2.0.0
- numpydantic
- ovld
- pydantic >= 2.10
- python-snappy >= 0.7.3
- loguru
Installation
pip install graphatoms
Or with conda:
conda install -c conda-forge graphatoms
Development
For development setup with pixi:
pixi install
pixi run test
Running Tests
Run all tests
pytest src/tests/ -v
Run benchmark tests
pytest src/tests-benchmark/ -v
Array API Compatibility
The library leverages array-api-compat and array-api-extra for backend-agnostic array operations. Key utilities include:
subgraph(): Extracts induced subgraphs from edge indicesmap_index(): Maps indices across arraysindex_to_mask(): Converts index arrays to boolean masksmaybe_num_nodes(): Determines the number of nodes from edge indices
These functions work seamlessly with NumPy, PyTorch, JAX, and other array API compliant libraries.
License
GPL-3.0-or-later
Authors
- LiuGaoyong (liugaoyong_88@163.com)
Links
- Homepage: https://github.com/LiuGaoyong/GraphAtoms
- Repository: https://github.com/LiuGaoyong/GraphAtoms
- Issues: https://github.com/LiuGaoyong/GraphAtoms/issues/
Metadata
Release files for graphatoms 1.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 | |
|---|---|---|---|
| graphatoms-1.2.2.tar.gz | 171.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| graphatoms-1.2.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 369.5 kB
Release files / graphatoms-1.2.2.tar.gz
| Download URL | graphatoms-1.2.2.tar.gz |
|---|---|
| Size | 171.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
caabc7bdb7c44d389a662d261d25d37c22c6f5d23a0bf452a89b2d4d45048410
|
|
BLAKE2b-256 checksum How to use checksums |
e0b2c7ded77a409622b0748ca88cc2e1ff26e57ce34fef02777ea4c1a7e849a8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 3, 2026.
Transparency logRelease files / graphatoms-1.2.2-py3-none-any.whl
| Download URL | graphatoms-1.2.2-py3-none-any.whl |
|---|---|
| Size | 197.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f3cadda9e108f0cef0fa046ea4622804bebc46e5000a5c3509a9abf9c61d67df
|
|
BLAKE2b-256 checksum How to use checksums |
9a249b699541bff0e4a01c3e1dd7cc50caa852cef0e49e64b7e0ba3dc4b23f17
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 3, 2026.
Transparency log