This is a library for dealing with some tedious tasks for basic physics labs.
Be warned that, as this project is still in heavy development, backwards compatability can be broken between 0.x.0 versions. This is avoided as much as possible, but make sure to watch out for it when updating your installation.
- Automatic uncertainty propagation on basic arithmetic and trigonometric operations
- Generated LaTeX steps of any calculations done with the
MeasuredDataclass - A physics scripting language for fast usage of the library
- Graping wrappers that take numbers with uncertainty for automatic error bars
- LaTeX data table generators
Look under the examples folder to see the library in use.
physics_utils can be installed straight from PyPI using pip, like so:
python3 -m pip install physics-utilsTo get started with using the library, you can import MeasuredData from physics_utils and begin doing
calculations like normal once your numbers are wrapped:
from physics_utils import MeasuredData
print(MeasuredData(2, 0.5) * MeasuredData(3, 0.4)) # 6±2.To start using the scripting language, you can type python3 -m physics_utils.script in your terminal to start the
interpreter, or python3 -m physics_utils.script <filename> to run a file. To do the same as the example above in the
physics script interpreter, you'd just need to type this:
>>> 2~0.5 * 3~0.4
6±2.
And there are a number of other helpful features built into the language.
For more information on using the package, take a look at the documentation and examples.