Lightweight NumPy-based mathematical backend for physics libraries.
Project description
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
pip install pyvelora
Quick Start
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.
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:
PyveloraErrorShapeErrorDimensionError
from pyvelora import Vector, ShapeError
try:
_ = Vector([1, 2, 3]) + Vector([1, 2])
except ShapeError as exc:
print(exc)
Development
Run tests:
python -m pytest src/pyvelora/tests -q
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pyvelora-0.2.2.tar.gz.
File metadata
- Download URL: pyvelora-0.2.2.tar.gz
- Upload date:
- Size: 10.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e807a9f7ca62dd854fe570a2565d40232ca45c7a51272c2724cc4ca5a41b1f9a
|
|
| MD5 |
bd2b3661059fd3d2ab2a5f1219005bab
|
|
| BLAKE2b-256 |
4cb23ac0ff492f4f4b3cd5deac7014bd1836754edf525da5d4ab9835e53f8ea0
|
File details
Details for the file pyvelora-0.2.2-py3-none-any.whl.
File metadata
- Download URL: pyvelora-0.2.2-py3-none-any.whl
- Upload date:
- Size: 11.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7c2e3883f8b64f8aeb1eb4bec04f91beb2e04153bda2fd744b4a5838c58ab419
|
|
| MD5 |
b2742de2e0354bce11b3de08fd334ca3
|
|
| BLAKE2b-256 |
ab931a8ba402c6fc61d5d8c4d754640815cf6f75e8baaa985cf283a05a6b1743
|