Skip to main content

A library for unit and quantity consistent computations in Rust

Project description

Unitforge

Overview

Unitforge is a Rust crate designed for safe handling of physical quantities of units. New quantities and relations can be set up via small macros.

Features

  • Quantity inference: Resulting quantities of arithmetic operations are inferred at compile time.
  • Unit conversion: Quantities can be set or read in arbitrary units.
  • Computing Precision Values are stored in exponential format (f64*10^i32) to prevent floating point precision issues.
  • Formating Quantities are displayed with 4 significant digits and configured display unit.
  • ndarray support: Quantities may be used as inner types for ndarray.
  • 3D Vector and matrix operations: Structs for 3D vectors and matrices are included to allow fast and unit-safe work with them.
  • Serialization: Optional support for sere using the serde feature.
  • python interface Optional Python interface when building with flag pyo3; also available on pypi

Contribute

All contributions are welcome! Feel free to implement new quantities or define relations using impl_macros.rs. 🚀

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

unitforge-0.2.10.tar.gz (37.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

unitforge-0.2.10-cp312-cp312-manylinux_2_34_x86_64.whl (528.2 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.34+ x86-64

File details

Details for the file unitforge-0.2.10.tar.gz.

File metadata

  • Download URL: unitforge-0.2.10.tar.gz
  • Upload date:
  • Size: 37.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.8.3

File hashes

Hashes for unitforge-0.2.10.tar.gz
Algorithm Hash digest
SHA256 dc03dabe8ae2d82533f7644e61f664a57d527cf781cd450db89a0f4bbdfa38b4
MD5 a8b27e481bffe9fe3ef7b34d7f445421
BLAKE2b-256 d50b8a341a176eebc4827965874c99754aa3134efc2fc748c57af60cc1d3c50c

See more details on using hashes here.

File details

Details for the file unitforge-0.2.10-cp312-cp312-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for unitforge-0.2.10-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 2b23112973f33cee1d12b86dbae0bdaf2a8883afc030e6e9903b8957e1033b19
MD5 b8369fe182721f61c8d6c8bc04f3612e
BLAKE2b-256 52f5e9e6321963277ce1b3d2d56b651f716612a39e53e6e3f21a47cdc106968a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page