bellini.distributions.UnitChangedDistribution¶
- class bellini.distributions.UnitChangedDistribution(distribution, new_units, force=False)[source]¶
Bases:
bellini.distributions.DistributionA distribution whose units have been changed. This prevents resampling a value if you change unit systems during computation.
- __init__(distribution, new_units, force=False)[source]¶
- Parameters
distribution (Distribution) – The Distribution whose units are being changed
new_units (ureg unit) – The new units to adopt
force (bool, default=False) – Whether or not to force the unit change if errors occur. This should be avoided unless you are explicitly removing units from a unit-ed object or adding units to a unitless object.
Methods
__init__(distribution, new_units[, force])- Parameters
distribution (Distribution) -- The Distribution whose units are being changed
to_units(new_units[, force])Return self converted to units new_units
unitless()Return a unitless version of self
Attributes
The Distribution's dimensionality (e.g.
A networkx graph describing the computation graph used to create this Distribution
The units associated with internal computations in Bellini for this Distribution
A quantity (array-like or scalar) with the same shape as expected samples from this Distribution
A string representing the name of self
The shape of samples from this Distribution
The units of this Distribution (e.g.
- property dimensionality¶
The Distribution’s dimensionality (e.g. ‘length’ for meter)
- property g¶
A networkx graph describing the computation graph used to create this Distribution
- property internal_units¶
The units associated with internal computations in Bellini for this Distribution
- property magnitude¶
A quantity (array-like or scalar) with the same shape as expected samples from this Distribution
- property name¶
A string representing the name of self
- property shape¶
The shape of samples from this Distribution
- property units¶
The units of this Distribution (e.g. molar)