Quantity-Value
This package provides Python support for physical quantities used in mathematical equations.
Python objects called quantity-values are used to associate a measured value with a unit of measurement. Calculations involving these objects follow the rules of quantity calculus.
The package can be used to define the quantities, and associated units of measurement, of interest in a specific problem. In that way the context in which quantity calculations are performed is well defined.
Example
Calculations involving electrical measurements can be described in terms of a simple set of base quantities, here we declare current and voltage and the dependent quantity resistance
>>> from QV import *
>>> context = Context( ("Current","I"),("Voltage","V") )
>>> Resistance = context.declare('Resistance','R','Voltage/Current')
Units can be declared in terms of these quantities
>>> ureg = UnitRegister("ureg",context)
>>>
>>> volt = ureg.unit( RatioScale(context['Voltage'],'volt','V') )
>>> amp = ureg.unit( RatioScale(context['Current'],'amp','A') )
>>> milliamp = ureg.unit( prefix.milli(amp) )
>>> ohm = ureg.unit( RatioScale(context['Resistance'],'Ohm','Ohm') )
and then quantity-values can be created and manipulated
>>> v1 = qvalue(0.10,volt)
>>> i1 = qvalue(15,milliamp)
>>> print( qresult( v1/i1 ) )
6.6666666666... Ohm
Status
The Quantity-Value package is part of a research project at the Measurement Standards Laboratory of New Zealand looking at issues in Digital Metrology.
Quantity-Value is intended as an exemplar for software that supports the concept of a physical quantity and physical quantity calculations.
The project is on-going and should not yet be considered stable. There may be substantial changes in later versions.
Documentation
The documentation for Quantity-Value can be found here.
Metadata
Release files for Quantity-Value 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| Quantity-Value-0.2.0.tar.gz | 20.3 kB | Without provenance | Details for Quantity-Value-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| Quantity_Value-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for Quantity_Value-0.2.0-py3-none-any.whl |
Total release size: 43.4 kB
Release files / Quantity-Value-0.2.0.tar.gz
| Download URL | Quantity-Value-0.2.0.tar.gz |
|---|---|
| Size | 20.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d3cffca29d72018c91b1716408cadf18f4c64e14545b5420fda044ec41388572
|
|
BLAKE2b-256 checksum How to use checksums |
f78770901df1ba83b3fdfd26c49d0eb70f78e71da0af02a85fbfec4a81400fca
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.8
|
Release files / Quantity_Value-0.2.0-py3-none-any.whl
| Download URL | Quantity_Value-0.2.0-py3-none-any.whl |
|---|---|
| Size | 23.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a6c49e2ecd191e3350522b2f6920d04500f47431a5ddff9c2b989adb0b8e5ed1
|
|
BLAKE2b-256 checksum How to use checksums |
7c3d2cad5bed740a77ad78d143acea3f2b76529d22b3b0162de8be4219dc3fe2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.8
|
Security for Quantity-Value 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.