### Layered TOML Configuration Setup Source: https://github.com/haozeke/rgpycrumbs/blob/main/docs/orgmode/howto/install.org Set up global and project-level TOML configuration files. The project file overrides the global one and is discovered by walking up from the current directory. ```bash # global mkdir -p ~/.config/rgpkgs cp docs/examples/rgpkgs.config.toml ~/.config/rgpkgs/config.toml # project (overrides global; walk-up from CWD) cp docs/examples/rgpkgs.config.toml ./rgpkgs.toml ``` -------------------------------- ### Test JAX installation Source: https://github.com/haozeke/rgpycrumbs/blob/main/docs/orgmode/howto/install.org Verify that JAX is working by importing FastTPS from rgpycrumbs.surfaces. ```bash python3 -c "from rgpycrumbs.surfaces import FastTPS; print('JAX working!')" ``` -------------------------------- ### Check uv and pip availability Source: https://github.com/haozeke/rgpycrumbs/blob/main/docs/orgmode/howto/install.org Verifies that uv or pip is installed to resolve 'Failed to install' errors. ```bash which uv which pip ``` -------------------------------- ### Quick Install with pip Source: https://github.com/haozeke/rgpycrumbs/blob/main/docs/orgmode/howto/install.org Install the rgpycrumbs package from PyPI using pip. ```bash pip install rgpycrumbs ``` -------------------------------- ### Verify installation with Python Source: https://github.com/haozeke/rgpycrumbs/blob/main/docs/orgmode/howto/install.org Check that rgpycrumbs is installed and print its version. ```bash python -c "import rgpycrumbs; print(rgpycrumbs.__version__)" ``` -------------------------------- ### Install JAX with CUDA support Source: https://github.com/haozeke/rgpycrumbs/blob/main/docs/orgmode/howto/install.org Install JAX with CUDA 12 or CUDA 11 for GPU-accelerated surface fitting. ```bash # CUDA 12 pip install "jax[cuda12]" # CUDA 11 pip install "jax[cuda11]" ``` -------------------------------- ### Install dependencies for surface fitting Source: https://github.com/haozeke/rgpycrumbs/blob/main/docs/orgmode/howto/install.org Install JAX and SciPy for Gaussian Process surface fitting. Use RGPYCRUMBS_AUTO_DEPS=1 to auto-install on first use, or use uv. ```bash # JAX for surface fitting, SciPy for its hyperparameter fits pip install jax scipy # or: export RGPYCRUMBS_AUTO_DEPS=1 # Or with uv uv pip install jax scipy # or: export RGPYCRUMBS_AUTO_DEPS=1 # Or enable auto-install (installs on first use) export RGPYCRUMBS_AUTO_DEPS=1 ``` -------------------------------- ### Install specific packages with pip Source: https://github.com/haozeke/rgpycrumbs/blob/main/docs/orgmode/howto/install.org Explicitly install optional dependencies like JAX, SciPy, and ASE when you prefer a controlled host environment. ```bash pip install jax scipy ase ``` -------------------------------- ### User installation for permission errors Source: https://github.com/haozeke/rgpycrumbs/blob/main/docs/orgmode/howto/install.org Uses pip install --user to avoid permission errors when auto-installing packages. ```bash export RGPYCRUMBS_AUTO_DEPS=1 pip install --user jax # or AUTO_DEPS ``` -------------------------------- ### Development setup and test commands with uv Source: https://github.com/haozeke/rgpycrumbs/blob/main/README.md Commands to clone and install the project in development mode with test dependencies, run pure tests, and run interpolation tests that require scipy. ```bash # 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 ``` -------------------------------- ### Enable auto-dependency resolution and test import Source: https://github.com/haozeke/rgpycrumbs/blob/main/docs/orgmode/quickstart.org Sets RGPYCRUMBS_AUTO_DEPS=1 to enable on-demand dependency installation via uv/pip. The example command imports FastTPS from rgpycrumbs.surfaces, which triggers automatic installation of jax. The resolver is CUDA-aware: on machines without an NVIDIA GPU it installs CPU-only variants (e.g. jax[cpu]) to avoid pulling unused CUDA libraries. ```bash export RGPYCRUMBS_AUTO_DEPS=1 python -c "from rgpycrumbs.surfaces import FastTPS" # jax installed automatically ``` -------------------------------- ### Install rgpycrumbs with pip or development setup Source: https://github.com/haozeke/rgpycrumbs/blob/main/docs/orgmode/tutorials/first-project.org Install the core package with all pip-available extras, or clone the repository and sync dependencies with uv for development. The pip command includes an optional environment variable export for auto-dependencies. ```bash # Core package with all pip-available extras pip install rgpycrumbs # + export RGPYCRUMBS_AUTO_DEPS=1 # Or for development git clone https://github.com/HaoZeke/rgpycrumbs cd rgpycrumbs uv sync --all-extras ``` -------------------------------- ### Enable auto-install temporarily Source: https://github.com/haozeke/rgpycrumbs/blob/main/docs/orgmode/howto/install.org Set RGPYCRUMBS_AUTO_DEPS=1 for the current session to auto-install optional dependencies on first use. ```bash export RGPYCRUMBS_AUTO_DEPS=1 python3 -c "from rgpycrumbs.surfaces import FastTPS" # Auto-installs JAX ``` -------------------------------- ### One-command auto-install prefix Source: https://github.com/haozeke/rgpycrumbs/blob/main/docs/orgmode/howto/install.org Prefix any command with RGPYCRUMBS_AUTO_DEPS=1 to enable auto-install for that single invocation. ```bash RGPYCRUMBS_AUTO_DEPS=1 python3 my_script.py ``` -------------------------------- ### Hard Dependency Example (JAX) Source: https://github.com/haozeke/rgpycrumbs/blob/main/docs/orgmode/dev/lazy_imports.org Shows the bad practice of importing JAX as a hard dependency, forcing all users to install it even if they only need basic plotting. ```python # BAD: Hard dependency import jax import jax.numpy as jnp def fit_surface(data): # Uses JAX ... ``` -------------------------------- ### Install and run tests with uv Source: https://github.com/haozeke/rgpycrumbs/blob/main/readme_src.org Install the project in development mode with test dependencies, then run pure tests and interpolation tests. The interpolation tests require scipy, which is not installed by default. ```bash uv sync --extra test ``` ```bash uv run pytest -m pure ``` ```bash uv run --extra interpolation pytest -m interpolation ``` -------------------------------- ### Enable auto-install via shell export Source: https://github.com/haozeke/rgpycrumbs/blob/main/docs/orgmode/howto/install.org Sets the RGPYCRUMBS_AUTO_DEPS environment variable to 1 in a shell session, then runs a Python script that uses JAX. JAX is automatically installed on first import. ```bash # Enable auto-install export RGPYCRUMBS_AUTO_DEPS=1 # Run script that uses JAX python3 my_gp_script.py # JAX is automatically installed on first import ``` -------------------------------- ### Install and check rgpycrumbs CLI Source: https://github.com/haozeke/rgpycrumbs/blob/main/AGENTS.md Install with uv sync and run the CLI help. Requires Python 3.10 or newer; CI uses --all-extras. ```bash uv sync --extra test # Python 3.10 or newer; CI uses --all-extras uv run rgpycrumbs --help ``` -------------------------------- ### Layered TOML Config Setup Source: https://github.com/haozeke/rgpycrumbs/blob/main/llms-full.txt Copy the example config to global and project locations. Project config overrides global; walk-up from CWD. ```bash # global mkdir -p ~/.config/rgpkgs cp docs/examples/rgpkgs.config.toml ~/.config/rgpkgs/config.toml # project (overrides global; walk-up from CWD) cp docs/examples/rgpkgs.config.toml ./rgpkgs.toml ``` -------------------------------- ### Enable auto-install in Jupyter Notebook Source: https://github.com/haozeke/rgpycrumbs/blob/main/docs/orgmode/howto/install.org Sets the RGPYCRUMBS_AUTO_DEPS environment variable in Python before importing FastTPS, which auto-installs JAX. ```python import os os.environ["RGPYCRUMBS_AUTO_DEPS"] = "1" from rgpycrumbs.surfaces import FastTPS # Auto-installs JAX ``` -------------------------------- ### PEP 723 script block for tool dependencies Source: https://github.com/haozeke/rgpycrumbs/blob/main/skills/rgpycrumbs-cli/SKILL.md Shows the required PEP 723 metadata block at the start of a tool script. The dispatcher copies the script to a temporary directory and runs `uv run --no-project --script COPY ARGS`, building and caching an environment with exactly these packages. Note that `--help` triggers the full dependency installation first. ```text # /// script # requires-python = ">=3.11" # dependencies = [ # "click", # "chemparseplot[neb,plot]>=1.9.17,<2", # "readcon>=0.17.1", # ] # # [tool.uv.sources] # readcon = { git = "https://github.com/lode-org/readcon-core", branch = "main" } # /// ``` -------------------------------- ### Enable auto-install in shell config Source: https://github.com/haozeke/rgpycrumbs/blob/main/docs/orgmode/howto/install.org Adds the RGPYCRUMBS_AUTO_DEPS environment variable to ~/.bashrc or ~/.zshrc to enable automatic installation of optional dependencies. ```bash # ~/.bashrc or ~/.zshrc export RGPYCRUMBS_AUTO_DEPS=1 ``` -------------------------------- ### Install JAX to fix ModuleNotFoundError Source: https://github.com/haozeke/rgpycrumbs/blob/main/docs/orgmode/howto/faq.org Install the JAX extra or enable auto-install to resolve the missing module error. ```bash pip install jax # or: export RGPYCRUMBS_AUTO_DEPS=1 ``` -------------------------------- ### Install rgpycrumbs Source: https://github.com/haozeke/rgpycrumbs/blob/main/llms-full.txt Installation commands: core package with pip and development setup with git clone and uv sync. ```bash # Core package with all pip-available extras pip install rgpycrumbs # + export RGPYCRUMBS_AUTO_DEPS=1 # Or for development git clone https://github.com/HaoZeke/rgpycrumbs cd rgpycrumbs uv sync --all-extras ``` -------------------------------- ### Set Up Environment with uv sync Source: https://github.com/haozeke/rgpycrumbs/blob/main/docs/orgmode/dev/contributing.org Install all dependencies and extras using uv sync with the --all-extras flag. ```bash uv sync --all-extras ``` -------------------------------- ### Run the scaffold check script Source: https://github.com/haozeke/rgpycrumbs/blob/main/skills/rgpycrumbs-add-tool/SKILL.md Copies the installed package into a temporary directory, adds a demo group with the example tool and other files, and verifies that the command list and PEP 723 block behave as expected. ```bash python scripts/scaffold_check.py ``` -------------------------------- ### Barrier script output example Source: https://github.com/haozeke/rgpycrumbs/blob/main/skills/rgpycrumbs-neb-plots/SKILL.md Example output from running `python scripts/barrier.py RUN_DIR` without an argument, which reads the tutorial run. It shows the last step, highest image, forward/reverse barriers, and the extremum from results.dat. ```text last step: neb_014.dat (22 images) highest image: 14 at rxn_coord 3.719925 A, energy 0.787659 eV forward barrier 0.787659 eV, reverse barrier 2.736130 eV, reaction energy -1.948471 eV results.dat: highest extremum 0.787749 eV above image 0, at image position 14.009070 ``` -------------------------------- ### Example test file structure Source: https://github.com/haozeke/rgpycrumbs/blob/main/docs/orgmode/dev/testing.org Shows the expected layout for test files under the tests/ directory, mirroring the package structure. ```text tests/ chemgp/test_chemgp_refactoring.py eon/test_eon_cli.py test_detect_fragments.py test_ensure_import.py test_lazy_import_coverage.py ``` -------------------------------- ### Preferred CLI Entry with Dispatcher Source: https://github.com/haozeke/rgpycrumbs/blob/main/docs/orgmode/howto/install.org Use the dispatcher as the primary CLI entry point instead of raw uv run. The dispatcher sets PYTHONPATH and defaults RGPYCRUMBS_AUTO_DEPS=1. ```bash rgpycrumbs eon plt-neb --help python -m rgpycrumbs.cli eon plt-neb --help ``` -------------------------------- ### Install JAX or enable auto-deps Source: https://github.com/haozeke/rgpycrumbs/blob/main/docs/orgmode/howto/troubleshooting.org Install JAX for surface fitting, or enable auto-installation of dependencies via the RGPYCRUMBS_AUTO_DEPS environment variable. ```bash pip install jax # or: export RGPYCRUMBS_AUTO_DEPS=1 # Or enable auto-install export RGPYCRUMBS_AUTO_DEPS=1 ``` -------------------------------- ### Serve documentation locally with pixi run docserve Source: https://github.com/haozeke/rgpycrumbs/blob/main/docs/orgmode/contributing/doc_builds.org Starts a local documentation server. Visit localhost:8000 in the browser to preview the built docs. ```bash pixi run docserve ``` -------------------------------- ### Using nebpath and SaddleMeasure from rgpycrumbs.basetypes Source: https://github.com/haozeke/rgpycrumbs/blob/main/docs/orgmode/quickstart.org Shows how to store a NEB path snapshot with nebpath and track saddle search results with SaddleMeasure. The SaddleMeasure example records pes_calls, success, barrier, and method. ```python from rgpycrumbs.basetypes import nebpath, SaddleMeasure # Store a NEB path snapshot path = nebpath( norm_dist=[0.0, 0.25, 0.5, 0.75, 1.0], arc_dist=[0.0, 1.2, 2.4, 3.6, 4.8], energy=[0.0, -0.5, 0.3, -0.2, 0.0], ) # Track saddle search results result = SaddleMeasure( pes_calls=142, success=True, barrier=0.35, method="gprdimer", ) ``` -------------------------------- ### rgpycrumbs --help Source: https://github.com/haozeke/rgpycrumbs/blob/main/docs/orgmode/quickstart.org Displays the list of available CLI commands for the rgpycrumbs dispatcher. ```APIDOC ## rgpycrumbs --help ### Description Displays the list of available CLI commands for the rgpycrumbs dispatcher. ### Method CLI ### Endpoint `rgpycrumbs --help` ### Request Example ```bash rgpycrumbs --help ``` ``` -------------------------------- ### Disable auto-install Source: https://github.com/haozeke/rgpycrumbs/blob/main/docs/orgmode/howto/install.org Disables auto-install by setting RGPYCRUMBS_AUTO_DEPS=0 or unsetting it. Accepts true/yes/on and false/no/off, case-insensitive; any other value counts as unset. ```bash export RGPYCRUMBS_AUTO_DEPS=0 # Or unset unset RGPYCRUMBS_AUTO_DEPS ``` -------------------------------- ### Catch specific ImportError for optional dependencies Source: https://github.com/haozeke/rgpycrumbs/blob/main/docs/orgmode/dev/best_practices.org Catch specific exceptions when importing optional dependencies. The example catches ImportError and prints an installation hint. ```python try: module = ensure_import("jax") except ImportError as e: print(f"Install with: pip install jax # or AUTO_DEPS") ``` -------------------------------- ### Run pure tests with uv Source: https://github.com/haozeke/rgpycrumbs/blob/main/docs/orgmode/dev/testing.org Runs the 'pure' test marker using uv with the 'test' extra. Requires the 'test' extra to be installed. ```bash uv run --extra test pytest -m pure ``` -------------------------------- ### Install rgpycrumbs and optional backends Source: https://github.com/haozeke/rgpycrumbs/blob/main/docs/orgmode/tutorials/neb-visualization.org Install the rgpycrumbs package. Library/CLI plot paths enable AUTO_DEPS by default (jax, chemparseplot, xyzrender, adjustText via ensure_import + uv on PATH). Optional explicit backends only if needed: solvis-tools for strip_renderer=solvis, and ovito via conda-forge or separate heavy install. ```bash pip install rgpycrumbs # Library/CLI plot paths enable AUTO_DEPS by default (jax, chemparseplot, # xyzrender, adjustText via ensure_import + uv on PATH). # Optional explicit backends only if you need them: # pip install solvis-tools # strip_renderer=solvis # # ovito: conda-forge / separate heavy install ``` -------------------------------- ### Install plot stack from PyPI with uv Source: https://github.com/haozeke/rgpycrumbs/blob/main/skills/rgpycrumbs-neb-plots/SKILL.md Use this command to install the plotting dependencies from PyPI into the running environment. It requires uv on PATH and installs chemparseplot, readcon, matplotlib, scipy, jax, adjustText, cmcrameri, ase, polars, h5py, and xyzrender. After installation, the dispatcher runs plt-neb in place and prints '--> Using active interpreter'. ```bash uv run --with "chemparseplot[neb,plot]>=1.13" --with "readcon>=0.17.1" \ --with matplotlib --with scipy --with jax --with "adjustText>=1.0" \ --with cmcrameri --with ase --with polars --with h5py \ --with "xyzrender>=0.1.3" \ rgpycrumbs eon plt-neb ... ``` -------------------------------- ### Dependency map example Source: https://github.com/haozeke/rgpycrumbs/blob/main/llms-full.txt Maps module names to pip install specifications, used by ensure_import for auto-install. ```python _DEPENDENCY_MAP: dict[str, str] = { "jax": "jax>=0.4", "scipy": "scipy>=1.11", "ase": "ase>=3.22", # ... } ``` -------------------------------- ### Example: Run pure tests Source: https://github.com/haozeke/rgpycrumbs/blob/main/docs/orgmode/contributing/test_requirements.org Runs the 'pure' test suite in the 'test' environment. ```bash pixi run -e test pytest -m pure ``` -------------------------------- ### Example: Run fragments tests Source: https://github.com/haozeke/rgpycrumbs/blob/main/docs/orgmode/contributing/test_requirements.org Runs the 'fragments' test suite in the 'fragments' environment. ```bash pixi run -e fragments pytest -m fragments ``` -------------------------------- ### Install Specific Packages Explicitly Source: https://github.com/haozeke/rgpycrumbs/blob/main/llms-full.txt Install jax, scipy, and ase manually when you prefer an explicit host environment. ```bash pip install jax scipy ase ``` -------------------------------- ### Example: Run align tests Source: https://github.com/haozeke/rgpycrumbs/blob/main/docs/orgmode/contributing/test_requirements.org Runs the 'align' test suite in the 'test' environment. ```bash pixi run -e test pytest -m align ``` -------------------------------- ### Install pixi environment Source: https://github.com/haozeke/rgpycrumbs/blob/main/docs/orgmode/contributing/test_requirements.org Run this command to install the project's isolated pixi environment. ```shell pixi install ``` -------------------------------- ### Set Lock File via Environment Variable Source: https://github.com/haozeke/rgpycrumbs/blob/main/docs/orgmode/howto/install.org Configure the lock file path using environment variables. The dispatcher honors an optional Python lock from the uv resolver. Formats are auto-detected: uv.lock, pylock.toml, or CycloneDX JSON. ```bash # Any of: uv.lock | pylock.toml | CycloneDX JSON export RGPKGS_LOCK=/path/to/uv.lock # or: RGPKGS_LOCK=pylock.toml # or: RGPYCRUMBS_SBOM=stack.cdx.json # alias for --sbom rgpycrumbs --lock "$RGPKGS_LOCK" eon plt-neb ... ``` -------------------------------- ### Setup Development Environment with uv Source: https://github.com/haozeke/rgpycrumbs/blob/main/docs/orgmode/dev/index.org Clones the rgpycrumbs repository, changes into the directory, and syncs all extras using uv. Run this before developing or testing. ```bash git clone https://github.com/HaoZeke/rgpycrumbs cd rgpycrumbs uv sync --all-extras ``` -------------------------------- ### Verify Installation Source: https://github.com/haozeke/rgpycrumbs/blob/main/llms-full.txt Prints the installed rgpycrumbs version. ```bash python -c "import rgpycrumbs; print(rgpycrumbs.__version__)" ``` -------------------------------- ### Install JAX with CUDA Support Source: https://github.com/haozeke/rgpycrumbs/blob/main/llms-full.txt Install JAX with CUDA 12 or CUDA 11 for GPU-accelerated surface fitting. ```bash # CUDA 12 pip install "jax[cuda12]" # CUDA 11 pip install "jax[cuda11]" ``` -------------------------------- ### Download sample NEB data Source: https://github.com/haozeke/rgpycrumbs/blob/main/docs/orgmode/tutorials/first-project.org Download and extract sample NEB calculation output files (neb_*.dat and path.con) needed for the tutorial. ```bash wget https://example.com/sample-neb-data.tar.gz tar xzf sample-neb-data.tar.gz cd sample-neb-data ``` -------------------------------- ### Install JAX and SciPy for Surface Fitting Source: https://github.com/haozeke/rgpycrumbs/blob/main/llms-full.txt Install JAX and SciPy for Gaussian Process surface fitting. Alternatively enable auto-install with RGPYCRUMBS_AUTO_DEPS=1. ```bash # JAX for surface fitting, SciPy for its hyperparameter fits pip install jax scipy # or: export RGPYCRUMBS_AUTO_DEPS=1 # Or with uv uv pip install jax scipy # or: export RGPYCRUMBS_AUTO_DEPS=1 # Or enable auto-install (installs on first use) export RGPYCRUMBS_AUTO_DEPS=1 ``` -------------------------------- ### nebpath Source: https://github.com/haozeke/rgpycrumbs/blob/main/docs/orgmode/quickstart.org A lightweight container for storing a NEB path snapshot, including normalized and arc distances along with energies. ```APIDOC ## nebpath ### Description A lightweight container for storing a NEB path snapshot, including normalized and arc distances along with energies. ### Parameters - `norm_dist` (list) - Required - Normalized distances along the path. - `arc_dist` (list) - Required - Arc distances along the path. - `energy` (list) - Required - Energy values at each point. ### Request Example ```python from rgpycrumbs.basetypes import nebpath path = nebpath( norm_dist=[0.0, 0.25, 0.5, 0.75, 1.0], arc_dist=[0.0, 1.2, 2.4, 3.6, 4.8], energy=[0.0, -0.5, 0.3, -0.2, 0.0], ) ``` ``` -------------------------------- ### User Installation for Permission Errors Source: https://github.com/haozeke/rgpycrumbs/blob/main/llms-full.txt Use user installation to avoid permission errors when auto-installing dependencies. ```bash export RGPYCRUMBS_AUTO_DEPS=1 pip install --user jax # or AUTO_DEPS ``` -------------------------------- ### Example: Run surfaces tests Source: https://github.com/haozeke/rgpycrumbs/blob/main/docs/orgmode/contributing/test_requirements.org Runs the 'surfaces' test suite in the 'surfaces' environment. ```bash pixi run -e surfaces pytest -m surfaces ``` -------------------------------- ### Install uv via curl Source: https://github.com/haozeke/rgpycrumbs/blob/main/docs/orgmode/howto/troubleshooting.org Install the uv tool using the official installer script, required for PEP 723 scripts. ```bash curl -LsSf https://astral.sh/uv/install.sh | sh ``` -------------------------------- ### Surface Fitting Without Pre-Installation Source: https://github.com/haozeke/rgpycrumbs/blob/main/llms-full.txt Enable auto-install and run a script that uses JAX; JAX is automatically installed on first import. ```bash # Enable auto-install export RGPYCRUMBS_AUTO_DEPS=1 # Run script that uses JAX python3 my_gp_script.py # JAX is automatically installed on first import ``` -------------------------------- ### Install core package with pip Source: https://github.com/haozeke/rgpycrumbs/blob/main/llms-full.txt Installs the core package. Optional dependencies (jax, scipy, ase) are resolved on demand when first used, provided uv is on PATH and auto-resolution is enabled. ```bash pip install rgpycrumbs ``` -------------------------------- ### CLI: Using a Product Reference Source: https://github.com/haozeke/rgpycrumbs/blob/main/docs/orgmode/tools/eon/plt_saddle.org Uses (initial, product) as the reference pair instead of the default (initial, saddle), showing the full reaction path context. ```shell rgpycrumbs eon plt-saddle --job-dir results/ --plot-type landscape --ref-product product.con ``` -------------------------------- ### Plot NEB energy profiles from eOn .dat files Source: https://github.com/haozeke/rgpycrumbs/blob/main/docs/orgmode/quickstart.org Plots NEB energy profiles from eOn .dat files using the rgpycrumbs eon plt-neb command. The first example plots iterations 100-150 and saves to neb_profile.pdf; the second creates an interactive plot of the latest iterations starting at 280. ```bash # Plot NEB energy profiles from eOn .dat files (iterations 100-150) rgpycrumbs eon plt-neb --start 100 --end 150 -o neb_profile.pdf # Interactive plot of the latest iterations rgpycrumbs eon plt-neb --start 280 ``` -------------------------------- ### Import surface model with auto dependencies Source: https://github.com/haozeke/rgpycrumbs/blob/main/readme_src.org Import the TPS surface model from the rgpycrumbs library. Set RGPYCRUMBS_AUTO_DEPS=1 to resolve dependencies automatically (requires uv on PATH), or install jax explicitly with pip install jax. ```python # Surface fitting (requires jax: pip install jax # or AUTO_DEPS) from rgpycrumbs.surfaces import get_surface_model model = get_surface_model("tps") ``` -------------------------------- ### Install rgpycrumbs via pip Source: https://github.com/haozeke/rgpycrumbs/blob/main/docs/orgmode/tutorials/saddle-search-visualization.org Placeholder description. ```bash pip install rgpycrumbs # plot heavies via library AUTO_DEPS / ensure_import ``` -------------------------------- ### Batch Output Example Source: https://github.com/haozeke/rgpycrumbs/blob/main/docs/orgmode/tools/chemgp/batch_command.org Example output from the batch command showing success and failure messages. The batch continues processing remaining plots if one fails. Exit code is 1 if any plots failed, 0 if all succeeded. ```text [OK] reaction1_surface.pdf [FAIL] reaction2_convergence.pdf: Input not found: ./data/reaction2.h5 [OK] reaction3_quality.pdf Batch complete: 2 ok, 1 failed ``` -------------------------------- ### Install rgpycrumbs via pip Source: https://github.com/haozeke/rgpycrumbs/blob/main/docs/orgmode/howto/troubleshooting.org Install the rgpycrumbs package in the current Python environment to resolve 'ModuleNotFoundError: No module named rgpycrumbs'. ```bash python -m pip install rgpycrumbs ``` -------------------------------- ### List available CLI commands with rgpycrumbs --help Source: https://github.com/haozeke/rgpycrumbs/blob/main/docs/orgmode/quickstart.org Displays the available commands for the rgpycrumbs CLI, which uses a PEP 723 dispatcher that runs each script in an isolated uv environment. ```bash rgpycrumbs --help ``` -------------------------------- ### CLI command with click Source: https://github.com/haozeke/rgpycrumbs/blob/main/docs/orgmode/dev/best_practices.org Use click for CLI commands. The example defines a command with a required --input option. ```python import click @click.command() @click.option("--input", "-i", required=True) def my_command(input): """My CLI command.""" ... ``` -------------------------------- ### Run rgpycrumbs with auto-install enabled Source: https://github.com/haozeke/rgpycrumbs/blob/main/docs/orgmode/howto/faq.org Prefix the command with the environment variable to enable auto-install for the current invocation. ```bash RGPYCRUMBS_AUTO_DEPS=1 rgpycrumbs chemgp ... ``` -------------------------------- ### Cache location for auto-installed packages Source: https://github.com/haozeke/rgpycrumbs/blob/main/docs/orgmode/howto/install.org Auto-installed packages are cached in ~/.cache/rgpycrumbs/deps/, shared across all Python environments. ```bash ~/.cache/rgpycrumbs/deps/ ``` -------------------------------- ### Run list_tools and dispatch_demo scripts Source: https://github.com/haozeke/rgpycrumbs/blob/main/skills/rgpycrumbs-cli/SKILL.md Run these scripts to verify command registration and dispatch behavior. list_tools prints every command with its script, Python requirement, dependency count, and git sources; it fails on missing scripts or mismatched command lists. dispatch_demo creates a scratch project with rgpkgs.toml and pylock.toml, runs rgpycrumbs config show and rgpycrumbs --dev -v uma aoti-cache list, and checks their output. ```bash python scripts/list_tools.py python scripts/dispatch_demo.py ``` -------------------------------- ### Install full stack with pixi Source: https://github.com/haozeke/rgpycrumbs/blob/main/llms-full.txt Resolves the full project stack, including pixi-only packages like tblite and ira_mod, plus heavier optional tools such as ovito. ```bash pixi install ``` -------------------------------- ### Run the Script (Bash) Source: https://github.com/haozeke/rgpycrumbs/blob/main/docs/orgmode/tutorials/first-project.org Executes the Python script that evaluates, plots, and analyzes the energy profile. Run from the directory containing first_project.py. ```bash python first_project.py ``` -------------------------------- ### Evaluate, Plot, and Analyze Energy Profile (Python) Source: https://github.com/haozeke/rgpycrumbs/blob/main/docs/orgmode/tutorials/first-project.org Evaluates the fitted Matérn model on a fine grid, plots the NEB energy profile with 95% confidence interval, and prints the barrier height in eV. Requires the model and path objects from earlier steps in the tutorial. ```python # 3. Evaluate x_fine = np.linspace(x_obs.min(), x_obs.max(), 300).reshape(-1, 1) y_fine = model(x_fine) y_var = model.predict_var(x_fine) # 4. Plot fig, ax = plt.subplots(figsize=(4, 3), dpi=300) ax.plot( path.arc_dist.to("angstrom").magnitude, path.energy.to("eV").magnitude, 'o', color='#004D40', markersize=6, label='NEB images', zorder=10 ) ax.plot( x_fine.flatten(), y_fine * 27.2114, '-', color='#FF655D', linewidth=2, label='Matérn fit', zorder=5 ) ax.fill_between( x_fine.flatten(), (y_fine - 2*np.sqrt(y_var)) * 27.2114, (y_fine + 2*np.sqrt(y_var)) * 27.2114, alpha=0.2, color='#FF655D', label='95% CI' ) ax.set_xlabel('Reaction Coordinate (Å)') ax.set_ylabel('Energy (eV)') ax.legend(frameon=False, loc='upper right') fig.tight_layout() fig.savefig('energy_profile.pdf', bbox_inches='tight') # 5. Analyze ts_idx = np.argmax(y_fine) print(f"Barrier: {(y_fine[ts_idx] - y_fine[0]) * 27.2114:.3f} eV") ``` -------------------------------- ### Install OVITO Python module via conda Source: https://github.com/haozeke/rgpycrumbs/blob/main/docs/orgmode/tutorials/rendering-backends.org Installs the OVITO Python module from OVITO's own conda channel. The ovito package on conda-forge is a retired desktop build without the Python module; since 3.17.2 the desktop app is ovito-pro. In an rgpycrumbs checkout, pixi install -e ptm sets up an environment with the module. ```shell conda install --strict-channel-priority -c https://conda.ovito.org -c conda-forge ovito ``` -------------------------------- ### Set RGPYCRUMBS_AUTO_DEPS in GitHub Actions CI Source: https://github.com/haozeke/rgpycrumbs/blob/main/docs/orgmode/howto/install.org Configures the RGPYCRUMBS_AUTO_DEPS environment variable in a GitHub Actions workflow step so that pytest runs with auto-install enabled. ```yaml # .github/workflows/ci.yml - name: Run tests env: RGPYCRUMBS_AUTO_DEPS: "1" run: pytest ``` -------------------------------- ### Calculate barriers and print results Source: https://github.com/haozeke/rgpycrumbs/blob/main/docs/orgmode/tutorials/first-project.org Computes forward and reverse barriers from transition state and reactant/product energies, then prints the transition state position, barriers, and reaction energy. ```python # Calculate barriers forward_barrier = ts_energy - reactant_energy reverse_barrier = ts_energy - product_energy print(f"Transition state at: {ts_x:.2f} Å") print(f"Forward barrier: {forward_barrier:.3f} eV") print(f"Reverse barrier: {reverse_barrier:.3f} eV") print(f"Reaction energy: {product_energy - reactant_energy:.3f} eV") ``` -------------------------------- ### Build docs with pixi r docbld Source: https://github.com/haozeke/rgpycrumbs/blob/main/AGENTS.md Runs genfigs in the test environment, exports Org files to docs/source/*.rst via emacs --batch --load export.el, then builds the site with sphinx-build. On first use, fetches ox-rst from MELPA. The .rst files are generated and ignored by git. ```bash pixi r docbld ``` -------------------------------- ### Enable auto-deps for chemgp Source: https://github.com/haozeke/rgpycrumbs/blob/main/docs/orgmode/howto/troubleshooting.org Set the RGPYCRUMBS_AUTO_DEPS environment variable to enable automatic installation of ase and scipy via ensure_import, resolving the missing chemgp module. ```bash export RGPYCRUMBS_AUTO_DEPS=1 # ase/scipy via ensure_import ``` -------------------------------- ### Refresh llms-full.txt with build_llms.py Source: https://github.com/haozeke/rgpycrumbs/blob/main/AGENTS.md Run after editing the manual to regenerate llms-full.txt. Settings are in scripts/llms/llms.toml. ```bash python scripts/llms/build_llms.py ``` -------------------------------- ### Run test suites with uv and pixi Source: https://github.com/haozeke/rgpycrumbs/blob/main/AGENTS.md Commands for running the CI test jobs defined in .github/workflows/ci_test.yml, ci_doctest.yml, and ci_tutorials.yml. Markers are declared in pyproject.toml; modules with missing packages skip themselves. ```bash uv run --extra test pytest -m pure uv run --extra test pytest --pep723-check -m pep723 \ --override-ini="python_files=" --ignore=rgpycrumbs/chemgp rgpycrumbs/ uv run --extra test --with "scipy>=1.11" pytest -m interpolation uv run --extra test --with "ase>=3.22" --with "scipy>=1.11" pytest -m align pixi r -e fragments pytest -m fragments pixi r -e surfaces pytest -m surfaces uv run --extra test python3 scripts/run_org_doctests.py docs/orgmode/tutorials/*.org ``` -------------------------------- ### Generate initial path from generic XYZ file Source: https://github.com/haozeke/rgpycrumbs/blob/main/docs/orgmode/tools/eon/con_splitter.org Command to convert a reactant/product pair from a generic .xyz file into eOn format, fixing coordinate and mapping issues. Uses --images-per-path 2, --box-diagonal, --center, --align-type endpoints, --use-ira, and --ira-kmax 1.8. ```bash python -m rgpycrumbs.cli eon con-splitter --images-per-path 2 initial.xyz --box-diagonal 25 25 25 --center --align-type endpoints --use-ira --ira-kmax 1.8 ``` -------------------------------- ### Plot NEB or ConFrame list with plot() Source: https://github.com/haozeke/rgpycrumbs/blob/main/docs/orgmode/quickstart.org Commented-out examples showing how to call plot() on a NEB object or a ConFrame list, optionally specifying plot_type and output_file. Use config="plot.toml" for strip/surface-fit settings. ```python # Live pyeonclient objects or ConFrame lists # plot(neb, plot_type="profile", output_file="1d.pdf") # plot(frames, kind="neb", plot_type="profile", output_file="1d.pdf") ``` -------------------------------- ### Build documentation locally with pixi run docbld Source: https://github.com/haozeke/rgpycrumbs/blob/main/docs/orgmode/contributing/doc_builds.org Run the local documentation build. The build fails on any Sphinx warning; sphinxbld runs sphinx-build -W --keep-going, which lists every warning before failing. ```shell pixi run docbld ``` -------------------------------- ### CLI: Using a Product Reference Source: https://github.com/haozeke/rgpycrumbs/blob/main/llms-full.txt Uses (initial, product) as the two references instead of (initial, saddle), showing the full reaction path context. ```shell rgpycrumbs eon plt-saddle --job-dir results/ --plot-type landscape --ref-product product.con ``` -------------------------------- ### Spline interpolation of a coarse energy profile Source: https://github.com/haozeke/rgpycrumbs/blob/main/docs/orgmode/quickstart.org Interpolates a coarse energy profile along a reaction coordinate to 200 points using spline_interp. Leave out num to get a grid derived from the samples; the default cubic spline has 3 * (len(rc) - 1) + 1 points and passes through every sample of an evenly spaced rc. ```python # Coarse energy profile along a reaction coordinate rc = np.linspace(0, 1, 10) energy = np.array([0.0, -0.3, -0.8, -1.0, -0.5, 0.2, 0.8, 0.5, -0.1, 0.0]) # Interpolate to 200 points rc_fine, energy_fine = spline_interp(rc, energy, num=200) ``` -------------------------------- ### Install rgpycrumbs with uv or pip Source: https://github.com/haozeke/rgpycrumbs/blob/main/docs/source/llms.txt Install the rgpycrumbs package using either uv add or pip install. The uv command is the recommended modern package manager, while pip is the standard Python installer. ```sh uv add rgpycrumbs # or pip install rgpycrumbs ``` -------------------------------- ### Load NEB Data and Access Path Source: https://github.com/haozeke/rgpycrumbs/blob/main/docs/orgmode/tutorials/first-project.org Loads the final iteration data from 'neb_49.dat' using extract_neb_data, then accesses the NEB path and prints the number of images and the energy barrier in eV. Requires sample NEB data files; marked with SKIP-DOCTEST. ```python # SKIP-DOCTEST -- requires sample NEB data files from rgpycrumbs.basetypes import nebpath from rgpycrumbs.eon.plt_neb import extract_neb_data import matplotlib.pyplot as plt # Load the final iteration data data = extract_neb_data("neb_49.dat") # Last iteration # Access the path path = data.nebpath print(f"Number of images: {len(path.energy)}") print(f"Barrier: {max(path.energy) - min(path.energy):.4f} eV") ``` -------------------------------- ### Full ASV run with sample recording Source: https://github.com/haozeke/rgpycrumbs/blob/main/docs/orgmode/devnotes.org Run a full ASV benchmark with sample recording, using the pixi-managed Python via the -E "existing:..." flag. Results land in .asv/results/ (gitignored). ```bash pixi run -e bench asv run \ -E "existing:$(pixi run -e bench which python)" \ --record-samples ``` -------------------------------- ### Install rgpycrumbs with JAX Source: https://github.com/haozeke/rgpycrumbs/blob/main/docs/orgmode/howto/faq.org Install the package and optionally JAX. The comment shows an alternative: set RGPYCRUMBS_AUTO_DEPS=1 to auto-install JAX. ```bash pip install rgpycrumbs pip install jax # or: export RGPYCRUMBS_AUTO_DEPS=1 # With JAX ``` -------------------------------- ### Install rgpycrumbs with pip and JAX Source: https://github.com/haozeke/rgpycrumbs/blob/main/llms-full.txt Install the rgpycrumbs package and optionally JAX. The comment shows an alternative to install JAX via the RGPYCRUMBS_AUTO_DEPS environment variable. ```bash pip install rgpycrumbs pip install jax # or: export RGPYCRUMBS_AUTO_DEPS=1 # With JAX ``` -------------------------------- ### Type Hint Example for ensure_import Source: https://github.com/haozeke/rgpycrumbs/blob/main/llms-full.txt Example of a type-hinted function with a docstring, targeting 90%+ coverage. ```python def ensure_import(module_name: str): """Import module through 5-step priority chain.""" ... ``` -------------------------------- ### Single Environment (uv): sync and run pure tests Source: https://github.com/haozeke/rgpycrumbs/blob/main/docs/orgmode/howto/dev_testing.org For basic development with uv, sync the test extra and run the pure test marker. Use this when you only need the core test environment without optional dependency sets. ```shell cd rgpycrumbs uv sync --extra test uv run pytest tests/ -m pure ``` -------------------------------- ### Type Hint Example for ensure_import Source: https://github.com/haozeke/rgpycrumbs/blob/main/docs/orgmode/dev/contributing.org Example of a type-hinted function with a docstring, targeting 90%+ type hint coverage. ```python def ensure_import(module_name: str): """Import module through 5-step priority chain.""" ... ``` -------------------------------- ### Plot with custom file prefix using --prefix Source: https://github.com/haozeke/rgpycrumbs/blob/main/docs/orgmode/tutorials/minimization-visualization.org Use --prefix to match files with a custom prefix, like qm_min, for minimization jobs. The example shows plotting a profile from a job directory with the prefix qm_min. ```shell # For jobs with qm_min, qm_min.dat, qm_min.con rgpycrumbs eon plt-min --job-dir job/ --prefix qm_min --plot-type profile ``` -------------------------------- ### Band evolution with --show-evolution Source: https://github.com/haozeke/rgpycrumbs/blob/main/docs/orgmode/tutorials/neb-visualization.org Plots band evolution where older bands are drawn with lower opacity. Uses --show-evolution to enable the fading effect. ```shell rgpycrumbs eon plt-neb \ --plot-type landscape --landscape-mode path --no-project-path \ --con-file data/diels_alder/neb.con \ --show-evolution \ -o evolution.pdf ``` -------------------------------- ### Fit Smooth Surface with get_surface_model Source: https://github.com/haozeke/rgpycrumbs/blob/main/docs/orgmode/tutorials/first-project.org Fits a gradient-enhanced Matérn surface to 1D NEB data using get_surface_model('matern'), converts energies to hartree, and evaluates the model on a fine grid for smooth plotting. Includes uncertainty estimation via predict_var. Requires sample NEB data files; marked with SKIP-DOCTEST. Troubleshooting: use 'tps' kernel for stability, adjust 'ls' for data smoothness, and increase 'smoothing' to 1e-3 if needed. ```python # SKIP-DOCTEST -- requires sample NEB data files from rgpycrumbs.surfaces import get_surface_model import numpy as np # Prepare 1D data for surface fitting x_obs = path.arc_dist.reshape(-1, 1) # Arc distance as 2D array y_obs = path.energy.to("hartree").magnitude # Convert to hartree # Fit a gradient-enhanced Matérn surface # (Use standard Matern if you don't have force data) model = get_surface_model("matern")( x_obs, y_obs, ls=0.5, # Initial length scale guess smoothing=1e-4 # Noise regularization ) # Evaluate on a fine grid for smooth plotting x_fine = np.linspace(x_obs.min(), x_obs.max(), 300).reshape(-1, 1) y_fine = model(x_fine) # Get uncertainty estimates y_var = model.predict_var(x_fine) ``` -------------------------------- ### Enable auto-install with RGPYCRUMBS_AUTO_DEPS Source: https://github.com/haozeke/rgpycrumbs/blob/main/docs/orgmode/howto/faq.org Set the environment variable to enable automatic dependency installation. ```bash export RGPYCRUMBS_AUTO_DEPS=1 ``` -------------------------------- ### Install dependencies for batch plotting Source: https://github.com/haozeke/rgpycrumbs/blob/main/llms-full.txt Install required packages: rgpycrumbs, chemparseplot, h5py, and plotnine. Needed before running the batch command. ```bash pip install rgpycrumbs chemparseplot h5py plotnine ``` -------------------------------- ### Visualize NEB path convergence with CLI Source: https://github.com/haozeke/rgpycrumbs/blob/main/docs/orgmode/tutorials/first-project.org Run the rgpycrumbs CLI to plot energy vs. iteration for each image from the eOn NEB output. Use --start and --end to select the iteration range and -o to specify the output PDF. If the plot is empty, check that neb_*.dat files exist and contain energy data in column 2. ```bash python -m rgpycrumbs.cli eon plt-neb --start 0 --end 50 -o neb_convergence.pdf ``` -------------------------------- ### Serve built documentation with Python HTTP server Source: https://github.com/haozeke/rgpycrumbs/blob/main/docs/orgmode/contributing/doc_builds.org Serve the generated documentation from docs/build/ using Python's built-in HTTP server. ```bash python -m http.server -d docs/build ``` -------------------------------- ### Install rgpycrumbs Source: https://github.com/haozeke/rgpycrumbs/blob/main/llms-full.txt Install the rgpycrumbs package via pip. The library's AUTO_DEPS / ensure_import mechanism handles plotting dependencies. ```bash pip install rgpycrumbs # plot heavies via library AUTO_DEPS / ensure_import ``` -------------------------------- ### Catch specific ImportError with install hint Source: https://github.com/haozeke/rgpycrumbs/blob/main/llms-full.txt Catch ImportError specifically when importing optional dependencies. The message suggests installing with pip or using AUTO_DEPS. ```python try: module = ensure_import("jax") except ImportError as e: print(f"Install with: pip install jax # or AUTO_DEPS") ``` -------------------------------- ### B-spline fit with spline_interp Source: https://github.com/haozeke/rgpycrumbs/blob/main/docs/orgmode/quickstart.org Provides a quick B-spline fit for 1D energy profiles, e.g., along a reaction coordinate. The snippet is incomplete in the source; only the import and module reference are shown. ```python import numpy as np from rgpycrumbs.interpolation import spline_interp ``` -------------------------------- ### Complete workflow script for NEB energy landscape analysis Source: https://github.com/haozeke/rgpycrumbs/blob/main/docs/orgmode/tutorials/first-project.org Full script that loads eOn NEB data, fits a surface model, and prepares for plotting. Requires sample NEB data files and is marked with SKIP-DOCTEST. ```python # SKIP-DOCTEST -- requires sample NEB data files #!/usr/bin/env python """ First Project: NEB Energy Landscape Analysis This script processes eOn NEB output and creates a publication-quality figure. """ import numpy as np import matplotlib.pyplot as plt from matplotlib.ticker import MaxNLocator from rgpycrumbs.basetypes import nebpath from rgpycrumbs.eon.plt_neb import extract_neb_data from rgpycrumbs.surfaces import get_surface_model # 1. Load data data = extract_neb_data("neb_49.dat") path = data.nebpath # 2. Fit surface x_obs = path.arc_dist.reshape(-1, 1) y_obs = path.energy.to("hartree").magnitude model = get_surface_model("matern")(x_obs, y_obs, ls=0.5, smoothing=1e-4) ``` -------------------------------- ### Install required packages Source: https://github.com/haozeke/rgpycrumbs/blob/main/docs/orgmode/tools/chemgp/batch_tutorial.org Install the necessary Python packages for the batch tutorial: rgpycrumbs, chemparseplot, h5py, and plotnine. ```bash pip install rgpycrumbs chemparseplot h5py plotnine ``` -------------------------------- ### CLI: Convergence Panel Source: https://github.com/haozeke/rgpycrumbs/blob/main/docs/orgmode/tools/eon/plt_saddle.org Generates side-by-side plots of force norm and step size vs iteration. ```shell rgpycrumbs eon plt-saddle --job-dir results/ --plot-type convergence ``` -------------------------------- ### Install JAX to resolve ModuleNotFoundError Source: https://github.com/haozeke/rgpycrumbs/blob/main/llms-full.txt Install the JAX package to resolve the 'ModuleNotFoundError: No module named jax' error. The comment suggests an alternative using RGPYCRUMBS_AUTO_DEPS. ```bash pip install jax # or: export RGPYCRUMBS_AUTO_DEPS=1 ``` -------------------------------- ### Combined figure with GP surface, structure strip, and OCI/MMF samples Source: https://github.com/haozeke/rgpycrumbs/blob/main/docs/orgmode/tutorials/neb-visualization.org Creates a full figure combining a 2D GP surface, xyzrender structure strip, and OCI/MMF refinement samples. Uses --landscape-mode surface, --surface-type grad_matern, --project-path, and --mmf-peaks. ```shell rgpycrumbs eon plt-neb \ --plot-type landscape --landscape-mode surface \ --surface-type grad_matern --project-path \ --con-file data/diels_alder/neb.con --sp-file data/diels_alder/sp.con \ --mmf-peaks --peak-dir data/diels_alder/ \ --plot-structures crit_points \ --strip-renderer xyzrender \ --strip-spacing 2.0 --strip-dividers \ -o combined.pdf ``` -------------------------------- ### Library API: plot_neb example Source: https://github.com/haozeke/rgpycrumbs/blob/main/docs/orgmode/tools/eon/plt_neb.org Python example using plot_neb from rgpycrumbs.eon to generate a 2D landscape with gradient IMQ surface, critical point structures, and optional TOML config. ```python from rgpycrumbs.eon import plot_neb, plot # Job files / patterns (same as CLI) plot_neb( plot_type="landscape", con_file="neb.con", surface_type="grad_imq", plot_structures="crit_points", output_file="neb_2d.pdf", config="plot.toml", # optional TOML ) ```