Skip to main content

expaloma

Native JAX/Equinox partial-charge inference, ported from espaloma_charge so downstream simulators can avoid PyTorch + DGL at runtime.

Install

uv sync
# optional dev (pytest)
uv sync --extra dev

Typer CLI

The package exposes a typer application (src/expaloma/cli.py) registered as the expaloma console script in pyproject.toml ([project.scripts]). Commands:

  • expaloma infer SMILES — partial charges (bundled .eqx by default).
  • expaloma convert-weights MODEL.pt OUT.eqx — offline conversion (needs a git checkout with scripts/ and submodules; not available from a PyPI-only install).
  • expaloma --version — print the installed package version.

PyPI and uv tool

After you publish to PyPI:

pip install expaloma
expaloma infer "CCO"

Install as a uv tool (isolated env with the expaloma console script on PATH):

uv tool install expaloma
expaloma --version
# one-shot without installing:
uvx --from expaloma expaloma infer "CCO"

CI and releases

Workflow Purpose
.github/workflows/ci.yml Lint/tests on push/PR to main
.github/workflows/publish.yml Build with uv build and upload to PyPI on GitHub Release (OIDC trusted publishing)

Configure trusted publishing on PyPI for this repo/workflow, and add a GitHub Environment named pypi if you use environment protection rules. Tag releases (e.g. v0.1.0) and publish a GitHub Release to trigger the workflow (or run it manually via workflow_dispatch).

Branch protection (gh CLI)

GitHub’s rulesets API is the supported approach. After CI is green, you can require the test check on main via the web UI (Settings → Rules → Rulesets), or use the API. Examples:

# Repo visibility / basics (requires gh auth)
gh repo view maraxen/expaloma

# Many teams configure rulesets in the UI so required checks match exactly (e.g. "test" from ci.yml).
# To require pull requests before merging, use Settings → Rulesets → Add rule → Target: main.

For automation-heavy setups, create a ruleset with the REST API (gh api repos/{owner}/{repo}/rulesets) using JSON from Settings → Rulesets → View JSON, or start from GitHub’s ruleset documentation. The gh CLI does not yet offer a single stable gh ruleset create for all options; the UI or API remains the reliable path.

Inference (bundled weights)

The public v0.0.8 checkpoint is shipped as Equinox bytes at src/expaloma/weights/espaloma_v0_0_8.eqx (also included in wheels). Provenance and SHA256 hashes are in src/expaloma/weights/README.md.

uv run expaloma infer "CC(=O)Oc1ccccc1C(=O)O"
# or pass a custom checkpoint:
uv run expaloma infer "CCO" --weights path/to/custom.eqx

From Python:

from expaloma.infer import charges_for_rdkit_mol, charges_for_smiles
from rdkit import Chem

q = charges_for_smiles("CCO")  # uses bundled .eqx by default
q = charges_for_rdkit_mol(Chem.MolFromSmiles("CCO"))  # same atom order as RDKit

Convert PyTorch model.pt to .eqx (offline)

Conversion uses PyTorch only in the script environment (not a runtime dependency of expaloma):

uv pip install torch --index-url https://download.pytorch.org/whl/cpu
uv run python scripts/convert_weights.py path/to/model.pt out.eqx

Tests

uv sync --extra dev
uv pip install torch --index-url https://download.pytorch.org/whl/cpu
curl -fsSL -o /tmp/espaloma_model.pt \
  "https://github.com/choderalab/espaloma_charge/releases/download/v0.0.8/model.pt"
uv run pytest tests/ -v

CI downloads the same model.pt for JAX vs PyTorch reference parity checks; golden vectors and bundled .eqx cover regression without relying on that download for basic JAX tests.

Benchmark (local)

scripts/benchmark_infer.py runs warmup + timed repeats with jax.block_until_ready. Timing is environment-dependent and not part of default CI.

uv run python scripts/benchmark_infer.py --repeats 50

Attribution

The original espaloma_charge project is MIT-licensed (see references/espaloma-charge/LICENSE). This port bundles weights derived from the published v0.0.8 release; retain upstream notices in distributions.

Metadata

Release files for expaloma 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for expaloma 0.1.0
File Size Uploaded Provenance Actions
expaloma-0.1.0.tar.gz 567.9 kB With provenance Details for expaloma-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for expaloma 0.1.0
File Interpreter ABI Platform Actions
expaloma-0.1.0-py3-none-any.whl Python 3 none any Details for expaloma-0.1.0-py3-none-any.whl

Total release size: 1.1 MB

Release files / expaloma-0.1.0.tar.gz

Download URL expaloma-0.1.0.tar.gz
Size 567.9 kB
Tags Source
SHA-256 checksum
How to use checksums
3c291960a8b6d9ef566f44bfd70e71fc6b2d80e1355898167672cc2968e8a8d1
BLAKE2b-256 checksum
How to use checksums
b95ba40dd31a87fcd8667924b24448e8b0273b9594c23d1123db961908b90742
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 Apr 16, 2026.

Transparency log

Release files / expaloma-0.1.0-py3-none-any.whl

Download URL expaloma-0.1.0-py3-none-any.whl
Size 571.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
226a0d8d30dff170a51609d063ce99abde241505f1350da03f7e5ae606526d80
BLAKE2b-256 checksum
How to use checksums
e38aea777f427ad466bc233ab45d958274e9feb2053c4a770907d26e5602b938
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 Apr 16, 2026.

Transparency log

Security for expaloma 0.1.0

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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for expaloma-0.1.0.tar.gz

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 Apr 16, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page