Metadata-Version: 2.1
Name: rastra
Version: 0.1.2
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: BSD License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Rust
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Topic :: Scientific/Engineering :: Physics
License-File: LICENSE
Summary: Rust library for tracing 2D field lines with optional Python bindings
Keywords: rust,python,pyo3,field-lines,scientific-computing
Author: GiMattia
License: BSD-3-Clause
Requires-Python: >=3.10
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
Project-URL: Homepage, https://github.com/GiMattia/rastra
Project-URL: Repository, https://github.com/GiMattia/rastra
Project-URL: Issues, https://github.com/GiMattia/rastra/issues

# 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

```bash
uv pip install -e .
```

This installs:
- `rastra` (Rust extension module)

If you prefer using `maturin` directly:

```bash
maturin develop
```

## Minimal API usage

```python
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:

```bash
export MATURIN_PYPI_TOKEN=pypi-...
```

3. Build the distribution artifacts locally:

```bash
uvx maturin build
```

4. Optionally validate the built wheel in a clean environment:

```bash
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))"
```

5. Publish to TestPyPI first:

```bash
uvx maturin publish --repository testpypi
```

6. Publish to PyPI:

```bash
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)

