- Notifications
You must be signed in to change notification settings - Fork75
Quantities package for the python programming language
python-quantities/python-quantities
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Quantities is designed to handle arithmetic andconversions of physical quantities, which have a magnitude, dimensionalityspecified by various units, and possibly an uncertainty. See thetutorialfor examples. Quantities builds on the popular numpy library and isdesigned to work with numpy ufuncs, many of which are alreadysupported. Quantities is actively developed, and while the current featuresand API are stable, test coverage is incomplete so the package is notsuggested for mission-critical applications.
A Python package for handling physical quantities. The source code and issuetracker are hosted on GitHub:
Get the latest version of quantities fromhttps://pypi.python.org/pypi/quantities/
To get the Git version do:
$ git clone git://github.com/python-quantities/python-quantities.git
You can find the official documentation at:
http://python-quantities.readthedocs.io/
Here is a simple example:
>>>importquantitiesaspq>>>distance=42*pq.metre>>>time=17*pq.second>>>velocity=distance/time>>>"%.3f %s"% (velocity.magnitude,velocity.dimensionality)'2.471 m/s'>>>velocity+3Traceback (mostrecentcalllast): ...ValueError:Unabletoconvertbetweenunitsof"dimensionless"and"m/s"
quantities has a hard dependency on theNumPy library.You should install it first, please refer to the NumPy installation guide:
http://docs.scipy.org/doc/numpy/user/install.html
To install quantities itself, then simply run:
$ pip install quantities
To execute all tests, install pytest:
$ python -m pip install pytest
And run:
$ pytest
in the current directory. The master branch is automatically tested byGitHub Actions.
quantities was originally written by Darren Dale, and has received contributions frommany people.
Quantities only uses BSD compatible code. See the Open SourceInitiativelicenses pagefor details on individual licenses.
Seedoc/user/license.rst for further details on the license of quantities
About
Quantities package for the python programming language
Resources
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.