# pyvelora

A lightweight NumPy-based mathematical backend providing structured
`Vector`, `Matrix`, and `Tensor` objects for scientific computing.

## Philosophy

- Thin abstraction over NumPy
- No domain-specific logic
- Designed as reusable infrastructure for physics and simulation libraries

## Installation

```bash
pip install pyvelora
```

## Quick Start

```python
from pyvelora import Vector, Matrix, Tensor

v = Vector([3, 4])
print(v.magnitude())  # 5.0

m = Matrix([[1, 2], [3, 4]])
print(m.transpose())

t = Tensor([[[1, 2], [3, 4]], [[5, 6], [7, 8]]])
print(t.shape)  # (2, 2, 2)
```

## Coordinate Vector Input

`Vector` supports Cartesian (default), polar, spherical, and cylindrical
coordinate input.

```python
from pyvelora import Vector

# Polar input: [r, theta]
v_polar = Vector([2, 45], type="polar", degrees=True)

# Spherical input: [r, theta, phi]
v_spherical = Vector([1, 90, 30], type="spherical", degrees=True)

# Cylindrical input: [rho, phi, z]
v_cyl = Vector([2, 90, 3], type="cylindrical", degrees=True)
```

Angles are interpreted as radians unless `degrees=True` is provided.

## Error Types

The package provides reusable exception types:

- `PyveloraError`
- `ShapeError`
- `DimensionError`

```python
from pyvelora import Vector, ShapeError

try:
	_ = Vector([1, 2, 3]) + Vector([1, 2])
except ShapeError as exc:
	print(exc)
```

## Development

Run tests:

```bash
python -m pytest src/pyvelora/tests -q
```