Skip to main content

A dispatcher-based analytical and computational suite for chemical physics

Project description

Table of Contents

About

img

Tests Linting Docs PyPI Python License: MIT One Good Tutorial docs checklist v1: adopted Benchmarks Hatch project DOI

A pure-python computational library and CLI toolkit for chemical physics research. rgpycrumbs provides both importable library modules for computational tasks (surface fitting, structure analysis, interpolation) and a dispatcher-based CLI for running self-contained research scripts.

Heavy optional dependencies (JAX, SciPy, ASE) are resolved lazily at first use. A bare pip install rgpycrumbs gives the full API surface; the actual backend libraries load on demand from the current environment, a shared cache, or (with RGPYCRUMBS_AUTO_DEPS=1) via automatic uv installation. CUDA-aware resolution avoids pulling GPU libraries on CPU-only machines.

The library side offers:

  • Surface fitting (rgpycrumbs.surfaces) – JAX-based kernel methods (TPS, RBF, Matern, SE, IMQ) with gradient-enhanced variants for energy landscape interpolation
  • Structure analysis (rgpycrumbs.geom.analysis) – distance matrices, bond matrices, and fragment detection via ASE
  • IRA matching (rgpycrumbs.geom.ira) – iterative rotations and assignments for RMSD-based structure comparison
  • Interpolation (rgpycrumbs.interpolation) – spline interpolation utilities
  • Data types (rgpycrumbs.basetypes) – shared data structures for NEB paths, saddle searches, and molecular geometries

The CLI tools rely on optional dependencies fetched on-demand via PEP 723 + uv.

Ecosystem Overview

rgpycrumbs is the central hub of an interlinked suite of libraries.

img

CLI Design Philosophy

The library is designed with the following principles in mind:

  • Dispatcher-Based Architecture: The top-level rgpycrumbs.cli command acts as a lightweight dispatcher. It does not contain the core logic of the tools itself. Instead, it parses user commands to identify the target script and then invokes it in an isolated subprocess using the uv runner. This provides a unified command-line interface while keeping the tools decoupled.

  • Isolated & Reproducible Execution: Each script is a self-contained unit that declares its own dependencies via PEP 723 metadata. The uv runner uses this information to resolve and install the exact required packages into a temporary, cached environment on-demand. This design guarantees reproducibility and completely eliminates the risk of dependency conflicts between different tools in the collection.

  • Lightweight Core, On-Demand Dependencies: The installable rgpycrumbs package has minimal core dependencies (click, numpy). Heavy scientific libraries are available as optional extras (e.g. pip install rgpycrumbs[surfaces] for JAX). For CLI tools, dependencies are fetched by uv only when a script that needs them is executed. For library modules, ensure_import resolves dependencies at first use when RGPYCRUMBS_AUTO_DEPS=1 is set, with CUDA-aware resolution that avoids pulling GPU libraries on CPU-only machines. The base installation stays lightweight either way.

  • Modular & Extensible Tooling: Each utility is an independent script. This modularity simplifies development, testing, and maintenance, as changes to one tool cannot inadvertently affect another. New tools can be added to the collection without modifying the core dispatcher logic, making the system easily extensible.

Usage

Library API

The library modules can be imported directly. Dependencies resolve automatically when RGPYCRUMBS_AUTO_DEPS=1 is set (requires uv on PATH), or install extras explicitly:

# Surface fitting (requires jax: pip install rgpycrumbs[surfaces])
from rgpycrumbs.surfaces import get_surface_model
model = get_surface_model("tps")

# Structure analysis (requires ase, scipy: pip install rgpycrumbs[analysis])
from rgpycrumbs.geom.analysis import analyze_structure

# Spline interpolation (requires scipy: pip install rgpycrumbs[interpolation])
from rgpycrumbs.interpolation import spline_interp

# Data types (no extra deps)
from rgpycrumbs.basetypes import nebpath, SaddleMeasure

CLI Tools

The general command structure is:

python -m rgpycrumbs.cli [subcommand-group] [script-name] [script-options]

You can see the list of available command groups:

$ python -m rgpycrumbs.cli --help
Usage: rgpycrumbs [OPTIONS] COMMAND [ARGS]...

  A dispatcher that runs self-contained scripts using 'uv'.

Options:
  --help  Show this message and exit.

Commands:
  eon  Dispatches to a script within the 'eon' submodule.

