Skip to main content

Python client for QDX's Rush platform

Project description

rush-py: Rush Python Client

Installation

Install from PyPI:

pip install rush-py

If you manage dependencies with uv, add it to your project (updates pyproject.toml and uv.lock):

uv add rush-py

Using in Your Project

Add to your pyproject.toml:

[project]
dependencies = [
    "rush-py",
]

Rush Setup

Use environment variables to configure access:

  • RUSH_TOKEN: Put your token's value here
  • RUSH_PROJECT: Put your project's UUID value here; can find it in the URL once selecting a project in the Rush UI
  • RUSH_ENDPOINT: Use this to choose between staging and prod; if omitted, defaults to prod

You can also put RUSH_TOKEN and RUSH_PROJECT in a .env file instead of exporting them in every terminal session. rush-py looks for a .env file in the current working directory first, then falls back to ~/.rush/.env. Environment variables always take priority over .env values.

# .env
RUSH_TOKEN=your-token-here
RUSH_PROJECT=your-project-id-here

Quick Start

from pathlib import Path

from rush import exess

topology_path = Path.cwd() / "thrombin_1c_t.json"

# For energy, the only mandatory argument is the Topology
run = exess.energy(topology_path)

# Fetch the results for direct access
result = run.fetch()

# Save the results
paths = run.save()

Outputs are saved under <workspace_dir>/<PROJECT_ID>/ (default: current working directory). To customize the workspace location, call rush.client.set_opts(workspace_dir=Path("...")).

# For interaction_energy, second argument is reference fragment
result = exess.interaction_energy(topology_path, 1).fetch()

# Use export keywords to obtain additional information
result = exess.energy(
    topology_path,
    frag_keywords=None,  # MBE is not supported for CHELPG charges
    export_keywords=exess.ExportKeywords(export_chelpg_charges=True)
).fetch()

# QMMM requires Residues too
topology_path = "./6a5j_t.json"
residues_path = "./6a5j_r.json"
# Without calling `.fetch()` or `.save()` the run takes place asynchronously
# and a run object is returned
run = exess.qmmm(
    topology_path=topology_path,
    residues_path=residues_path,
    n_timesteps=500,
    qm_fragments=[0],
)
# The output is a QMMMResult object that contains the geometries for each timestep,
# which can be swapped into a Topology's geometry field
result = run.fetch()

# Get the full list of parameters and default arguments for a function
help(exess.energy)
help(exess.interaction_energy)
help(exess.optimization)
help(exess.qmmm)

See the docs for more information!

Development

You can develop this project using pip + venv, or uv.

With pip + venv

git clone git@github.com:talo/rush-py.git
cd rush-py
python -m venv .venv
source .venv/bin/activate
pip install -e .

With uv

git clone git@github.com:talo/rush-py.git
cd rush-py
uv sync
source .venv/bin/activate

Running Tests

Run the full suite with:

uv run pytest

Common focused invocations:

uv run pytest -m "not submits_rush_jobs"
uv run pytest -m submits_rush_jobs --force-run-slow
uv run pytest tests/test_exess_energy.py
uv run pytest tests/test_exess_energy.py --rush-workspace-dir /tmp/rush-py-workspaces

See the Terms of Service for use of the underlying Rush software at https://qdx.co/terms.

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

rush_py-7.0.0b3.tar.gz (72.1 kB view details)

Uploaded Source

Built Distribution

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

rush_py-7.0.0b3-py3-none-any.whl (88.4 kB view details)

Uploaded Python 3

File details

Details for the file rush_py-7.0.0b3.tar.gz.

File metadata

  • Download URL: rush_py-7.0.0b3.tar.gz
  • Upload date:
  • Size: 72.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for rush_py-7.0.0b3.tar.gz
Algorithm Hash digest
SHA256 4cb86582766c075e19bed59d740906bf469c7f006b4ba7ce6a373026e7c2aa59
MD5 5b4abdb98844b5384be323d68bfc9a85
BLAKE2b-256 dcddd1e23464b7796cb5ed428cbdc39a082ed7dde74ce202ae2a034f83c740f0

See more details on using hashes here.

Provenance

The following attestation bundles were made for rush_py-7.0.0b3.tar.gz:

Publisher: publish.yml on talo/rush-py

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

File details

Details for the file rush_py-7.0.0b3-py3-none-any.whl.

File metadata

  • Download URL: rush_py-7.0.0b3-py3-none-any.whl
  • Upload date:
  • Size: 88.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for rush_py-7.0.0b3-py3-none-any.whl
Algorithm Hash digest
SHA256 3d0e96a4e81aa45f270e2d2c8bf2e87aabafc245e0da77b425c7743d05c4af01
MD5 c012a197a5abfcc04b01bfad3765914c
BLAKE2b-256 8cc17cac63234ad111ca9ecd1da1688598ec0b432f23ff4730889de40ffee747

See more details on using hashes here.

Provenance

The following attestation bundles were made for rush_py-7.0.0b3-py3-none-any.whl:

Publisher: publish.yml on talo/rush-py

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 Pingdom Monitoring Sentry Error logging StatusPage Status page