Simple-Minded Unit Propagation for QuantiPhy
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)
| File | Size | Uploaded | |
|---|---|---|---|
| unit_propagation-0.2.tar.gz | 5.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| 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
|