Metadata-Version: 2.4
Name: rustronomy
Version: 0.1.0
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Science/Research
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
Summary: Rust library for tracing 2D field lines with optional Python bindings
Keywords: rust,python,pyo3,field-lines,scientific-computing
Author: GiMattia
Requires-Python: >=3.10
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
Project-URL: Homepage, https://github.com/GiMattia/rustronomy
Project-URL: Issues, https://github.com/GiMattia/rustronomy/issues
Project-URL: Repository, https://github.com/GiMattia/rustronomy

# rustronomy

Simple Rust-backed Python module for tracing field lines.

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

## Build and install locally

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

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

If you prefer using `maturin` directly:

```bash
maturin develop
```

## Minimal API usage

```python
import numpy as np
import rustronomy

paths = rustronomy.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/rustronomy-test
source /tmp/rustronomy-test/bin/activate
uv pip install dist/*.whl
python -c "import rustronomy; print(sorted(name for name in dir(rustronomy) if 'fieldlines' in name))"
```

5. Publish to TestPyPI first:

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

6. Publish to PyPI:

```bash
uvx maturin publish
```

If the name `rustronomy` is already taken on PyPI, change the `name` field in `pyproject.toml` before publishing.

## 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)

