Skip to main content

graphatoms

Conda Version Conda Downloads Pypi version PyPI Downloads

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 indices
  • map_index(): Maps indices across arrays
  • index_to_mask(): Converts index arrays to boolean masks
  • maybe_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

Links

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

graphatoms-1.2.0.tar.gz (169.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

graphatoms-1.2.0-py3-none-any.whl (194.8 kB view details)

Uploaded Python 3

File details

Details for the file graphatoms-1.2.0.tar.gz.

File metadata

  • Download URL: graphatoms-1.2.0.tar.gz
  • Upload date:
  • Size: 169.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for graphatoms-1.2.0.tar.gz
Algorithm Hash digest
SHA256 4fe29ff252aba8cfd9d1fc786b2c26d7665f5c38d0ce9b052966c830bdaf5d6c
MD5 71e4a8cd20f3abfc2e22335a6f14cb32
BLAKE2b-256 c41a2565a2badb29d1f8b6b9d5f889585110f138f4e8238ecb8f0e10ba6cd7b4

See more details on using hashes here.

Provenance

The following attestation bundles were made for graphatoms-1.2.0.tar.gz:

Publisher: publish.yml on LiuGaoyong/GraphAtoms

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file graphatoms-1.2.0-py3-none-any.whl.

File metadata

  • Download URL: graphatoms-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 194.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for graphatoms-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 380bd176d29226a7981e35cfe6b8e35c55208d04f214af8136e5edd2860cd92c
MD5 d95ba64f56c829ab20a7e212871eb549
BLAKE2b-256 6e4dc0fb6d9552362aec8b38c735ee7838f22899d59edc3d8db89864e2607330

See more details on using hashes here.

Provenance

The following attestation bundles were made for graphatoms-1.2.0-py3-none-any.whl:

Publisher: publish.yml on LiuGaoyong/GraphAtoms

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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