Skip to content

GiMattia/rastra

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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)

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages