carputils
Doxygen code documentation for the python framework controlling openCARP
|
Provides a class to convert physical quantities from a string to numerical values. More...
Classes | |
class | PhysicalQuantity |
Defines a physical quantity. More... | |
Provides a class to convert physical quantities from a string to numerical values.
The PhysicalQuantity class can be used in combination with the ArgumentParser class whenever physical quantities are required as arguments. First you have to define your physical quantity:
Next you can define your argument:
parser.add_argument('--pressure', type=PressureQuantity, default=10.0, ....)
Now the user can state a pressure with different units:
./script.py --pressure 10.0Pa ./script.py --pressure 10.0kPa ./script.py --pressure 10.0mPa ./script.py --pressure 10.0mmHg ./script.py --pressure 10.0 # No unit, default input unit is used