Skip to main content

Rust library for tracing 2D field lines with optional Python bindings

Project description

RASTRA

Simple Rust-backed Python module for tracing field lines.

This package is built with maturin and published to PyPI as rastra.

Build and install locally

uv pip install -e .

This installs:

  • rastra (Rust extension module)

If you prefer using maturin directly:

maturin develop

Minimal API usage

import numpy as np
import rastra

paths = rastra.trace_fieldlines(
	xmin=0.0,
	xmax=1.0,
	ymin=0.0,
	ymax=1.0,
	nx=16,
	ny=16,
	bx=np.ones(16 * 16),
	by=np.zeros(16 * 16),
	seeds=[(0.1, 0.1), (0.2, 0.3)],
	step=0.01,
	max_steps=1024,
)

This project now keeps a small, non-public API focused on one task: compute field lines.

Publish to PyPI

  1. Create an API token on PyPI.
  2. Export it in your shell:
export MATURIN_PYPI_TOKEN=pypi-...
  1. Build the distribution artifacts locally:
uvx maturin build
  1. Optionally validate the built wheel in a clean environment:
uv venv /tmp/rastra-test
source /tmp/rastra-test/bin/activate
uv pip install dist/*.whl
python -c "import rastra; print(sorted(name for name in dir(rastra) if 'fieldlines' in name))"
  1. Publish to TestPyPI first:
uvx maturin publish --repository testpypi
  1. Publish to PyPI:
uvx maturin publish

The package name is configured as rastra in pyproject.toml.

Minimal repository layout

  • src/ core Rust tracing implementation and Python bindings
  • Cargo.toml Rust package configuration
  • pyproject.toml maturin/Python packaging configuration

Minimal API

  • trace_fieldlines(...) fixed-step tracer (RK4)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

rastra-0.1.2-cp314-cp314-manylinux_2_34_x86_64.whl (297.5 kB view details)

Uploaded CPython 3.14manylinux: glibc 2.34+ x86-64

File details

Details for the file rastra-0.1.2-cp314-cp314-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for rastra-0.1.2-cp314-cp314-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 6d0ae2e63c003a3fd8e205ddc6be2221111485f1c3c05ef7882379eaf8c23df8
MD5 5d7e6c95079c3ea3b9e0f6dd171c4d4e
BLAKE2b-256 598aed1cf180450d6a88561dc69fea466fab699388a4d6d62e248f0e3e82b10c

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