Skip to main content

Simple Python interfaces for Rush modules

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

Quick start

from pathlib import Path

from rush import exess
from rush.client import collect_run

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

# For energy, the only mandatory argument is the Topology
result = exess.energy(topology_path, collect=True)
exess.save_energy_outputs(result)

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, collect=True)

# For chelpg, charges are extracted from the HDF5 output and returned as a list
output_info, charges = exess.chelpg(topology_path, collect=True)

# QMMM requires Residues too
md_topology_path = "./6a5j_t.json"
md_residues_path = "./6a5j_r.json"
# Without `collect=True`, the run takes place asynchronously, and a run ID is returned
id = exess.qmmm(
    md_topology_path,
    md_residues_path,
    n_timesteps=500,
    qm_fragments=[0],
    free_atoms=[0],
)
# The output for qmmm is a geometries json; can swap into a Topology's geometry field
result = collect_run(id)

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

See the Getting Started guide for more usage 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

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-6.0.0.tar.gz (49.2 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-6.0.0-py3-none-any.whl (58.4 kB view details)

Uploaded Python 3

File details

Details for the file rush_py-6.0.0.tar.gz.

File metadata

  • Download URL: rush_py-6.0.0.tar.gz
  • Upload date:
  • Size: 49.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.21 {"installer":{"name":"uv","version":"0.9.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"NixOS","version":"25.11","id":"xantusia","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for rush_py-6.0.0.tar.gz
Algorithm Hash digest
SHA256 c31b13ea87fd9788883c66719d4e6e37d0578602a9c1990b72b3366530e4ba5c
MD5 74847c041a22621ee722f26348eebd53
BLAKE2b-256 61329214d3e8bd8cd940fafe4f46c15b572741b28f825522a41e62c340051afe

See more details on using hashes here.

File details

Details for the file rush_py-6.0.0-py3-none-any.whl.

File metadata

  • Download URL: rush_py-6.0.0-py3-none-any.whl
  • Upload date:
  • Size: 58.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.21 {"installer":{"name":"uv","version":"0.9.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"NixOS","version":"25.11","id":"xantusia","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for rush_py-6.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 eaa344818a6065d839d7ddacd7329ba2d2c9c803bfd17366a1b92b2d9ba3edd6
MD5 d287bfc5f1ef97658769d42ea48be3ca
BLAKE2b-256 d8aa777ad509765a6ef166ac12db2d92318836c7f76515af5766c0ed53bd1325

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