carputils
Doxygen code documentation for the python framework controlling openCARP
Public Member Functions | Properties | List of all members
carputils.carpio.quantity.PhysicalQuantity Class Reference

Defines a physical quantity. More...

Public Member Functions

def __init__ (self, unitdict, iunit, ounit)
 
def from_string (self, valuestr, ounit=None)
 Convert a str to numerical value. More...
 
def __call__ (self, valuestr)
 

Properties

 input_unit = property
 Get the default input unit. More...
 
 output_unit = property
 Get the output unit. More...
 
 units = property
 Get all the supported units. More...
 

Detailed Description

Defines a physical quantity.

Parameters
unitdictdict A dictionary containing the physical unit and the scale factor to a reference unit
iunitstr The default input unit if not unit is given
ounitstr The output unit

Constructor & Destructor Documentation

◆ __init__()

def carputils.carpio.quantity.PhysicalQuantity.__init__ (   self,
  unitdict,
  iunit,
  ounit 
)

Member Function Documentation

◆ __call__()

def carputils.carpio.quantity.PhysicalQuantity.__call__ (   self,
  valuestr 
)

◆ from_string()

def carputils.carpio.quantity.PhysicalQuantity.from_string (   self,
  valuestr,
  ounit = None 
)

Convert a str to numerical value.

Parameters
valuestrstr A string representing the physical quantity
ounitstr, optional The desired output unit, if None the default output unit is used

Property Documentation

◆ input_unit

carputils.carpio.quantity.PhysicalQuantity.input_unit = property
static

Get the default input unit.

◆ output_unit

carputils.carpio.quantity.PhysicalQuantity.output_unit = property
static

Get the output unit.

◆ units

carputils.carpio.quantity.PhysicalQuantity.units = property
static

Get all the supported units.


The documentation for this class was generated from the following file: