Skip to main content

Simple-Minded Unit Propagation for QuantiPhy

https://pepy.tech/badge/unit_propagation/month https://github.com/KenKundert/unit_propagation/actions/workflows/build.yaml/badge.svg https://coveralls.io/repos/github/KenKundert/unit_propagation/badge.svg?branch=main https://img.shields.io/pypi/v/unit_propagation.svg https://img.shields.io/pypi/pyversions/unit_propagation.svg
Author: Ken Kundert
Version: 0.2
Released: 2026-06-27

This is a package used to experiment with adding unit propagation to QuantiPhy. It currently employs simple-minded simplification rules that handle many common cases but not all. Also, there is a strong emphasis on simple electrical unit scenarios. Even so, it shows promise for use in well controlled settings.

Here is simple example:

>>> from unit_propagation import UnitPropagatingQuantity as Quantity, QuantiPhyError

>>> try:
...     v = Quantity("2.5V")
...     i = Quantity("100nA")
...     print(v/i)
... except QuantiPhyError as e:
...     print(f"error: {e!s}")
25 MΩ

Operations can also involve integers, floats and strings:

>>> Kvco = Quantity(500e6, "Hz") / "500mV"
>>> print(Kvco)
1 GHz/V

>>> Vdd = Quantity("2.5V")
>>> halfVdd = Vdd / 2
>>> print(halfVdd)
1.25 V

Included in the package is a simple RPN calculator that allows you to explore the capabilities and limitations of unit propagation.

Metadata

Release files for unit-propagation 0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for unit-propagation 0.2
File Size Uploaded
unit_propagation-0.2.tar.gz 5.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for unit-propagation 0.2
File Interpreter ABI Platform
unit_propagation-0.2-py3-none-any.whl Python 3 none any Details

Total release size: 11.7 kB

Release files / unit_propagation-0.2.tar.gz

Download URL unit_propagation-0.2.tar.gz
Size 5.7 kB
Tags Source
SHA-256 checksum
How to use checksums
0d60d261546688922d30786d38ec73a246ee48b6faedecb7d5f4c73ab376d92b
BLAKE2b-256 checksum
How to use checksums
05acb92cfd8338cf1ff53cab5f00556ab3f578d7639e7fed56deed635460f35b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.5

Release files / unit_propagation-0.2-py3-none-any.whl

Download URL unit_propagation-0.2-py3-none-any.whl
Size 6.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
54e37a754a2e2e98518dc9b9b8eb1aad7bc178b1be2eff53c97d16246b6ef1c2
BLAKE2b-256 checksum
How to use checksums
c1573308f78a063ace132f7fc110077439d02a6ae98fa517627523403b34a08e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.5

Release history Release notifications | RSS feed

This release

0.2 This release

2 release files

0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page