eOn

  • Plotting NEB Paths (plt-neb)

    This script visualizes the energy profile of Nudged Elastic Band (NEB) calculations over optimization steps.

    To see the help text for this specific script:

    $ python -m rgpycrumbs eon plt-neb --help
    --> Dispatching to: uv run /path/to/rgpycrumbs/eon/plt_neb.py --help
    Usage: plt_neb.py [OPTIONS]
    
      Plots a series of NEB energy paths from .dat files.
    ...
    Options:
      --input-pattern TEXT      Glob pattern for input data files.
      -o, --output-file PATH    Output file name.
      --start INTEGER           Starting file index to plot (inclusive).
      --end INTEGER             Ending file index to plot (exclusive).
      --help                    Show this message and exit.
    

    To plot a specific range of neb_*.dat files and save the output:

    python -m rgpycrumbs eon plt-neb --start 100 --end 150 -o final_path.pdf
    

    To show the plot interactively without saving:

    python -m rgpycrumbs eon plt-neb --start 280
    
  • Splitting CON files (con-splitter)

    This script takes a multi-image trajectory file (e.g., from a finished NEB calculation) and splits it into individual frame files, creating an input file for a new calculation.

    To split a trajectory file:

    rgpycrumbs eon con-splitter neb_final_path.con -o initial_images
    

    This will create a directory named initial_images containing ipath_000.con, ipath_001.con, etc., along with an ipath.dat file listing their paths.

Contributing

All contributions are welcome, but for the CLI tools please follow established best practices.

Development

This project uses uv as the primary development tool with hatchling + hatch-vcs for building and versioning.

# Clone and install in development mode with test dependencies
uv sync --extra test

# Run the pure tests (no heavy optional deps)
uv run pytest -m pure

# Run interpolation tests (needs scipy)
uv run --extra interpolation pytest -m interpolation

Branch Structure

Development happens on the main branch. The readme branch is an auto-generated orphan containing only the rendered README.md and branding assets; it is the GitHub default branch.

When is pixi needed?

Pixi is only needed for features that require conda-only packages (not available on PyPI):

  • fragments tests: need tblite, ira, pyvista (conda)
  • surfaces tests: may prefer conda jax builds

For everything else, uv is sufficient.

Versioning

Versions are derived automatically from git tags via hatch-vcs (setuptools-scm). There is no manual version field; the version is the latest tag (e.g. v1.0.01.0.0). Between tags, dev versions are generated automatically (e.g. 1.0.1.dev3+gabcdef).

Release Process

# 1. Ensure tests pass
uv run --extra test pytest -m pure

# 2. Build changelog (uses towncrier fragments in docs/newsfragments/)
uvx towncrier build --version "v1.0.0"

# 3. Commit the changelog
git add CHANGELOG.rst && git commit -m "doc: release notes for v1.0.0"

# 4. Tag the release (hatch-vcs derives the version from this tag)
git tag -a v1.0.0 -m "Version 1.0.0"

# 5. Build and publish
uv build
uvx twine upload dist/*

License

MIT. However, this is an academic resource, so please cite as much as possible via:

  • The Zenodo DOI for general use.
  • The wailord paper for ORCA usage

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

rgpycrumbs-1.3.0.tar.gz (89.2 kB view details)

Uploaded Source

Built Distribution

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

rgpycrumbs-1.3.0-py3-none-any.whl (107.9 kB view details)

Uploaded Python 3

File details

Details for the file rgpycrumbs-1.3.0.tar.gz.

File metadata

  • Download URL: rgpycrumbs-1.3.0.tar.gz
  • Upload date:
  • Size: 89.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.11

File hashes

Hashes for rgpycrumbs-1.3.0.tar.gz
Algorithm Hash digest
SHA256 24e9b5f5d6739464c566aaa4652c4df72e45b0f9294e0101cc9850777e259c29
MD5 fab119ee7576f01e4736ffdeca6616ca
BLAKE2b-256 29510019b36a567da741c77143a2356e6761de5cbe87319556da7ed27f14d5e8

See more details on using hashes here.

File details

Details for the file rgpycrumbs-1.3.0-py3-none-any.whl.

File metadata

  • Download URL: rgpycrumbs-1.3.0-py3-none-any.whl
  • Upload date:
  • Size: 107.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.11

File hashes

Hashes for rgpycrumbs-1.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 27d1c3d1df6570cefed54ec59c46794d4d1ab73a59e242ea6231324d07968c3c
MD5 ad3287e492003db779aaaa52c77cab01
BLAKE2b-256 431316951cf586fad2de62a56ee550c8c1fa9bacf80afb53b69f037932c4df17

See more details on using hashes here.

Supported by

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