quantity module¶
-
class
quantity.
Quantity
(name='null-quantity-name', formalName='null-quantity-formal-name', formal_name='null-quantity-formal-name', value=0.0, unit='null-quantity-unit')[source]¶ Bases:
object
- todo: this probably should not have a “value” for the same reason as Species.
this needs some thinking.
well not so fast. This can be used to build a quantity with anything as a value. For instance a history of the quantity as a time series.
-
SetUnit
(f)[source]¶ Sets the units of the quantity to f (for example, density would be in units of g/cc.
- Parameters
f (str) –
-
__repr__
()[source]¶ Used to print the data stored by the quantity class. Will print out name, formal name, the value of the quantity and its unit.
- Returns
s
- Return type
-
__str__
()[source]¶ Used to print the data stored by the quantity class. Will print out name, formal name, the value of the quantity and its unit.
- Returns
s
- Return type
-
plot
(x_scaling=1, y_scaling=1, title=None, x_label='x', y_label=None, file_name=None, same_axis=True, dpi=300)[source]¶ This will support a few possibities for data storage in the self.__value member.
Pandas Series. If self.__value is a Pandas Series, plot against the index. However the type stored in the Series matter. Suppose it is a series of a numpy array. This must be of the same rank for every entry. This plot method assumes it is an iterable type of the same length for every entry in the series. A plot of all elements in the type against the index of the series will be made. The plot may have all elements in one axis or each element in its own axis.
-
value
¶ Gets the numerical value of the quantity.
- Returns
value
- Return type
any type