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.9.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.9-cp312-cp312-manylinux_2_34_x86_64.whl (527.8 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.34+ x86-64

File details

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

File metadata

  • Download URL: unitforge-0.2.9.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.9.tar.gz
Algorithm Hash digest
SHA256 f1de7ccbc89f6f495aa3568ceb24163b91beef78c7d7be423f1c6ae4eee250ee
MD5 160e31b217f2e0acd402bc8acbe20cad
BLAKE2b-256 09920d455d3995512daa2f7b80e7d4f2c8a46eed2bb98ec060ffc88dccb42802

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for unitforge-0.2.9-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 6209d1d50b516968e35595b9932b2cc3fc634436131063c2f3ec6e6ecb06597b
MD5 4a282bb2701f003bd7455312812c42cf
BLAKE2b-256 80ca4114b5d40dabf04efc65b5f85f4d85b05db555fcd976e8252f068a04e2f0

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