Developer reference¶
Pint¶
pint¶
Pint is Python module/package to define, operate and manipulate physical quantities: the product of a numerical value and a unit of measurement. It allows arithmetic operations between them and conversions from and to different units.
copyright: | 2016 by Pint Authors, see AUTHORS for more details. |
---|---|
license: | BSD, see LICENSE for more details. |
-
class
pint.
Context
(name=None, aliases=(), defaults=None)[source]¶ A specialized container that defines transformation functions from one dimension to another. Each Dimension are specified using a UnitsContainer. Simple transformation are given with a function taking a single parameter.
Conversion functions may take optional keyword arguments and the context can have default values for these arguments.
Additionally, a context may host redefinitions:
A redefinition must be performed among units that already exist in the registry. It cannot change the dimensionality of a unit. The symbol and aliases are automatically inherited from the registry.
Parameters: Example
>>> from pint.util import UnitsContainer >>> timedim = UnitsContainer({'[time]': 1}) >>> spacedim = UnitsContainer({'[length]': 1}) >>> def f(time): ... 'Time to length converter' ... return 3. * time >>> c = Context() >>> c.add_transformation(timedim, spacedim, f) >>> c.transform(timedim, spacedim, 2) 6 >>> def f(time, n): ... 'Time to length converter, n is the index of refraction of the material' ... return 3. * time / n >>> c = Context(n=3) >>> c.add_transformation(timedim, spacedim, f) >>> c.transform(timedim, spacedim, 2) 2 >>> c.redefine("pound = 0.5 kg")
-
defaults
= None¶ Maps defaults variable names to values
-
classmethod
from_context
(context, **defaults)[source]¶ Creates a new context that shares the funcs dictionary with the original context. The default values are copied from the original context and updated with the new defaults.
If defaults is empty, return the same context.
Parameters: - context (pint.Context) – Original context.
- **defaults –
Returns: Return type:
-
funcs
= None¶ Maps (src, dst) -> transformation function
-
hashable
()[source]¶ Generate a unique hashable and comparable representation of self, which can be used as a key in a dict. This class cannot define
__hash__
because it is mutable, and the Python interpreter does cache the output of__hash__
.Returns: Return type: tuple
-
redefine
(definition: str) → None[source]¶ Override the definition of a unit in the registry.
Parameters: definition (str) – <unit> = <new definition>``, e.g. pound = 0.5 kg
-
relation_to_context
= None¶ Maps (src, dst) -> self Used as a convenience dictionary to be composed by ContextChain
-
-
class
pint.
Measurement
[source]¶ Implements a class to describe a quantity with uncertainty.
Parameters: - value (pint.Quantity or any numeric type) – The expected value of the measurement
- error (pint.Quantity or any numeric type) – The error or uncertainty of the measurement
-
class
pint.
Quantity
[source]¶ Implements a class to describe a physical quantity: the product of a numerical value and a unit of measurement.
Parameters: - value (str, pint.Quantity or any numeric type) – Value of the physical quantity to be created.
- units (UnitsContainer, str or pint.Quantity) – Units of the physical quantity to be created.
-
default_format
= ''¶ Default formatting string.
-
dimensionality
¶ returns: Dimensionality of the Quantity, e.g.
{length: 1, time: -1}
:rtype: dict
-
dimensionless
¶
-
classmethod
from_list
(quant_list, units=None)[source]¶ Transforms a list of Quantities into an numpy.array quantity. If no units are specified, the unit of the first element will be used. Same as from_sequence.
If units is not specified and list is empty, the unit cannot be determined and a ValueError is raised.
Parameters: - quant_list (list of pint.Quantity) – list of pint.Quantity
- units (UnitsContainer, str or pint.Quantity) – units of the physical quantity to be created (Default value = None)
Returns: Return type:
-
classmethod
from_sequence
(seq, units=None)[source]¶ Transforms a sequence of Quantities into an numpy.array quantity. If no units are specified, the unit of the first element will be used.
If units is not specified and sequence is empty, the unit cannot be determined and a ValueError is raised.
Parameters: - seq (sequence of pint.Quantity) – sequence of pint.Quantity
- units (UnitsContainer, str or pint.Quantity) – units of the physical quantity to be created (Default value = None)
Returns: Return type:
-
ito
(other=None, *contexts, **ctx_kwargs)[source]¶ Inplace rescale to different units.
Parameters: - other (pint.Quantity, str or dict) – Destination units. (Default value = None)
- *contexts (str or pint.Context) – Contexts to use in the transformation.
- **ctx_kwargs – Values for the Context/s
-
ito_reduced_units
()[source]¶ Return Quantity scaled in place to reduced units, i.e. one unit per dimension. This will not reduce compound units (intentionally), nor can it make use of contexts at this time.
-
m
¶ Quantity’s magnitude. Short form for magnitude
-
m_as
(units)[source]¶ Quantity’s magnitude expressed in particular units.
Parameters: units (pint.Quantity, str or dict) – destination units
-
magnitude
¶ Quantity’s magnitude. Long form for m
-
to
(other=None, *contexts, **ctx_kwargs)[source]¶ Return Quantity rescaled to different units.
Parameters: - other (pint.Quantity, str or dict) – destination units. (Default value = None)
- *contexts (str or pint.Context) – Contexts to use in the transformation.
- **ctx_kwargs – Values for the Context/s
Returns: Return type:
-
to_compact
(unit=None)[source]¶ “Return Quantity rescaled to compact, human-readable units.
To get output in terms of a different unit, use the unit parameter.
Example
>>> import pint >>> ureg = pint.UnitRegistry() >>> (200e-9*ureg.s).to_compact() <Quantity(200.0, 'nanosecond')> >>> (1e-2*ureg('kg m/s^2')).to_compact('N') <Quantity(10.0, 'millinewton')>
-
to_reduced_units
()[source]¶ Return Quantity scaled in place to reduced units, i.e. one unit per dimension. This will not reduce compound units (intentionally), nor can it make use of contexts at this time.
-
u
¶ Quantity’s units. Short form for units
-
unitless
¶
-
units
¶ Quantity’s units. Long form for u
-
class
pint.
Unit
(units)[source]¶ Implements a class to describe a unit supporting math operations.
-
default_format
= ''¶ Default formatting string.
-
dimensionality
¶ returns: Dimensionality of the Unit, e.g.
{length: 1, time: -1}
:rtype: dict
-
dimensionless
¶ Return True if the Unit is dimensionless; False otherwise.
-
from_
(value, strict=True, name='value')[source]¶ Converts a numerical value or quantity to this unit
Parameters: - value – a Quantity (or numerical value if strict=False) to convert
- strict – boolean to indicate that only quanities are accepted (Default value = True)
- name – descriptive name to use if an exception occurs (Default value = “value”)
Returns: The converted value as this unit
Return type:
-
m_from
(value, strict=True, name='value')[source]¶ Converts a numerical value or quantity to this unit, then returns the magnitude of the converted value
Parameters: - value – a Quantity (or numerical value if strict=False) to convert
- strict – boolean to indicate that only quanities are accepted (Default value = True)
- name – descriptive name to use if an exception occurs (Default value = “value”)
Returns: The magnitude of the converted value
Return type:
-
-
class
pint.
UnitRegistry
(filename='', force_ndarray=False, force_ndarray_like=False, default_as_delta=True, autoconvert_offset_to_baseunit=False, on_redefinition='warn', system=None, auto_reduce_dimensions=False, preprocessors=None, fmt_locale=None)[source]¶ The unit registry stores the definitions and relationships between units.
Parameters: - filename – path of the units definition file to load or line-iterable object. Empty to load the default definition file. None to leave the UnitRegistry empty.
- force_ndarray (bool) – convert any input, scalar or not to a numpy.ndarray.
- force_ndarray_like (bool) – convert all inputs other than duck arrays to a numpy.ndarray.
- default_as_delta – In the context of a multiplication of units, interpret non-multiplicative units as their delta counterparts.
- autoconvert_offset_to_baseunit – If True converts offset units in quantites are converted to their base units in multiplicative context. If False no conversion happens.
- on_redefinition (str) – action to take in case a unit is redefined. ‘warn’, ‘raise’, ‘ignore’
- auto_reduce_dimensions – If True, reduce dimensionality on appropriate operations.
- preprocessors – list of callables which are iteratively ran on any input expression or unit string
- fmt_locale – locale identifier string, used in format_babel. Default to None
-
check
(*args)¶ Decorator to for quantity type checking for function inputs.
Use it to ensure that the decorated function input parameters match the expected dimension of pint quantity.
- The wrapper function raises:
- pint.DimensionalityError if an argument doesn’t match the required dimensions.
- ureg : UnitRegistry
- a UnitRegistry instance.
- args : str or UnitContainer or None
- Dimensions of each of the input arguments. Use None to skip argument conversion.
Returns: the wrapped function.
Return type: callable
Raises: TypeError
– If the number of given dimensions does not match the number of function parameters.ValueError
– If the any of the provided dimensions cannot be parsed as a dimension.
-
pi_theorem
(quantities)[source]¶ Builds dimensionless quantities using the Buckingham π theorem
Parameters: quantities (dict) – mapping between variable name and units Returns: a list of dimensionless quantities expressed as dicts Return type: list
-
setup_matplotlib
(enable=True)[source]¶ Set up handlers for matplotlib’s unit support.
Parameters: enable (bool) – whether support should be enabled or disabled (Default value = True)
-
wraps
(ret, args, strict=True)¶ Wraps a function to become pint-aware.
Use it when a function requires a numerical value but in some specific units. The wrapper function will take a pint quantity, convert to the units specified in args and then call the wrapped function with the resulting magnitude.
The value returned by the wrapped function will be converted to the units specified in ret.
Parameters: - ureg (pint.UnitRegistry) – a UnitRegistry instance.
- ret (str, pint.Unit, iterable of str, or iterable of pint.Unit) – Units of each of the return values. Use None to skip argument conversion.
- args (str, pint.Unit, iterable of str, or iterable of pint.Unit) – Units of each of the input arguments. Use None to skip argument conversion.
- strict (bool) – Indicates that only quantities are accepted. (Default value = True)
Returns: the wrapper function.
Return type: callable
Raises: TypeError
– if the number of given arguments does not match the number of function parameters. if the any of the provided arguments is not a unit a string or Quantity
-
exception
pint.
DefinitionSyntaxError
(msg, *, filename=None, lineno=None)[source]¶ Raised when a textual definition has a syntax error.
-
exception
pint.
DimensionalityError
(units1, units2, dim1='', dim2='', *, extra_msg='')[source]¶ Raised when trying to convert between incompatible units.
-
exception
pint.
RedefinitionError
(name, definition_type, *, filename=None, lineno=None)[source]¶ Raised when a unit or prefix is redefined.
-
exception
pint.
UndefinedUnitError
(*unit_names)[source]¶ Raised when the units are not defined in the unit registry.
-
pint.
formatter
(items, as_ratio=True, single_denominator=False, product_fmt=' * ', division_fmt=' / ', power_fmt='{} ** {}', parentheses_fmt='({0})', exp_call=<function <lambda>>, locale=None, babel_length='long', babel_plural_form='one')[source]¶ Format a list of (name, exponent) pairs.
Parameters: - items (list) – a list of (name, exponent) pairs.
- as_ratio (bool, optional) – True to display as ratio, False as negative powers. (Default value = True)
- single_denominator (bool, optional) – all with terms with negative exponents are collected together. (Default value = False)
- product_fmt (str) – the format used for multiplication. (Default value = ” * “)
- division_fmt (str) – the format used for division. (Default value = ” / “)
- power_fmt (str) – the format used for exponentiation. (Default value = “{} ** {}”)
- parentheses_fmt (str) – the format used for parenthesis. (Default value = “({0})”)
- locale (str) – the locale object as defined in babel. (Default value = None)
- babel_length (str) – the length of the translated unit, as defined in babel cldr. (Default value = “long”)
- babel_plural_form (str) – the plural form, calculated as defined in babel. (Default value = “one”)
- exp_call (callable) – (Default value = lambda x: f”{x:n}”)
Returns: the formula as a string.
Return type:
-
pint.
get_application_registry
()[source]¶ Return the application registry. If
set_application_registry()
was never invoked, return a registry built usingdefaults_en.txt
embedded in the pint package.Returns: Return type: pint.UnitRegistry
-
pint.
set_application_registry
(registry)[source]¶ Set the application registry, which is used for unpickling operations and when invoking pint.Quantity or pint.Unit directly.
Parameters: registry (pint.UnitRegistry) –
pint.babel¶
copyright: | 2016 by Pint Authors, see AUTHORS for more details. |
---|---|
license: | BSD, see LICENSE for more details. |
pint.compat¶
Compatibility layer.
copyright: | 2013 by Pint Authors, see AUTHORS for more details. |
---|---|
license: | BSD, see LICENSE for more details. |
-
pint.compat.
eq
(lhs, rhs, check_all)[source]¶ Comparison of scalars and arrays.
Parameters: Returns: Return type: bool or array_like of bool
pint.context¶
Functions and classes related to context definitions and application.
copyright: | 2016 by Pint Authors, see AUTHORS for more details.. |
---|---|
license: | BSD, see LICENSE for more details. |
-
class
pint.context.
Context
(name=None, aliases=(), defaults=None)[source]¶ A specialized container that defines transformation functions from one dimension to another. Each Dimension are specified using a UnitsContainer. Simple transformation are given with a function taking a single parameter.
Conversion functions may take optional keyword arguments and the context can have default values for these arguments.
Additionally, a context may host redefinitions:
A redefinition must be performed among units that already exist in the registry. It cannot change the dimensionality of a unit. The symbol and aliases are automatically inherited from the registry.
Parameters: Example
>>> from pint.util import UnitsContainer >>> timedim = UnitsContainer({'[time]': 1}) >>> spacedim = UnitsContainer({'[length]': 1}) >>> def f(time): ... 'Time to length converter' ... return 3. * time >>> c = Context() >>> c.add_transformation(timedim, spacedim, f) >>> c.transform(timedim, spacedim, 2) 6 >>> def f(time, n): ... 'Time to length converter, n is the index of refraction of the material' ... return 3. * time / n >>> c = Context(n=3) >>> c.add_transformation(timedim, spacedim, f) >>> c.transform(timedim, spacedim, 2) 2 >>> c.redefine("pound = 0.5 kg")
-
defaults
= None¶ Maps defaults variable names to values
-
classmethod
from_context
(context, **defaults)[source]¶ Creates a new context that shares the funcs dictionary with the original context. The default values are copied from the original context and updated with the new defaults.
If defaults is empty, return the same context.
Parameters: - context (pint.Context) – Original context.
- **defaults –
Returns: Return type:
-
funcs
= None¶ Maps (src, dst) -> transformation function
-
hashable
()[source]¶ Generate a unique hashable and comparable representation of self, which can be used as a key in a dict. This class cannot define
__hash__
because it is mutable, and the Python interpreter does cache the output of__hash__
.Returns: Return type: tuple
-
redefine
(definition: str) → None[source]¶ Override the definition of a unit in the registry.
Parameters: definition (str) – <unit> = <new definition>``, e.g. pound = 0.5 kg
-
relation_to_context
= None¶ Maps (src, dst) -> self Used as a convenience dictionary to be composed by ContextChain
-
-
class
pint.context.
ContextChain
[source]¶ A specialized ChainMap for contexts that simplifies finding rules to transform from one dimension to another.
-
graph
¶ The graph relating
-
hashable
()[source]¶ Generate a unique hashable and comparable representation of self, which can be used as a key in a dict. This class cannot define
__hash__
because it is mutable, and the Python interpreter does cache the output of__hash__
.
-
insert_contexts
(*contexts)[source]¶ Insert one or more contexts in reversed order the chained map. (A rule in last context will take precedence)
To facilitate the identification of the context with the matching rule, the relation_to_context dictionary of the context is used.
-
pint.converters¶
Functions and classes related to unit conversions.
copyright: | 2016 by Pint Authors, see AUTHORS for more details. |
---|---|
license: | BSD, see LICENSE for more details. |
-
class
pint.converters.
OffsetConverter
(scale, offset)[source]¶ An affine transformation.
-
is_multiplicative
¶ bool(x) -> bool
Returns True when the argument x is true, False otherwise. The builtins True and False are the only two instances of the class bool. The class bool is a subclass of the class int, and cannot be subclassed.
-
pint.definitions¶
Functions and classes related to unit definitions.
copyright: | 2016 by Pint Authors, see AUTHORS for more details. |
---|---|
license: | BSD, see LICENSE for more details. |
-
class
pint.definitions.
AliasDefinition
(name, aliases)[source]¶ Additional alias(es) for an already existing unit
-
class
pint.definitions.
Definition
(name, symbol, aliases, converter)[source]¶ Base class for definitions.
Parameters:
-
class
pint.definitions.
DimensionDefinition
(name, symbol, aliases, converter, reference=None, is_base=False)[source]¶ Definition of a dimension.
-
class
pint.definitions.
PrefixDefinition
(name, symbol, aliases, converter)[source]¶ Definition of a prefix.
-
class
pint.definitions.
UnitDefinition
(name, symbol, aliases, converter, reference=None, is_base=False)[source]¶ Definition of a unit.
Parameters: - reference (UnitsContainer) – Reference units.
- is_base (bool) – Indicates if it is a base unit.
pint.errors¶
Functions and classes related to unit definitions and conversions.
copyright: | 2016 by Pint Authors, see AUTHORS for more details. |
---|---|
license: | BSD, see LICENSE for more details. |
-
exception
pint.errors.
DefinitionSyntaxError
(msg, *, filename=None, lineno=None)[source]¶ Raised when a textual definition has a syntax error.
-
exception
pint.errors.
DimensionalityError
(units1, units2, dim1='', dim2='', *, extra_msg='')[source]¶ Raised when trying to convert between incompatible units.
-
exception
pint.errors.
OffsetUnitCalculusError
[source]¶ Raised on ambiguous operations with offset units.
-
exception
pint.errors.
RedefinitionError
(name, definition_type, *, filename=None, lineno=None)[source]¶ Raised when a unit or prefix is redefined.
pint.formatter¶
Format units for pint.
copyright: | 2016 by Pint Authors, see AUTHORS for more details. |
---|---|
license: | BSD, see LICENSE for more details. |
-
pint.formatting.
formatter
(items, as_ratio=True, single_denominator=False, product_fmt=' * ', division_fmt=' / ', power_fmt='{} ** {}', parentheses_fmt='({0})', exp_call=<function <lambda>>, locale=None, babel_length='long', babel_plural_form='one')[source]¶ Format a list of (name, exponent) pairs.
Parameters: - items (list) – a list of (name, exponent) pairs.
- as_ratio (bool, optional) – True to display as ratio, False as negative powers. (Default value = True)
- single_denominator (bool, optional) – all with terms with negative exponents are collected together. (Default value = False)
- product_fmt (str) – the format used for multiplication. (Default value = ” * “)
- division_fmt (str) – the format used for division. (Default value = ” / “)
- power_fmt (str) – the format used for exponentiation. (Default value = “{} ** {}”)
- parentheses_fmt (str) – the format used for parenthesis. (Default value = “({0})”)
- locale (str) – the locale object as defined in babel. (Default value = None)
- babel_length (str) – the length of the translated unit, as defined in babel cldr. (Default value = “long”)
- babel_plural_form (str) – the plural form, calculated as defined in babel. (Default value = “one”)
- exp_call (callable) – (Default value = lambda x: f”{x:n}”)
Returns: the formula as a string.
Return type:
pint.matplotlib¶
Functions and classes related to working with Matplotlib’s support for plotting with units.
copyright: | 2017 by Pint Authors, see AUTHORS for more details. |
---|---|
license: | BSD, see LICENSE for more details. |
-
class
pint.matplotlib.
PintAxisInfo
(units)[source]¶ Support default axis and tick labeling and default limits.
-
class
pint.matplotlib.
PintConverter
(registry)[source]¶ Implement support for pint within matplotlib’s unit conversion framework.
-
pint.matplotlib.
setup_matplotlib_handlers
(registry, enable)[source]¶ Set up matplotlib’s unit support to handle units from a registry.
Parameters: - registry (pint.UnitRegistry) – The registry that will be used.
- enable (bool) – Whether support should be enabled or disabled.
pint.measurement¶
copyright: | 2016 by Pint Authors, see AUTHORS for more details. |
---|---|
license: | BSD, see LICENSE for more details. |
-
class
pint.measurement.
Measurement
[source]¶ Implements a class to describe a quantity with uncertainty.
Parameters: - value (pint.Quantity or any numeric type) – The expected value of the measurement
- error (pint.Quantity or any numeric type) – The error or uncertainty of the measurement
pint.pint_eval¶
An expression evaluator to be used as a safe replacement for builtin eval.
copyright: | 2016 by Pint Authors, see AUTHORS for more details. |
---|---|
license: | BSD, see LICENSE for more details. |
-
class
pint.pint_eval.
EvalTreeNode
(left, operator=None, right=None)[source]¶ Single node within an evaluation tree
left + operator + right –> binary op left + operator –> unary op left + right –> implicit op left –> single value
-
pint.pint_eval.
build_eval_tree
(tokens, op_priority={'': 1, '*': 1, '**': 3, '+': 0, '-': 0, '/': 1, '^': 3, 'unary': 2}, index=0, depth=0, prev_op=None)[source]¶ Build an evaluation tree from a set of tokens.
Params: Index, depth, and prev_op used recursively, so don’t touch. Tokens is an iterable of tokens from an expression to be evaluated.
Transform the tokens from an expression into a recursive parse tree, following order of operations. Operations can include binary ops (3 + 4), implicit ops (3 kg), or unary ops (-1).
General Strategy: 1) Get left side of operator 2) If no tokens left, return final result 3) Get operator 4) Use recursion to create tree starting at token on right side of operator (start at step #1) 4.1) If recursive call encounters an operator with lower or equal priority to step #2, exit recursion 5) Combine left side, operator, and right side into a new left side 6) Go back to step #2
pint.quantity¶
copyright: | 2016 by Pint Authors, see AUTHORS for more details. |
---|---|
license: | BSD, see LICENSE for more details. |
-
class
pint.quantity.
Quantity
[source]¶ Implements a class to describe a physical quantity: the product of a numerical value and a unit of measurement.
Parameters: - value (str, pint.Quantity or any numeric type) – Value of the physical quantity to be created.
- units (UnitsContainer, str or pint.Quantity) – Units of the physical quantity to be created.
-
default_format
= ''¶ Default formatting string.
-
dimensionality
¶ returns: Dimensionality of the Quantity, e.g.
{length: 1, time: -1}
:rtype: dict
-
dimensionless
¶
-
classmethod
from_list
(quant_list, units=None)[source]¶ Transforms a list of Quantities into an numpy.array quantity. If no units are specified, the unit of the first element will be used. Same as from_sequence.
If units is not specified and list is empty, the unit cannot be determined and a ValueError is raised.
Parameters: - quant_list (list of pint.Quantity) – list of pint.Quantity
- units (UnitsContainer, str or pint.Quantity) – units of the physical quantity to be created (Default value = None)
Returns: Return type:
-
classmethod
from_sequence
(seq, units=None)[source]¶ Transforms a sequence of Quantities into an numpy.array quantity. If no units are specified, the unit of the first element will be used.
If units is not specified and sequence is empty, the unit cannot be determined and a ValueError is raised.
Parameters: - seq (sequence of pint.Quantity) – sequence of pint.Quantity
- units (UnitsContainer, str or pint.Quantity) – units of the physical quantity to be created (Default value = None)
Returns: Return type:
-
ito
(other=None, *contexts, **ctx_kwargs)[source]¶ Inplace rescale to different units.
Parameters: - other (pint.Quantity, str or dict) – Destination units. (Default value = None)
- *contexts (str or pint.Context) – Contexts to use in the transformation.
- **ctx_kwargs – Values for the Context/s
-
ito_reduced_units
()[source]¶ Return Quantity scaled in place to reduced units, i.e. one unit per dimension. This will not reduce compound units (intentionally), nor can it make use of contexts at this time.
-
m
¶ Quantity’s magnitude. Short form for magnitude
-
m_as
(units)[source]¶ Quantity’s magnitude expressed in particular units.
Parameters: units (pint.Quantity, str or dict) – destination units
-
magnitude
¶ Quantity’s magnitude. Long form for m
-
to
(other=None, *contexts, **ctx_kwargs)[source]¶ Return Quantity rescaled to different units.
Parameters: - other (pint.Quantity, str or dict) – destination units. (Default value = None)
- *contexts (str or pint.Context) – Contexts to use in the transformation.
- **ctx_kwargs – Values for the Context/s
Returns: Return type:
-
to_compact
(unit=None)[source]¶ “Return Quantity rescaled to compact, human-readable units.
To get output in terms of a different unit, use the unit parameter.
Example
>>> import pint >>> ureg = pint.UnitRegistry() >>> (200e-9*ureg.s).to_compact() <Quantity(200.0, 'nanosecond')> >>> (1e-2*ureg('kg m/s^2')).to_compact('N') <Quantity(10.0, 'millinewton')>
-
to_reduced_units
()[source]¶ Return Quantity scaled in place to reduced units, i.e. one unit per dimension. This will not reduce compound units (intentionally), nor can it make use of contexts at this time.
-
u
¶ Quantity’s units. Short form for units
-
unitless
¶
-
units
¶ Quantity’s units. Long form for u
-
pint.quantity.
printoptions
(*args, **kwargs)[source]¶ Numpy printoptions context manager released with version 1.15.0 https://docs.scipy.org/doc/numpy/reference/generated/numpy.printoptions.html
pint.registry¶
Defines the Registry, a class to contain units and their relations.
The module actually defines 5 registries with different capabilites:
- BaseRegistry: Basic unit definition and querying.
Conversion between multiplicative units.
- NonMultiplicativeRegistry: Conversion between non multiplicative (offset) units.
(e.g. Temperature)
- Inherits from BaseRegistry
- ContextRegisty: Conversion between units with different dimensions according
to previously established relations (contexts) - e.g. in spectroscopy, conversion between frequency and energy is possible. May also override conversions between units on the same dimension - e.g. different rounding conventions.
- Inherits from BaseRegistry
- SystemRegistry: Group unit and changing of base units.
(e.g. in MKS, meter, kilogram and second are base units.)
- Inherits from BaseRegistry
UnitRegistry: Combine all previous capabilities, it is exposed by Pint.
copyright: | 2016 by Pint Authors, see AUTHORS for more details. |
---|---|
license: | BSD, see LICENSE for more details. |
-
class
pint.registry.
BaseRegistry
(filename='', force_ndarray=False, force_ndarray_like=False, on_redefinition='warn', auto_reduce_dimensions=False, preprocessors=None, fmt_locale=None)[source]¶ Base class for all registries.
Capabilities:
- Register units, prefixes, and dimensions, and their relations.
- Convert between units.
- Find dimensionality of a unit.
- Parse units with prefix and/or suffix.
- Parse expressions.
- Parse a definition file.
- Allow extending the definition file parser by registering @ directives.
Parameters: - filename (str or None) – path of the units definition file to load or line iterable object. Empty to load the default definition file. None to leave the UnitRegistry empty.
- force_ndarray (bool) – convert any input, scalar or not to a numpy.ndarray.
- force_ndarray_like (bool) – convert all inputs other than duck arrays to a numpy.ndarray.
- on_redefinition (str) – action to take in case a unit is redefined: ‘warn’, ‘raise’, ‘ignore’
- auto_reduce_dimensions – If True, reduce dimensionality on appropriate operations.
- preprocessors – list of callables which are iteratively ran on any input expression or unit string
- fmt_locale – locale identifier string, used in format_babel
-
auto_reduce_dimensions
= None¶ Determines if dimensionality should be reduced on appropriate operations.
-
convert
(value, src, dst, inplace=False)[source]¶ Convert value from some source to destination units.
Parameters: - value – value
- src (pint.Quantity or str) – source units.
- dst (pint.Quantity or str) – destination units.
- inplace – (Default value = False)
Returns: converted value
Return type:
-
default_format
¶ Default formatting string for quantities.
-
define
(definition)[source]¶ Add unit to the registry.
Parameters: definition (str or Definition) – a dimension, unit or prefix definition.
-
fmt_locale
= None¶ Default locale identifier string, used when calling format_babel without explicit locale.
-
get_base_units
(input_units, check_nonmult=True, system=None)[source]¶ Convert unit or dict of units to the base units.
If any unit is non multiplicative and check_converter is True, then None is returned as the multiplicative factor.
Parameters: - input_units (UnitsContainer or str) – units
- check_nonmult (bool) – If True, None will be returned as the multiplicative factor if non-multiplicative units are found in the final Units. (Default value = True)
- system – (Default value = None)
Returns: multiplicative factor, base units
Return type: Number, pint.Unit
-
get_dimensionality
(input_units)[source]¶ Convert unit or dict of units or dimensions to a dict of base dimensions dimensions
-
get_root_units
(input_units, check_nonmult=True)[source]¶ Convert unit or dict of units to the root units.
If any unit is non multiplicative and check_converter is True, then None is returned as the multiplicative factor.
Parameters: - input_units (UnitsContainer or str) – units
- check_nonmult (bool) – if True, None will be returned as the multiplicative factor if a non-multiplicative units is found in the final Units. (Default value = True)
Returns: multiplicative factor, base units
Return type: Number, pint.Unit
-
load_definitions
(file, is_resource=False)[source]¶ Add units and prefixes defined in a definition text file.
Parameters: - file – can be a filename or a line iterable.
- is_resource – used to indicate that the file is a resource file and therefore should be loaded from the package. (Default value = False)
-
parse_expression
(input_string, case_sensitive=True, use_decimal=False, **values)[source]¶ Parse a mathematical expression including units and return a quantity object.
Numerical constants can be specified as keyword arguments and will take precedence over the names defined in the registry.
Parameters: - input_string –
- case_sensitive – (Default value = True)
- use_decimal – (Default value = False)
- **values –
-
parse_unit_name
(unit_name, case_sensitive=True)[source]¶ Parse a unit to identify prefix, unit name and suffix by walking the list of prefix and suffix. In case of equivalent combinations (e.g. (‘kilo’, ‘gram’, ‘’) and (‘’, ‘kilogram’, ‘’), prefer those with prefix.
Parameters: - unit_name –
- case_sensitive – (Default value = True)
Returns: all non-equivalent combinations of (prefix, unit name, suffix)
Return type:
-
class
pint.registry.
ContextCacheOverlay
(registry_cache: pint.registry.RegistryCache)[source]¶ Layer on top of the base UnitRegistry cache, specific to a combination of active contexts which contain unit redefinitions.
-
class
pint.registry.
ContextRegistry
(**kwargs)[source]¶ Handle of Contexts.
Conversion between units with different dimenstions according to previously established relations (contexts). (e.g. in the spectroscopy, conversion between frequency and energy is possible)
Capabilities:
- Register contexts.
- Enable and disable contexts.
- Parse @context directive.
-
add_context
(context: pint.context.Context) → None[source]¶ Add a context object to the registry.
The context will be accessible by its name and aliases.
Notice that this method will NOT enable the context; see
enable_contexts()
.
-
context
(*names, **kwargs)[source]¶ Used as a context manager, this function enables to activate a context which is removed after usage.
Parameters: - *names – name(s) of the context(s).
- **kwargs – keyword arguments for the contexts.
Examples
Context can be called by their name:
>>> with ureg.context('one'): ... pass
If a context has an argument, you can specify its value as a keyword argument:
>>> with ureg.context('one', n=1): ... pass
Multiple contexts can be entered in single call:
>>> with ureg.context('one', 'two', n=1): ... pass
Or nested allowing you to give different values to the same keyword argument:
>>> with ureg.context('one', n=1): ... with ureg.context('two', n=2): ... pass
A nested context inherits the defaults from the containing context:
>>> with ureg.context('one', n=1): ... # Here n takes the value of the outer context ... with ureg.context('two'): ... pass
-
disable_contexts
(n: int = None) → None[source]¶ Disable the last n enabled contexts.
Parameters: n (int) – Number of contexts to disable. Default: disable all contexts.
-
enable_contexts
(*names_or_contexts, **kwargs) → None[source]¶ Enable contexts provided by name or by object.
Parameters: - *names_or_contexts – one or more contexts or context names/aliases
- **kwargs – keyword arguments for the context(s)
Examples
See
context()
-
remove_context
(name_or_alias: str) → pint.context.Context[source]¶ Remove a context from the registry and return it.
Notice that this methods will not disable the context; see
disable_contexts()
.
-
with_context
(name, **kwargs)[source]¶ Decorator to wrap a function call in a Pint context.
Use it to ensure that a certain context is active when calling a function:
:param name: name of the context. :param \*\*kwargs: keyword arguments for the context
Returns: the wrapped function. Return type: callable Example
>>> @ureg.with_context('sp') ... def my_cool_fun(wavelenght): ... print('This wavelength is equivalent to: %s', wavelength.to('terahertz'))
-
class
pint.registry.
NonMultiplicativeRegistry
(default_as_delta=True, autoconvert_offset_to_baseunit=False, **kwargs)[source]¶ Handle of non multiplicative units (e.g. Temperature).
Capabilities: - Register non-multiplicative units and their relations. - Convert between non-multiplicative units.
Parameters: -
default_as_delta
= None¶ When performing a multiplication of units, interpret non-multiplicative units as their delta counterparts.
-
-
class
pint.registry.
RegistryCache
[source]¶ Cache to speed up unit registries
-
dimensional_equivalents
= None¶ Maps dimensionality (UnitsContainer) to Units (str)
-
dimensionality
= None¶ Maps dimensionality (UnitsContainer) to Units (UnitsContainer)
-
parse_unit
= None¶ Cache the unit name associated to user input. (‘mV’ -> ‘millivolt’)
-
root_units
= None¶ Maps dimensionality (UnitsContainer) to Dimensionality (UnitsContainer)
-
-
class
pint.registry.
RegistryMeta
[source]¶ This is just to call after_init at the right time instead of asking the developer to do it when subclassing.
-
class
pint.registry.
SystemRegistry
(system=None, **kwargs)[source]¶ Handle of Systems and Groups.
Conversion between units with different dimenstions according to previously established relations (contexts). (e.g. in the spectroscopy, conversion between frequency and energy is possible)
Capabilities:
- Register systems and groups.
- List systems
- Get or get the default system.
- Parse @system and @group directive.
-
get_base_units
(input_units, check_nonmult=True, system=None)[source]¶ Convert unit or dict of units to the base units.
If any unit is non multiplicative and check_converter is True, then None is returned as the multiplicative factor.
Unlike BaseRegistry, in this registry root_units might be different from base_units
Parameters: - input_units (UnitsContainer or str) – units
- check_nonmult (bool) – if True, None will be returned as the multiplicative factor if a non-multiplicative units is found in the final Units. (Default value = True)
- system – (Default value = None)
Returns: multiplicative factor, base units
Return type:
-
class
pint.registry.
UnitRegistry
(filename='', force_ndarray=False, force_ndarray_like=False, default_as_delta=True, autoconvert_offset_to_baseunit=False, on_redefinition='warn', system=None, auto_reduce_dimensions=False, preprocessors=None, fmt_locale=None)[source]¶ The unit registry stores the definitions and relationships between units.
Parameters: - filename – path of the units definition file to load or line-iterable object. Empty to load the default definition file. None to leave the UnitRegistry empty.
- force_ndarray (bool) – convert any input, scalar or not to a numpy.ndarray.
- force_ndarray_like (bool) – convert all inputs other than duck arrays to a numpy.ndarray.
- default_as_delta – In the context of a multiplication of units, interpret non-multiplicative units as their delta counterparts.
- autoconvert_offset_to_baseunit – If True converts offset units in quantites are converted to their base units in multiplicative context. If False no conversion happens.
- on_redefinition (str) – action to take in case a unit is redefined. ‘warn’, ‘raise’, ‘ignore’
- auto_reduce_dimensions – If True, reduce dimensionality on appropriate operations.
- preprocessors – list of callables which are iteratively ran on any input expression or unit string
- fmt_locale – locale identifier string, used in format_babel. Default to None
-
check
(*args)¶ Decorator to for quantity type checking for function inputs.
Use it to ensure that the decorated function input parameters match the expected dimension of pint quantity.
- The wrapper function raises:
- pint.DimensionalityError if an argument doesn’t match the required dimensions.
- ureg : UnitRegistry
- a UnitRegistry instance.
- args : str or UnitContainer or None
- Dimensions of each of the input arguments. Use None to skip argument conversion.
Returns: the wrapped function.
Return type: callable
Raises: TypeError
– If the number of given dimensions does not match the number of function parameters.ValueError
– If the any of the provided dimensions cannot be parsed as a dimension.
-
pi_theorem
(quantities)[source]¶ Builds dimensionless quantities using the Buckingham π theorem
Parameters: quantities (dict) – mapping between variable name and units Returns: a list of dimensionless quantities expressed as dicts Return type: list
-
setup_matplotlib
(enable=True)[source]¶ Set up handlers for matplotlib’s unit support.
Parameters: enable (bool) – whether support should be enabled or disabled (Default value = True)
-
wraps
(ret, args, strict=True)¶ Wraps a function to become pint-aware.
Use it when a function requires a numerical value but in some specific units. The wrapper function will take a pint quantity, convert to the units specified in args and then call the wrapped function with the resulting magnitude.
The value returned by the wrapped function will be converted to the units specified in ret.
Parameters: - ureg (pint.UnitRegistry) – a UnitRegistry instance.
- ret (str, pint.Unit, iterable of str, or iterable of pint.Unit) – Units of each of the return values. Use None to skip argument conversion.
- args (str, pint.Unit, iterable of str, or iterable of pint.Unit) – Units of each of the input arguments. Use None to skip argument conversion.
- strict (bool) – Indicates that only quantities are accepted. (Default value = True)
Returns: the wrapper function.
Return type: callable
Raises: TypeError
– if the number of given arguments does not match the number of function parameters. if the any of the provided arguments is not a unit a string or Quantity
pint.registry_helpers¶
Miscellaneous methods of the registry writen as separate functions.
copyright: | 2016 by Pint Authors, see AUTHORS for more details.. |
---|---|
license: | BSD, see LICENSE for more details. |
-
pint.registry_helpers.
check
(ureg, *args)[source]¶ Decorator to for quantity type checking for function inputs.
Use it to ensure that the decorated function input parameters match the expected dimension of pint quantity.
- The wrapper function raises:
- pint.DimensionalityError if an argument doesn’t match the required dimensions.
- ureg : UnitRegistry
- a UnitRegistry instance.
- args : str or UnitContainer or None
- Dimensions of each of the input arguments. Use None to skip argument conversion.
Returns: the wrapped function.
Return type: callable
Raises: TypeError
– If the number of given dimensions does not match the number of function parameters.ValueError
– If the any of the provided dimensions cannot be parsed as a dimension.
-
pint.registry_helpers.
wraps
(ureg, ret, args, strict=True)[source]¶ Wraps a function to become pint-aware.
Use it when a function requires a numerical value but in some specific units. The wrapper function will take a pint quantity, convert to the units specified in args and then call the wrapped function with the resulting magnitude.
The value returned by the wrapped function will be converted to the units specified in ret.
Parameters: - ureg (pint.UnitRegistry) – a UnitRegistry instance.
- ret (str, pint.Unit, iterable of str, or iterable of pint.Unit) – Units of each of the return values. Use None to skip argument conversion.
- args (str, pint.Unit, iterable of str, or iterable of pint.Unit) – Units of each of the input arguments. Use None to skip argument conversion.
- strict (bool) – Indicates that only quantities are accepted. (Default value = True)
Returns: the wrapper function.
Return type: callable
Raises: TypeError
– if the number of given arguments does not match the number of function parameters. if the any of the provided arguments is not a unit a string or Quantity
pint.systems¶
Functions and classes related to system definitions and conversions.
copyright: | 2016 by Pint Authors, see AUTHORS for more details. |
---|---|
license: | BSD, see LICENSE for more details. |
-
class
pint.systems.
Group
(name)[source]¶ A group is a set of units.
Units can be added directly or by including other groups.
Members are computed dynamically, that is if a unit is added to a group X all groups that include X are affected.
The group belongs to one Registry.
It can be specified in the definition file as:
@group <name> [using <group 1>, ..., <group N>] <definition 1> ... <definition N> @end
-
classmethod
from_lines
(lines, define_func)[source]¶ Return a Group object parsing an iterable of lines.
Parameters:
-
members
¶ Names of the units that are members of the group.
Calculated to include to all units in all included _used_groups.
-
classmethod
-
class
pint.systems.
System
(name)[source]¶ A system is a Group plus a set of base units.
Members are computed dynamically, that is if a unit is added to a group X all groups that include X are affected.
The System belongs to one Registry.
It can be specified in the definition file as:
@system <name> [using <group 1>, ..., <group N>] <rule 1> ... <rule N> @end
The syntax for the rule is:
new_unit_name : old_unit_name- where:
- old_unit_name: a root unit part which is going to be removed from the system.
- new_unit_name: a non root unit which is going to replace the old_unit.
If the new_unit_name and the old_unit_name, the later and the colon can be ommited.
-
base_units
= None¶ Maps root unit names to a dict indicating the new unit and its exponent. :type: dict[str, dict[str, number]]]
-
derived_units
= None¶ Derived unit names. :type: set(str)
-
name
= None¶ Name of the system :type: str
pint.unit¶
Functions and classes related to unit definitions and conversions.
copyright: | 2016 by Pint Authors, see AUTHORS for more details. |
---|---|
license: | BSD, see LICENSE for more details. |
-
class
pint.unit.
Unit
(units)[source]¶ Implements a class to describe a unit supporting math operations.
-
default_format
= ''¶ Default formatting string.
-
dimensionality
¶ returns: Dimensionality of the Unit, e.g.
{length: 1, time: -1}
:rtype: dict
-
dimensionless
¶ Return True if the Unit is dimensionless; False otherwise.
-
from_
(value, strict=True, name='value')[source]¶ Converts a numerical value or quantity to this unit
Parameters: - value – a Quantity (or numerical value if strict=False) to convert
- strict – boolean to indicate that only quanities are accepted (Default value = True)
- name – descriptive name to use if an exception occurs (Default value = “value”)
Returns: The converted value as this unit
Return type:
-
m_from
(value, strict=True, name='value')[source]¶ Converts a numerical value or quantity to this unit, then returns the magnitude of the converted value
Parameters: - value – a Quantity (or numerical value if strict=False) to convert
- strict – boolean to indicate that only quanities are accepted (Default value = True)
- name – descriptive name to use if an exception occurs (Default value = “value”)
Returns: The magnitude of the converted value
Return type:
-
pint.util¶
Miscellaneous functions for pint.
copyright: | 2016 by Pint Authors, see AUTHORS for more details. |
---|---|
license: | BSD, see LICENSE for more details. |
-
class
pint.util.
BlockIterator
[source]¶ Like SourceIterator but stops when it finds ‘@end’ It also raises an error if another ‘@’ directive is found inside.
-
class
pint.util.
ParserHelper
(scale=1, *args, **kwargs)[source]¶ The ParserHelper stores in place the product of variables and their respective exponent and implements the corresponding operations.
ParserHelper is a read-only mapping. All operations (even in place ones)
Returns: WARNING : The hash value used does not take into account the scale attribute so be careful if you use it as a dict key and then two unequal object can have the same hash. Return type: type
Base class for object keeping a reference to the registree.
Such object are for now Quantity and Unit, in a number of places it is that an object from this class has a ‘_units’ attribute.
-
class
pint.util.
SourceIterator
[source]¶ Iterator to facilitate reading the definition files.
Accepts any sequence (like a list of lines, a file or another SourceIterator)
The iterator yields the line number and line (skipping comments and empty lines) and stripping white spaces.
- for lineno, line in SourceIterator(sequence):
- # do something here
-
class
pint.util.
UnitsContainer
(*args, **kwargs)[source]¶ The UnitsContainer stores the product of units and their respective exponent and implements the corresponding operations.
UnitsContainer is a read-only mapping. All operations (even in place ones)
Returns: Return type: type
-
pint.util.
column_echelon_form
(matrix, ntype=<class 'fractions.Fraction'>, transpose_result=False)[source]¶ Calculates the column echelon form using Gaussian elimination.
Parameters: - matrix – a 2D matrix as nested list.
- ntype – the numerical type to use in the calculation. (Default value = Fraction)
- transpose_result – indicates if the returned matrix should be transposed. (Default value = False)
Returns: column echelon form, transformed identity matrix, swapped rows
Return type:
-
pint.util.
getattr_maybe_raise
(self, item)[source]¶ Helper function to invoke at the beginning of all overridden
__getattr__
methods. Raise AttributeError if the user tries to ask for a _ or __ attribute.Parameters: item –
-
pint.util.
iterable
(y)[source]¶ Check whether or not an object can be iterated over.
Vendored from numpy under the terms of the BSD 3-Clause License. (Copyright (c) 2005-2019, NumPy Developers.)
Parameters: - value – Input object.
- type – object
- y –
-
pint.util.
matrix_to_string
(matrix, row_headers=None, col_headers=None, fmtfun=<function <lambda>>)[source]¶ Takes a 2D matrix (as nested list) and returns a string.
Parameters: - matrix –
- row_headers – (Default value = None)
- col_headers – (Default value = None)
- fmtfun – (Default value = lambda x: str(int(x)))
-
pint.util.
pi_theorem
(quantities, registry=None)[source]¶ Builds dimensionless quantities using the Buckingham π theorem
Parameters: - quantities (dict) – mapping between variable name and units
- registry – (Default value = None)
Returns: a list of dimensionless quantities expressed as dicts
Return type:
-
pint.util.
sized
(y)[source]¶ Check whether or not an object has a defined length.
Parameters: - value – Input object.
- type – object
- y –
-
pint.util.
solve_dependencies
(dependencies)[source]¶ Solve a dependency graph.
Parameters: dependencies – dependency dictionary. For each key, the value is an iterable indicating its dependencies. Returns: iterator of sets, each containing keys of independents tasks dependent only of the previous tasks in the list. Return type: type
-
pint.util.
to_units_container
(unit_like, registry=None)[source]¶ Convert a unit compatible type to a UnitsContainer.
Parameters: - unit_like –
- registry – (Default value = None)
-
class
pint.testsuite.helpers.
PintOutputChecker
[source]¶ -
check_output
(want, got, optionflags)[source]¶ Return True iff the actual output from an example (got) matches the expected output (want). These strings are always considered to match if they are identical; but depending on what option flags the test runner is using, several non-exact match types are also possible. See the documentation for TestRunner for more information about option flags.
-
-
pint.testsuite.test_issues.
test_issue973
()[source]¶ Verify that an empty array Quantity can be created through multiplication.
-
class
pint.testsuite.test_quantity.
TestCompareZero
(methodName='runTest')[source]¶ This test case checks the special treatment that the zero value receives in the comparisons: pint>=0.9 supports comparisons against zero even for non-dimensionless quantities
-
class
pint.testsuite.test_quantity.
TestOffsetUnitMath
(methodName='runTest')[source]¶ -
test_addition_00001
(input_tuple, expected)¶ test_addition (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘kelvin’), (10, ‘kelvin’)); expected_output = (110, ‘kelvin’)]
-
test_addition_00002
(input_tuple, expected)¶ test_addition (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘kelvin’), (10, ‘degC’)); expected_output = error]
-
test_addition_00003
(input_tuple, expected)¶ test_addition (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘kelvin’), (10, ‘degF’)); expected_output = error]
-
test_addition_00004
(input_tuple, expected)¶ test_addition (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘kelvin’), (10, ‘degR’)); expected_output = (105.56, ‘kelvin’)]
-
test_addition_00005
(input_tuple, expected)¶ test_addition (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘kelvin’), (10, ‘delta_degC’)); expected_output = (110, ‘kelvin’)]
-
test_addition_00006
(input_tuple, expected)¶ test_addition (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘kelvin’), (10, ‘delta_degF’)); expected_output = (105.56, ‘kelvin’)]
-
test_addition_00007
(input_tuple, expected)¶ test_addition (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degC’), (10, ‘kelvin’)); expected_output = error]
-
test_addition_00008
(input_tuple, expected)¶ test_addition (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degC’), (10, ‘degC’)); expected_output = error]
-
test_addition_00009
(input_tuple, expected)¶ test_addition (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degC’), (10, ‘degF’)); expected_output = error]
-
test_addition_00010
(input_tuple, expected)¶ test_addition (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degC’), (10, ‘degR’)); expected_output = error]
-
test_addition_00011
(input_tuple, expected)¶ test_addition (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degC’), (10, ‘delta_degC’)); expected_output = (110, ‘degC’)]
-
test_addition_00012
(input_tuple, expected)¶ test_addition (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degC’), (10, ‘delta_degF’)); expected_output = (105.56, ‘degC’)]
-
test_addition_00013
(input_tuple, expected)¶ test_addition (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degF’), (10, ‘kelvin’)); expected_output = error]
-
test_addition_00014
(input_tuple, expected)¶ test_addition (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degF’), (10, ‘degC’)); expected_output = error]
-
test_addition_00015
(input_tuple, expected)¶ test_addition (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degF’), (10, ‘degF’)); expected_output = error]
-
test_addition_00016
(input_tuple, expected)¶ test_addition (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degF’), (10, ‘degR’)); expected_output = error]
-
test_addition_00017
(input_tuple, expected)¶ test_addition (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degF’), (10, ‘delta_degC’)); expected_output = (118, ‘degF’)]
-
test_addition_00018
(input_tuple, expected)¶ test_addition (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degF’), (10, ‘delta_degF’)); expected_output = (110, ‘degF’)]
-
test_addition_00019
(input_tuple, expected)¶ test_addition (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degR’), (10, ‘kelvin’)); expected_output = (118, ‘degR’)]
-
test_addition_00020
(input_tuple, expected)¶ test_addition (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degR’), (10, ‘degC’)); expected_output = error]
-
test_addition_00021
(input_tuple, expected)¶ test_addition (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degR’), (10, ‘degF’)); expected_output = error]
-
test_addition_00022
(input_tuple, expected)¶ test_addition (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degR’), (10, ‘degR’)); expected_output = (110, ‘degR’)]
-
test_addition_00023
(input_tuple, expected)¶ test_addition (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degR’), (10, ‘delta_degC’)); expected_output = (118, ‘degR’)]
-
test_addition_00024
(input_tuple, expected)¶ test_addition (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degR’), (10, ‘delta_degF’)); expected_output = (110, ‘degR’)]
-
test_addition_00025
(input_tuple, expected)¶ test_addition (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘delta_degC’), (10, ‘kelvin’)); expected_output = (110, ‘kelvin’)]
-
test_addition_00026
(input_tuple, expected)¶ test_addition (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘delta_degC’), (10, ‘degC’)); expected_output = (110, ‘degC’)]
-
test_addition_00027
(input_tuple, expected)¶ test_addition (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘delta_degC’), (10, ‘degF’)); expected_output = (190, ‘degF’)]
-
test_addition_00028
(input_tuple, expected)¶ test_addition (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘delta_degC’), (10, ‘degR’)); expected_output = (190, ‘degR’)]
-
test_addition_00029
(input_tuple, expected)¶ test_addition (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘delta_degC’), (10, ‘delta_degC’)); expected_output = (110, ‘delta_degC’)]
-
test_addition_00030
(input_tuple, expected)¶ test_addition (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘delta_degC’), (10, ‘delta_degF’)); expected_output = (105.56, ‘delta_degC’)]
-
test_addition_00031
(input_tuple, expected)¶ test_addition (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘delta_degF’), (10, ‘kelvin’)); expected_output = (65.56, ‘kelvin’)]
-
test_addition_00032
(input_tuple, expected)¶ test_addition (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘delta_degF’), (10, ‘degC’)); expected_output = (65.56, ‘degC’)]
-
test_addition_00033
(input_tuple, expected)¶ test_addition (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘delta_degF’), (10, ‘degF’)); expected_output = (110, ‘degF’)]
-
test_addition_00034
(input_tuple, expected)¶ test_addition (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘delta_degF’), (10, ‘degR’)); expected_output = (110, ‘degR’)]
-
test_addition_00035
(input_tuple, expected)¶ test_addition (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘delta_degF’), (10, ‘delta_degC’)); expected_output = (118, ‘delta_degF’)]
-
test_addition_00036
(input_tuple, expected)¶ test_addition (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘delta_degF’), (10, ‘delta_degF’)); expected_output = (110, ‘delta_degF’)]
-
test_division_with_scalar_00001
(input_tuple, expected)¶ test_division_with_scalar (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((10, ‘kelvin’), 2); expected_output = [(5.0, ‘kelvin’), (5.0, ‘kelvin’)]]
-
test_division_with_scalar_00002
(input_tuple, expected)¶ test_division_with_scalar (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((10, ‘kelvin**2’), 2); expected_output = [(5.0, ‘kelvin**2’), (5.0, ‘kelvin**2’)]]
-
test_division_with_scalar_00003
(input_tuple, expected)¶ test_division_with_scalar (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((10, ‘degC’), 2); expected_output = [‘error’, ‘error’]]
-
test_division_with_scalar_00004
(input_tuple, expected)¶ test_division_with_scalar (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((10, ‘degC**2’), 2); expected_output = [‘error’, ‘error’]]
-
test_division_with_scalar_00005
(input_tuple, expected)¶ test_division_with_scalar (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((10, ‘degC**-2’), 2); expected_output = [‘error’, ‘error’]]
-
test_division_with_scalar_00006
(input_tuple, expected)¶ test_division_with_scalar (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = (2, (10, ‘kelvin’)); expected_output = [(0.2, ‘1/kelvin’), (0.2, ‘1/kelvin’)]]
-
test_division_with_scalar_00007
(input_tuple, expected)¶ test_division_with_scalar (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = (2, (10, ‘degC’)); expected_output = [‘error’, (0.007063393960798164, ‘1/kelvin’)]]
-
test_division_with_scalar_00008
(input_tuple, expected)¶ test_division_with_scalar (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = (2, (10, ‘degC**2’)); expected_output = [‘error’, ‘error’]]
-
test_division_with_scalar_00009
(input_tuple, expected)¶ test_division_with_scalar (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = (2, (10, ‘degC**-2’)); expected_output = [‘error’, ‘error’]]
-
test_exponentiation_00001
(input_tuple, expected)¶ test_exponentiation (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((10, ‘degC’), 1); expected_output = [(10, ‘degC’), (10, ‘degC’)]]
-
test_exponentiation_00002
(input_tuple, expected)¶ test_exponentiation (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((10, ‘degC’), 0.5); expected_output = [‘error’, (16.827061537891872, ‘kelvin**0.5’)]]
-
test_exponentiation_00003
(input_tuple, expected)¶ test_exponentiation (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((10, ‘degC’), 0); expected_output = [(1.0, ‘’), (1.0, ‘’)]]
-
test_exponentiation_00004
(input_tuple, expected)¶ test_exponentiation (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((10, ‘degC’), -1); expected_output = [‘error’, (0.003531696980399082, ‘kelvin**-1’)]]
-
test_exponentiation_00005
(input_tuple, expected)¶ test_exponentiation (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((10, ‘degC’), -2); expected_output = [‘error’, (1.2472883561359994e-05, ‘kelvin**-2’)]]
-
test_exponentiation_00006
(input_tuple, expected)¶ test_exponentiation (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((0, ‘degC’), -2); expected_output = [‘error’, (1.3402863367625568e-05, ‘kelvin**-2’)]]
-
test_exponentiation_00007
(input_tuple, expected)¶ test_exponentiation (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((10, ‘degC’), (2, ‘’)); expected_output = [‘error’, (80173.92249999999, ‘kelvin**2’)]]
-
test_exponentiation_00008
(input_tuple, expected)¶ test_exponentiation (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((10, ‘degC’), (10, ‘degK’)); expected_output = [‘error’, ‘error’]]
-
test_exponentiation_00009
(input_tuple, expected)¶ test_exponentiation (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((10, ‘kelvin’), (2, ‘’)); expected_output = [(100.0, ‘kelvin**2’), (100.0, ‘kelvin**2’)]]
-
test_exponentiation_00010
(input_tuple, expected)¶ test_exponentiation (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = (2, (2, ‘kelvin’)); expected_output = [‘error’, ‘error’]]
-
test_exponentiation_00011
(input_tuple, expected)¶ test_exponentiation (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = (2, (500.0, ‘millikelvin/kelvin’)); expected_output = [1.4142135623730951, 1.4142135623730951]]
-
test_exponentiation_00012
(input_tuple, expected)¶ test_exponentiation (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = (2, (0.5, ‘kelvin/kelvin’)); expected_output = [1.4142135623730951, 1.4142135623730951]]
-
test_exponentiation_00013
(input_tuple, expected)¶ test_exponentiation (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((10, ‘degC’), (500.0, ‘millikelvin/kelvin’)); expected_output = [‘error’, (16.827061537891872, ‘kelvin**0.5’)]]
-
test_inplace_addition_00001
(input_tuple, expected)¶ test_inplace_addition (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘kelvin’), (10, ‘kelvin’)); expected_output = (110, ‘kelvin’)]
-
test_inplace_addition_00002
(input_tuple, expected)¶ test_inplace_addition (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘kelvin’), (10, ‘degC’)); expected_output = error]
-
test_inplace_addition_00003
(input_tuple, expected)¶ test_inplace_addition (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘kelvin’), (10, ‘degF’)); expected_output = error]
-
test_inplace_addition_00004
(input_tuple, expected)¶ test_inplace_addition (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘kelvin’), (10, ‘degR’)); expected_output = (105.56, ‘kelvin’)]
-
test_inplace_addition_00005
(input_tuple, expected)¶ test_inplace_addition (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘kelvin’), (10, ‘delta_degC’)); expected_output = (110, ‘kelvin’)]
-
test_inplace_addition_00006
(input_tuple, expected)¶ test_inplace_addition (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘kelvin’), (10, ‘delta_degF’)); expected_output = (105.56, ‘kelvin’)]
-
test_inplace_addition_00007
(input_tuple, expected)¶ test_inplace_addition (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degC’), (10, ‘kelvin’)); expected_output = error]
-
test_inplace_addition_00008
(input_tuple, expected)¶ test_inplace_addition (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degC’), (10, ‘degC’)); expected_output = error]
-
test_inplace_addition_00009
(input_tuple, expected)¶ test_inplace_addition (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degC’), (10, ‘degF’)); expected_output = error]
-
test_inplace_addition_00010
(input_tuple, expected)¶ test_inplace_addition (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degC’), (10, ‘degR’)); expected_output = error]
-
test_inplace_addition_00011
(input_tuple, expected)¶ test_inplace_addition (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degC’), (10, ‘delta_degC’)); expected_output = (110, ‘degC’)]
-
test_inplace_addition_00012
(input_tuple, expected)¶ test_inplace_addition (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degC’), (10, ‘delta_degF’)); expected_output = (105.56, ‘degC’)]
-
test_inplace_addition_00013
(input_tuple, expected)¶ test_inplace_addition (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degF’), (10, ‘kelvin’)); expected_output = error]
-
test_inplace_addition_00014
(input_tuple, expected)¶ test_inplace_addition (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degF’), (10, ‘degC’)); expected_output = error]
-
test_inplace_addition_00015
(input_tuple, expected)¶ test_inplace_addition (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degF’), (10, ‘degF’)); expected_output = error]
-
test_inplace_addition_00016
(input_tuple, expected)¶ test_inplace_addition (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degF’), (10, ‘degR’)); expected_output = error]
-
test_inplace_addition_00017
(input_tuple, expected)¶ test_inplace_addition (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degF’), (10, ‘delta_degC’)); expected_output = (118, ‘degF’)]
-
test_inplace_addition_00018
(input_tuple, expected)¶ test_inplace_addition (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degF’), (10, ‘delta_degF’)); expected_output = (110, ‘degF’)]
-
test_inplace_addition_00019
(input_tuple, expected)¶ test_inplace_addition (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degR’), (10, ‘kelvin’)); expected_output = (118, ‘degR’)]
-
test_inplace_addition_00020
(input_tuple, expected)¶ test_inplace_addition (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degR’), (10, ‘degC’)); expected_output = error]
-
test_inplace_addition_00021
(input_tuple, expected)¶ test_inplace_addition (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degR’), (10, ‘degF’)); expected_output = error]
-
test_inplace_addition_00022
(input_tuple, expected)¶ test_inplace_addition (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degR’), (10, ‘degR’)); expected_output = (110, ‘degR’)]
-
test_inplace_addition_00023
(input_tuple, expected)¶ test_inplace_addition (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degR’), (10, ‘delta_degC’)); expected_output = (118, ‘degR’)]
-
test_inplace_addition_00024
(input_tuple, expected)¶ test_inplace_addition (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degR’), (10, ‘delta_degF’)); expected_output = (110, ‘degR’)]
-
test_inplace_addition_00025
(input_tuple, expected)¶ test_inplace_addition (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘delta_degC’), (10, ‘kelvin’)); expected_output = (110, ‘kelvin’)]
-
test_inplace_addition_00026
(input_tuple, expected)¶ test_inplace_addition (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘delta_degC’), (10, ‘degC’)); expected_output = (110, ‘degC’)]
-
test_inplace_addition_00027
(input_tuple, expected)¶ test_inplace_addition (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘delta_degC’), (10, ‘degF’)); expected_output = (190, ‘degF’)]
-
test_inplace_addition_00028
(input_tuple, expected)¶ test_inplace_addition (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘delta_degC’), (10, ‘degR’)); expected_output = (190, ‘degR’)]
-
test_inplace_addition_00029
(input_tuple, expected)¶ test_inplace_addition (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘delta_degC’), (10, ‘delta_degC’)); expected_output = (110, ‘delta_degC’)]
-
test_inplace_addition_00030
(input_tuple, expected)¶ test_inplace_addition (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘delta_degC’), (10, ‘delta_degF’)); expected_output = (105.56, ‘delta_degC’)]
-
test_inplace_addition_00031
(input_tuple, expected)¶ test_inplace_addition (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘delta_degF’), (10, ‘kelvin’)); expected_output = (65.56, ‘kelvin’)]
-
test_inplace_addition_00032
(input_tuple, expected)¶ test_inplace_addition (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘delta_degF’), (10, ‘degC’)); expected_output = (65.56, ‘degC’)]
-
test_inplace_addition_00033
(input_tuple, expected)¶ test_inplace_addition (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘delta_degF’), (10, ‘degF’)); expected_output = (110, ‘degF’)]
-
test_inplace_addition_00034
(input_tuple, expected)¶ test_inplace_addition (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘delta_degF’), (10, ‘degR’)); expected_output = (110, ‘degR’)]
-
test_inplace_addition_00035
(input_tuple, expected)¶ test_inplace_addition (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘delta_degF’), (10, ‘delta_degC’)); expected_output = (118, ‘delta_degF’)]
-
test_inplace_addition_00036
(input_tuple, expected)¶ test_inplace_addition (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘delta_degF’), (10, ‘delta_degF’)); expected_output = (110, ‘delta_degF’)]
-
test_inplace_exponentiation_00001
(input_tuple, expected)¶ test_inplace_exponentiation (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((10, ‘degC’), 1); expected_output = [(10, ‘degC’), (10, ‘degC’)]]
-
test_inplace_exponentiation_00002
(input_tuple, expected)¶ test_inplace_exponentiation (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((10, ‘degC’), 0.5); expected_output = [‘error’, (16.827061537891872, ‘kelvin**0.5’)]]
-
test_inplace_exponentiation_00003
(input_tuple, expected)¶ test_inplace_exponentiation (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((10, ‘degC’), 0); expected_output = [(1.0, ‘’), (1.0, ‘’)]]
-
test_inplace_exponentiation_00004
(input_tuple, expected)¶ test_inplace_exponentiation (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((10, ‘degC’), -1); expected_output = [‘error’, (0.003531696980399082, ‘kelvin**-1’)]]
-
test_inplace_exponentiation_00005
(input_tuple, expected)¶ test_inplace_exponentiation (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((10, ‘degC’), -2); expected_output = [‘error’, (1.2472883561359994e-05, ‘kelvin**-2’)]]
-
test_inplace_exponentiation_00006
(input_tuple, expected)¶ test_inplace_exponentiation (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((0, ‘degC’), -2); expected_output = [‘error’, (1.3402863367625568e-05, ‘kelvin**-2’)]]
-
test_inplace_exponentiation_00007
(input_tuple, expected)¶ test_inplace_exponentiation (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((10, ‘degC’), (2, ‘’)); expected_output = [‘error’, (80173.92249999999, ‘kelvin**2’)]]
-
test_inplace_exponentiation_00008
(input_tuple, expected)¶ test_inplace_exponentiation (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((10, ‘degC’), (10, ‘degK’)); expected_output = [‘error’, ‘error’]]
-
test_inplace_exponentiation_00009
(input_tuple, expected)¶ test_inplace_exponentiation (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((10, ‘kelvin’), (2, ‘’)); expected_output = [(100.0, ‘kelvin**2’), (100.0, ‘kelvin**2’)]]
-
test_inplace_exponentiation_00010
(input_tuple, expected)¶ test_inplace_exponentiation (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = (2, (2, ‘kelvin’)); expected_output = [‘error’, ‘error’]]
-
test_inplace_exponentiation_00011
(input_tuple, expected)¶ test_inplace_exponentiation (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = (2, (500.0, ‘millikelvin/kelvin’)); expected_output = [1.4142135623730951, 1.4142135623730951]]
-
test_inplace_exponentiation_00012
(input_tuple, expected)¶ test_inplace_exponentiation (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = (2, (0.5, ‘kelvin/kelvin’)); expected_output = [1.4142135623730951, 1.4142135623730951]]
-
test_inplace_exponentiation_00013
(input_tuple, expected)¶ test_inplace_exponentiation (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((10, ‘degC’), (500.0, ‘millikelvin/kelvin’)); expected_output = [‘error’, (16.827061537891872, ‘kelvin**0.5’)]]
-
test_inplace_multiplication_00001
(input_tuple, expected)¶ test_inplace_multiplication (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘kelvin’), (10, ‘kelvin’)); expected_output = (1000, ‘kelvin**2’)]
-
test_inplace_multiplication_00002
(input_tuple, expected)¶ test_inplace_multiplication (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘kelvin’), (10, ‘degC’)); expected_output = error]
-
test_inplace_multiplication_00003
(input_tuple, expected)¶ test_inplace_multiplication (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘kelvin’), (10, ‘degF’)); expected_output = error]
-
test_inplace_multiplication_00004
(input_tuple, expected)¶ test_inplace_multiplication (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘kelvin’), (10, ‘degR’)); expected_output = (1000, ‘kelvin*degR’)]
-
test_inplace_multiplication_00005
(input_tuple, expected)¶ test_inplace_multiplication (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘kelvin’), (10, ‘delta_degC’)); expected_output = (1000, ‘kelvin*delta_degC’)]
-
test_inplace_multiplication_00006
(input_tuple, expected)¶ test_inplace_multiplication (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘kelvin’), (10, ‘delta_degF’)); expected_output = (1000, ‘kelvin*delta_degF’)]
-
test_inplace_multiplication_00007
(input_tuple, expected)¶ test_inplace_multiplication (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degC’), (10, ‘kelvin’)); expected_output = error]
-
test_inplace_multiplication_00008
(input_tuple, expected)¶ test_inplace_multiplication (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degC’), (10, ‘degC’)); expected_output = error]
-
test_inplace_multiplication_00009
(input_tuple, expected)¶ test_inplace_multiplication (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degC’), (10, ‘degF’)); expected_output = error]
-
test_inplace_multiplication_00010
(input_tuple, expected)¶ test_inplace_multiplication (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degC’), (10, ‘degR’)); expected_output = error]
-
test_inplace_multiplication_00011
(input_tuple, expected)¶ test_inplace_multiplication (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degC’), (10, ‘delta_degC’)); expected_output = error]
-
test_inplace_multiplication_00012
(input_tuple, expected)¶ test_inplace_multiplication (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degC’), (10, ‘delta_degF’)); expected_output = error]
-
test_inplace_multiplication_00013
(input_tuple, expected)¶ test_inplace_multiplication (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degF’), (10, ‘kelvin’)); expected_output = error]
-
test_inplace_multiplication_00014
(input_tuple, expected)¶ test_inplace_multiplication (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degF’), (10, ‘degC’)); expected_output = error]
-
test_inplace_multiplication_00015
(input_tuple, expected)¶ test_inplace_multiplication (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degF’), (10, ‘degF’)); expected_output = error]
-
test_inplace_multiplication_00016
(input_tuple, expected)¶ test_inplace_multiplication (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degF’), (10, ‘degR’)); expected_output = error]
-
test_inplace_multiplication_00017
(input_tuple, expected)¶ test_inplace_multiplication (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degF’), (10, ‘delta_degC’)); expected_output = error]
-
test_inplace_multiplication_00018
(input_tuple, expected)¶ test_inplace_multiplication (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degF’), (10, ‘delta_degF’)); expected_output = error]
-
test_inplace_multiplication_00019
(input_tuple, expected)¶ test_inplace_multiplication (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degR’), (10, ‘kelvin’)); expected_output = (1000, ‘degR*kelvin’)]
-
test_inplace_multiplication_00020
(input_tuple, expected)¶ test_inplace_multiplication (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degR’), (10, ‘degC’)); expected_output = error]
-
test_inplace_multiplication_00021
(input_tuple, expected)¶ test_inplace_multiplication (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degR’), (10, ‘degF’)); expected_output = error]
-
test_inplace_multiplication_00022
(input_tuple, expected)¶ test_inplace_multiplication (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degR’), (10, ‘degR’)); expected_output = (1000, ‘degR**2’)]
-
test_inplace_multiplication_00023
(input_tuple, expected)¶ test_inplace_multiplication (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degR’), (10, ‘delta_degC’)); expected_output = (1000, ‘degR*delta_degC’)]
-
test_inplace_multiplication_00024
(input_tuple, expected)¶ test_inplace_multiplication (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degR’), (10, ‘delta_degF’)); expected_output = (1000, ‘degR*delta_degF’)]
-
test_inplace_multiplication_00025
(input_tuple, expected)¶ test_inplace_multiplication (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘delta_degC’), (10, ‘kelvin’)); expected_output = (1000, ‘delta_degC*kelvin’)]
-
test_inplace_multiplication_00026
(input_tuple, expected)¶ test_inplace_multiplication (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘delta_degC’), (10, ‘degC’)); expected_output = error]
-
test_inplace_multiplication_00027
(input_tuple, expected)¶ test_inplace_multiplication (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘delta_degC’), (10, ‘degF’)); expected_output = error]
-
test_inplace_multiplication_00028
(input_tuple, expected)¶ test_inplace_multiplication (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘delta_degC’), (10, ‘degR’)); expected_output = (1000, ‘delta_degC*degR’)]
-
test_inplace_multiplication_00029
(input_tuple, expected)¶ test_inplace_multiplication (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘delta_degC’), (10, ‘delta_degC’)); expected_output = (1000, ‘delta_degC**2’)]
-
test_inplace_multiplication_00030
(input_tuple, expected)¶ test_inplace_multiplication (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘delta_degC’), (10, ‘delta_degF’)); expected_output = (1000, ‘delta_degC*delta_degF’)]
-
test_inplace_multiplication_00031
(input_tuple, expected)¶ test_inplace_multiplication (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘delta_degF’), (10, ‘kelvin’)); expected_output = (1000, ‘delta_degF*kelvin’)]
-
test_inplace_multiplication_00032
(input_tuple, expected)¶ test_inplace_multiplication (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘delta_degF’), (10, ‘degC’)); expected_output = error]
-
test_inplace_multiplication_00033
(input_tuple, expected)¶ test_inplace_multiplication (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘delta_degF’), (10, ‘degF’)); expected_output = error]
-
test_inplace_multiplication_00034
(input_tuple, expected)¶ test_inplace_multiplication (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘delta_degF’), (10, ‘degR’)); expected_output = (1000, ‘delta_degF*degR’)]
-
test_inplace_multiplication_00035
(input_tuple, expected)¶ test_inplace_multiplication (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘delta_degF’), (10, ‘delta_degC’)); expected_output = (1000, ‘delta_degF*delta_degC’)]
-
test_inplace_multiplication_00036
(input_tuple, expected)¶ test_inplace_multiplication (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘delta_degF’), (10, ‘delta_degF’)); expected_output = (1000, ‘delta_degF**2’)]
-
test_inplace_multiplication_with_autoconvert_00001
(input_tuple, expected)¶ test_inplace_multiplication_with_autoconvert (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘kelvin’), (10, ‘degC’)); expected_output = (28315.0, ‘kelvin**2’)]
-
test_inplace_multiplication_with_autoconvert_00002
(input_tuple, expected)¶ test_inplace_multiplication_with_autoconvert (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘kelvin’), (10, ‘degF’)); expected_output = (26092.78, ‘kelvin**2’)]
-
test_inplace_multiplication_with_autoconvert_00003
(input_tuple, expected)¶ test_inplace_multiplication_with_autoconvert (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degC’), (10, ‘kelvin’)); expected_output = (3731.5, ‘kelvin**2’)]
-
test_inplace_multiplication_with_autoconvert_00004
(input_tuple, expected)¶ test_inplace_multiplication_with_autoconvert (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degC’), (10, ‘degC’)); expected_output = (105657.42, ‘kelvin**2’)]
-
test_inplace_multiplication_with_autoconvert_00005
(input_tuple, expected)¶ test_inplace_multiplication_with_autoconvert (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degC’), (10, ‘degF’)); expected_output = (97365.2, ‘kelvin**2’)]
-
test_inplace_multiplication_with_autoconvert_00006
(input_tuple, expected)¶ test_inplace_multiplication_with_autoconvert (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degC’), (10, ‘degR’)); expected_output = (3731.5, ‘kelvin*degR’)]
-
test_inplace_multiplication_with_autoconvert_00007
(input_tuple, expected)¶ test_inplace_multiplication_with_autoconvert (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degC’), (10, ‘delta_degC’)); expected_output = (3731.5, ‘kelvin*delta_degC’)]
-
test_inplace_multiplication_with_autoconvert_00008
(input_tuple, expected)¶ test_inplace_multiplication_with_autoconvert (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degC’), (10, ‘delta_degF’)); expected_output = (3731.5, ‘kelvin*delta_degF’)]
-
test_inplace_multiplication_with_autoconvert_00009
(input_tuple, expected)¶ test_inplace_multiplication_with_autoconvert (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degF’), (10, ‘kelvin’)); expected_output = (3109.28, ‘kelvin**2’)]
-
test_inplace_multiplication_with_autoconvert_00010
(input_tuple, expected)¶ test_inplace_multiplication_with_autoconvert (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degF’), (10, ‘degC’)); expected_output = (88039.2, ‘kelvin**2’)]
-
test_inplace_multiplication_with_autoconvert_00011
(input_tuple, expected)¶ test_inplace_multiplication_with_autoconvert (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degF’), (10, ‘degF’)); expected_output = (81129.69, ‘kelvin**2’)]
-
test_inplace_multiplication_with_autoconvert_00012
(input_tuple, expected)¶ test_inplace_multiplication_with_autoconvert (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degF’), (10, ‘degR’)); expected_output = (3109.28, ‘kelvin*degR’)]
-
test_inplace_multiplication_with_autoconvert_00013
(input_tuple, expected)¶ test_inplace_multiplication_with_autoconvert (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degF’), (10, ‘delta_degC’)); expected_output = (3109.28, ‘kelvin*delta_degC’)]
-
test_inplace_multiplication_with_autoconvert_00014
(input_tuple, expected)¶ test_inplace_multiplication_with_autoconvert (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degF’), (10, ‘delta_degF’)); expected_output = (3109.28, ‘kelvin*delta_degF’)]
-
test_inplace_multiplication_with_autoconvert_00015
(input_tuple, expected)¶ test_inplace_multiplication_with_autoconvert (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degR’), (10, ‘degC’)); expected_output = (28315.0, ‘degR*kelvin’)]
-
test_inplace_multiplication_with_autoconvert_00016
(input_tuple, expected)¶ test_inplace_multiplication_with_autoconvert (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degR’), (10, ‘degF’)); expected_output = (26092.78, ‘degR*kelvin’)]
-
test_inplace_multiplication_with_autoconvert_00017
(input_tuple, expected)¶ test_inplace_multiplication_with_autoconvert (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘delta_degC’), (10, ‘degC’)); expected_output = (28315.0, ‘delta_degC*kelvin’)]
-
test_inplace_multiplication_with_autoconvert_00018
(input_tuple, expected)¶ test_inplace_multiplication_with_autoconvert (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘delta_degC’), (10, ‘degF’)); expected_output = (26092.78, ‘delta_degC*kelvin’)]
-
test_inplace_multiplication_with_autoconvert_00019
(input_tuple, expected)¶ test_inplace_multiplication_with_autoconvert (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘delta_degF’), (10, ‘degC’)); expected_output = (28315.0, ‘delta_degF*kelvin’)]
-
test_inplace_multiplication_with_autoconvert_00020
(input_tuple, expected)¶ test_inplace_multiplication_with_autoconvert (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘delta_degF’), (10, ‘degF’)); expected_output = (26092.78, ‘delta_degF*kelvin’)]
-
test_inplace_subtraction_00001
(input_tuple, expected)¶ test_inplace_subtraction (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘kelvin’), (10, ‘kelvin’)); expected_output = (90, ‘kelvin’)]
-
test_inplace_subtraction_00002
(input_tuple, expected)¶ test_inplace_subtraction (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘kelvin’), (10, ‘degC’)); expected_output = (-183.15, ‘kelvin’)]
-
test_inplace_subtraction_00003
(input_tuple, expected)¶ test_inplace_subtraction (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘kelvin’), (10, ‘degF’)); expected_output = (-160.93, ‘kelvin’)]
-
test_inplace_subtraction_00004
(input_tuple, expected)¶ test_inplace_subtraction (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘kelvin’), (10, ‘degR’)); expected_output = (94.44, ‘kelvin’)]
-
test_inplace_subtraction_00005
(input_tuple, expected)¶ test_inplace_subtraction (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘kelvin’), (10, ‘delta_degC’)); expected_output = (90, ‘kelvin’)]
-
test_inplace_subtraction_00006
(input_tuple, expected)¶ test_inplace_subtraction (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘kelvin’), (10, ‘delta_degF’)); expected_output = (94.44, ‘kelvin’)]
-
test_inplace_subtraction_00007
(input_tuple, expected)¶ test_inplace_subtraction (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degC’), (10, ‘kelvin’)); expected_output = (363.15, ‘delta_degC’)]
-
test_inplace_subtraction_00008
(input_tuple, expected)¶ test_inplace_subtraction (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degC’), (10, ‘degC’)); expected_output = (90, ‘delta_degC’)]
-
test_inplace_subtraction_00009
(input_tuple, expected)¶ test_inplace_subtraction (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degC’), (10, ‘degF’)); expected_output = (112.22, ‘delta_degC’)]
-
test_inplace_subtraction_00010
(input_tuple, expected)¶ test_inplace_subtraction (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degC’), (10, ‘degR’)); expected_output = (367.59, ‘delta_degC’)]
-
test_inplace_subtraction_00011
(input_tuple, expected)¶ test_inplace_subtraction (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degC’), (10, ‘delta_degC’)); expected_output = (90, ‘degC’)]
-
test_inplace_subtraction_00012
(input_tuple, expected)¶ test_inplace_subtraction (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degC’), (10, ‘delta_degF’)); expected_output = (94.44, ‘degC’)]
-
test_inplace_subtraction_00013
(input_tuple, expected)¶ test_inplace_subtraction (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degF’), (10, ‘kelvin’)); expected_output = (541.67, ‘delta_degF’)]
-
test_inplace_subtraction_00014
(input_tuple, expected)¶ test_inplace_subtraction (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degF’), (10, ‘degC’)); expected_output = (50, ‘delta_degF’)]
-
test_inplace_subtraction_00015
(input_tuple, expected)¶ test_inplace_subtraction (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degF’), (10, ‘degF’)); expected_output = (90, ‘delta_degF’)]
-
test_inplace_subtraction_00016
(input_tuple, expected)¶ test_inplace_subtraction (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degF’), (10, ‘degR’)); expected_output = (549.67, ‘delta_degF’)]
-
test_inplace_subtraction_00017
(input_tuple, expected)¶ test_inplace_subtraction (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degF’), (10, ‘delta_degC’)); expected_output = (82, ‘degF’)]
-
test_inplace_subtraction_00018
(input_tuple, expected)¶ test_inplace_subtraction (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degF’), (10, ‘delta_degF’)); expected_output = (90, ‘degF’)]
-
test_inplace_subtraction_00019
(input_tuple, expected)¶ test_inplace_subtraction (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degR’), (10, ‘kelvin’)); expected_output = (82, ‘degR’)]
-
test_inplace_subtraction_00020
(input_tuple, expected)¶ test_inplace_subtraction (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degR’), (10, ‘degC’)); expected_output = (-409.67, ‘degR’)]
-
test_inplace_subtraction_00021
(input_tuple, expected)¶ test_inplace_subtraction (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degR’), (10, ‘degF’)); expected_output = (-369.67, ‘degR’)]
-
test_inplace_subtraction_00022
(input_tuple, expected)¶ test_inplace_subtraction (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degR’), (10, ‘degR’)); expected_output = (90, ‘degR’)]
-
test_inplace_subtraction_00023
(input_tuple, expected)¶ test_inplace_subtraction (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degR’), (10, ‘delta_degC’)); expected_output = (82, ‘degR’)]
-
test_inplace_subtraction_00024
(input_tuple, expected)¶ test_inplace_subtraction (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degR’), (10, ‘delta_degF’)); expected_output = (90, ‘degR’)]
-
test_inplace_subtraction_00025
(input_tuple, expected)¶ test_inplace_subtraction (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘delta_degC’), (10, ‘kelvin’)); expected_output = (90, ‘kelvin’)]
-
test_inplace_subtraction_00026
(input_tuple, expected)¶ test_inplace_subtraction (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘delta_degC’), (10, ‘degC’)); expected_output = (90, ‘degC’)]
-
test_inplace_subtraction_00027
(input_tuple, expected)¶ test_inplace_subtraction (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘delta_degC’), (10, ‘degF’)); expected_output = (170, ‘degF’)]
-
test_inplace_subtraction_00028
(input_tuple, expected)¶ test_inplace_subtraction (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘delta_degC’), (10, ‘degR’)); expected_output = (170, ‘degR’)]
-
test_inplace_subtraction_00029
(input_tuple, expected)¶ test_inplace_subtraction (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘delta_degC’), (10, ‘delta_degC’)); expected_output = (90, ‘delta_degC’)]
-
test_inplace_subtraction_00030
(input_tuple, expected)¶ test_inplace_subtraction (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘delta_degC’), (10, ‘delta_degF’)); expected_output = (94.44, ‘delta_degC’)]
-
test_inplace_subtraction_00031
(input_tuple, expected)¶ test_inplace_subtraction (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘delta_degF’), (10, ‘kelvin’)); expected_output = (45.56, ‘kelvin’)]
-
test_inplace_subtraction_00032
(input_tuple, expected)¶ test_inplace_subtraction (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘delta_degF’), (10, ‘degC’)); expected_output = (45.56, ‘degC’)]
-
test_inplace_subtraction_00033
(input_tuple, expected)¶ test_inplace_subtraction (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘delta_degF’), (10, ‘degF’)); expected_output = (90, ‘degF’)]
-
test_inplace_subtraction_00034
(input_tuple, expected)¶ test_inplace_subtraction (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘delta_degF’), (10, ‘degR’)); expected_output = (90, ‘degR’)]
-
test_inplace_subtraction_00035
(input_tuple, expected)¶ test_inplace_subtraction (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘delta_degF’), (10, ‘delta_degC’)); expected_output = (82, ‘delta_degF’)]
-
test_inplace_subtraction_00036
(input_tuple, expected)¶ test_inplace_subtraction (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘delta_degF’), (10, ‘delta_degF’)); expected_output = (90, ‘delta_degF’)]
-
test_inplace_truedivision_00001
(input_tuple, expected)¶ test_inplace_truedivision (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘kelvin’), (10, ‘kelvin’)); expected_output = (10, ‘’)]
-
test_inplace_truedivision_00002
(input_tuple, expected)¶ test_inplace_truedivision (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘kelvin’), (10, ‘degC’)); expected_output = error]
-
test_inplace_truedivision_00003
(input_tuple, expected)¶ test_inplace_truedivision (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘kelvin’), (10, ‘degF’)); expected_output = error]
-
test_inplace_truedivision_00004
(input_tuple, expected)¶ test_inplace_truedivision (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘kelvin’), (10, ‘degR’)); expected_output = (10, ‘kelvin/degR’)]
-
test_inplace_truedivision_00005
(input_tuple, expected)¶ test_inplace_truedivision (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘kelvin’), (10, ‘delta_degC’)); expected_output = (10, ‘kelvin/delta_degC’)]
-
test_inplace_truedivision_00006
(input_tuple, expected)¶ test_inplace_truedivision (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘kelvin’), (10, ‘delta_degF’)); expected_output = (10, ‘kelvin/delta_degF’)]
-
test_inplace_truedivision_00007
(input_tuple, expected)¶ test_inplace_truedivision (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degC’), (10, ‘kelvin’)); expected_output = error]
-
test_inplace_truedivision_00008
(input_tuple, expected)¶ test_inplace_truedivision (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degC’), (10, ‘degC’)); expected_output = error]
-
test_inplace_truedivision_00009
(input_tuple, expected)¶ test_inplace_truedivision (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degC’), (10, ‘degF’)); expected_output = error]
-
test_inplace_truedivision_00010
(input_tuple, expected)¶ test_inplace_truedivision (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degC’), (10, ‘degR’)); expected_output = error]
-
test_inplace_truedivision_00011
(input_tuple, expected)¶ test_inplace_truedivision (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degC’), (10, ‘delta_degC’)); expected_output = error]
-
test_inplace_truedivision_00012
(input_tuple, expected)¶ test_inplace_truedivision (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degC’), (10, ‘delta_degF’)); expected_output = error]
-
test_inplace_truedivision_00013
(input_tuple, expected)¶ test_inplace_truedivision (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degF’), (10, ‘kelvin’)); expected_output = error]
-
test_inplace_truedivision_00014
(input_tuple, expected)¶ test_inplace_truedivision (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degF’), (10, ‘degC’)); expected_output = error]
-
test_inplace_truedivision_00015
(input_tuple, expected)¶ test_inplace_truedivision (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degF’), (10, ‘degF’)); expected_output = error]
-
test_inplace_truedivision_00016
(input_tuple, expected)¶ test_inplace_truedivision (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degF’), (10, ‘degR’)); expected_output = error]
-
test_inplace_truedivision_00017
(input_tuple, expected)¶ test_inplace_truedivision (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degF’), (10, ‘delta_degC’)); expected_output = error]
-
test_inplace_truedivision_00018
(input_tuple, expected)¶ test_inplace_truedivision (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degF’), (10, ‘delta_degF’)); expected_output = error]
-
test_inplace_truedivision_00019
(input_tuple, expected)¶ test_inplace_truedivision (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degR’), (10, ‘kelvin’)); expected_output = (10, ‘degR/kelvin’)]
-
test_inplace_truedivision_00020
(input_tuple, expected)¶ test_inplace_truedivision (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degR’), (10, ‘degC’)); expected_output = error]
-
test_inplace_truedivision_00021
(input_tuple, expected)¶ test_inplace_truedivision (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degR’), (10, ‘degF’)); expected_output = error]
-
test_inplace_truedivision_00022
(input_tuple, expected)¶ test_inplace_truedivision (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degR’), (10, ‘degR’)); expected_output = (10, ‘’)]
-
test_inplace_truedivision_00023
(input_tuple, expected)¶ test_inplace_truedivision (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degR’), (10, ‘delta_degC’)); expected_output = (10, ‘degR/delta_degC’)]
-
test_inplace_truedivision_00024
(input_tuple, expected)¶ test_inplace_truedivision (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degR’), (10, ‘delta_degF’)); expected_output = (10, ‘degR/delta_degF’)]
-
test_inplace_truedivision_00025
(input_tuple, expected)¶ test_inplace_truedivision (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘delta_degC’), (10, ‘kelvin’)); expected_output = (10, ‘delta_degC/kelvin’)]
-
test_inplace_truedivision_00026
(input_tuple, expected)¶ test_inplace_truedivision (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘delta_degC’), (10, ‘degC’)); expected_output = error]
-
test_inplace_truedivision_00027
(input_tuple, expected)¶ test_inplace_truedivision (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘delta_degC’), (10, ‘degF’)); expected_output = error]
-
test_inplace_truedivision_00028
(input_tuple, expected)¶ test_inplace_truedivision (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘delta_degC’), (10, ‘degR’)); expected_output = (10, ‘delta_degC/degR’)]
-
test_inplace_truedivision_00029
(input_tuple, expected)¶ test_inplace_truedivision (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘delta_degC’), (10, ‘delta_degC’)); expected_output = (10, ‘’)]
-
test_inplace_truedivision_00030
(input_tuple, expected)¶ test_inplace_truedivision (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘delta_degC’), (10, ‘delta_degF’)); expected_output = (10, ‘delta_degC/delta_degF’)]
-
test_inplace_truedivision_00031
(input_tuple, expected)¶ test_inplace_truedivision (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘delta_degF’), (10, ‘kelvin’)); expected_output = (10, ‘delta_degF/kelvin’)]
-
test_inplace_truedivision_00032
(input_tuple, expected)¶ test_inplace_truedivision (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘delta_degF’), (10, ‘degC’)); expected_output = error]
-
test_inplace_truedivision_00033
(input_tuple, expected)¶ test_inplace_truedivision (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘delta_degF’), (10, ‘degF’)); expected_output = error]
-
test_inplace_truedivision_00034
(input_tuple, expected)¶ test_inplace_truedivision (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘delta_degF’), (10, ‘degR’)); expected_output = (10, ‘delta_degF/degR’)]
-
test_inplace_truedivision_00035
(input_tuple, expected)¶ test_inplace_truedivision (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘delta_degF’), (10, ‘delta_degC’)); expected_output = (10, ‘delta_degF/delta_degC’)]
-
test_inplace_truedivision_00036
(input_tuple, expected)¶ test_inplace_truedivision (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘delta_degF’), (10, ‘delta_degF’)); expected_output = (10, ‘’)]
-
test_multiplication_00001
(input_tuple, expected)¶ test_multiplication (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘kelvin’), (10, ‘kelvin’)); expected_output = (1000, ‘kelvin**2’)]
-
test_multiplication_00002
(input_tuple, expected)¶ test_multiplication (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘kelvin’), (10, ‘degC’)); expected_output = error]
-
test_multiplication_00003
(input_tuple, expected)¶ test_multiplication (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘kelvin’), (10, ‘degF’)); expected_output = error]
-
test_multiplication_00004
(input_tuple, expected)¶ test_multiplication (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘kelvin’), (10, ‘degR’)); expected_output = (1000, ‘kelvin*degR’)]
-
test_multiplication_00005
(input_tuple, expected)¶ test_multiplication (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘kelvin’), (10, ‘delta_degC’)); expected_output = (1000, ‘kelvin*delta_degC’)]
-
test_multiplication_00006
(input_tuple, expected)¶ test_multiplication (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘kelvin’), (10, ‘delta_degF’)); expected_output = (1000, ‘kelvin*delta_degF’)]
-
test_multiplication_00007
(input_tuple, expected)¶ test_multiplication (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degC’), (10, ‘kelvin’)); expected_output = error]
-
test_multiplication_00008
(input_tuple, expected)¶ test_multiplication (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degC’), (10, ‘degC’)); expected_output = error]
-
test_multiplication_00009
(input_tuple, expected)¶ test_multiplication (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degC’), (10, ‘degF’)); expected_output = error]
-
test_multiplication_00010
(input_tuple, expected)¶ test_multiplication (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degC’), (10, ‘degR’)); expected_output = error]
-
test_multiplication_00011
(input_tuple, expected)¶ test_multiplication (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degC’), (10, ‘delta_degC’)); expected_output = error]
-
test_multiplication_00012
(input_tuple, expected)¶ test_multiplication (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degC’), (10, ‘delta_degF’)); expected_output = error]
-
test_multiplication_00013
(input_tuple, expected)¶ test_multiplication (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degF’), (10, ‘kelvin’)); expected_output = error]
-
test_multiplication_00014
(input_tuple, expected)¶ test_multiplication (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degF’), (10, ‘degC’)); expected_output = error]
-
test_multiplication_00015
(input_tuple, expected)¶ test_multiplication (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degF’), (10, ‘degF’)); expected_output = error]
-
test_multiplication_00016
(input_tuple, expected)¶ test_multiplication (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degF’), (10, ‘degR’)); expected_output = error]
-
test_multiplication_00017
(input_tuple, expected)¶ test_multiplication (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degF’), (10, ‘delta_degC’)); expected_output = error]
-
test_multiplication_00018
(input_tuple, expected)¶ test_multiplication (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degF’), (10, ‘delta_degF’)); expected_output = error]
-
test_multiplication_00019
(input_tuple, expected)¶ test_multiplication (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degR’), (10, ‘kelvin’)); expected_output = (1000, ‘degR*kelvin’)]
-
test_multiplication_00020
(input_tuple, expected)¶ test_multiplication (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degR’), (10, ‘degC’)); expected_output = error]
-
test_multiplication_00021
(input_tuple, expected)¶ test_multiplication (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degR’), (10, ‘degF’)); expected_output = error]
-
test_multiplication_00022
(input_tuple, expected)¶ test_multiplication (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degR’), (10, ‘degR’)); expected_output = (1000, ‘degR**2’)]
-
test_multiplication_00023
(input_tuple, expected)¶ test_multiplication (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degR’), (10, ‘delta_degC’)); expected_output = (1000, ‘degR*delta_degC’)]
-
test_multiplication_00024
(input_tuple, expected)¶ test_multiplication (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degR’), (10, ‘delta_degF’)); expected_output = (1000, ‘degR*delta_degF’)]
-
test_multiplication_00025
(input_tuple, expected)¶ test_multiplication (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘delta_degC’), (10, ‘kelvin’)); expected_output = (1000, ‘delta_degC*kelvin’)]
-
test_multiplication_00026
(input_tuple, expected)¶ test_multiplication (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘delta_degC’), (10, ‘degC’)); expected_output = error]
-
test_multiplication_00027
(input_tuple, expected)¶ test_multiplication (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘delta_degC’), (10, ‘degF’)); expected_output = error]
-
test_multiplication_00028
(input_tuple, expected)¶ test_multiplication (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘delta_degC’), (10, ‘degR’)); expected_output = (1000, ‘delta_degC*degR’)]
-
test_multiplication_00029
(input_tuple, expected)¶ test_multiplication (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘delta_degC’), (10, ‘delta_degC’)); expected_output = (1000, ‘delta_degC**2’)]
-
test_multiplication_00030
(input_tuple, expected)¶ test_multiplication (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘delta_degC’), (10, ‘delta_degF’)); expected_output = (1000, ‘delta_degC*delta_degF’)]
-
test_multiplication_00031
(input_tuple, expected)¶ test_multiplication (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘delta_degF’), (10, ‘kelvin’)); expected_output = (1000, ‘delta_degF*kelvin’)]
-
test_multiplication_00032
(input_tuple, expected)¶ test_multiplication (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘delta_degF’), (10, ‘degC’)); expected_output = error]
-
test_multiplication_00033
(input_tuple, expected)¶ test_multiplication (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘delta_degF’), (10, ‘degF’)); expected_output = error]
-
test_multiplication_00034
(input_tuple, expected)¶ test_multiplication (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘delta_degF’), (10, ‘degR’)); expected_output = (1000, ‘delta_degF*degR’)]
-
test_multiplication_00035
(input_tuple, expected)¶ test_multiplication (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘delta_degF’), (10, ‘delta_degC’)); expected_output = (1000, ‘delta_degF*delta_degC’)]
-
test_multiplication_00036
(input_tuple, expected)¶ test_multiplication (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘delta_degF’), (10, ‘delta_degF’)); expected_output = (1000, ‘delta_degF**2’)]
-
test_multiplication_with_autoconvert_00001
(input_tuple, expected)¶ test_multiplication_with_autoconvert (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘kelvin’), (10, ‘degC’)); expected_output = (28315.0, ‘kelvin**2’)]
-
test_multiplication_with_autoconvert_00002
(input_tuple, expected)¶ test_multiplication_with_autoconvert (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘kelvin’), (10, ‘degF’)); expected_output = (26092.78, ‘kelvin**2’)]
-
test_multiplication_with_autoconvert_00003
(input_tuple, expected)¶ test_multiplication_with_autoconvert (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degC’), (10, ‘kelvin’)); expected_output = (3731.5, ‘kelvin**2’)]
-
test_multiplication_with_autoconvert_00004
(input_tuple, expected)¶ test_multiplication_with_autoconvert (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degC’), (10, ‘degC’)); expected_output = (105657.42, ‘kelvin**2’)]
-
test_multiplication_with_autoconvert_00005
(input_tuple, expected)¶ test_multiplication_with_autoconvert (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degC’), (10, ‘degF’)); expected_output = (97365.2, ‘kelvin**2’)]
-
test_multiplication_with_autoconvert_00006
(input_tuple, expected)¶ test_multiplication_with_autoconvert (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degC’), (10, ‘degR’)); expected_output = (3731.5, ‘kelvin*degR’)]
-
test_multiplication_with_autoconvert_00007
(input_tuple, expected)¶ test_multiplication_with_autoconvert (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degC’), (10, ‘delta_degC’)); expected_output = (3731.5, ‘kelvin*delta_degC’)]
-
test_multiplication_with_autoconvert_00008
(input_tuple, expected)¶ test_multiplication_with_autoconvert (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degC’), (10, ‘delta_degF’)); expected_output = (3731.5, ‘kelvin*delta_degF’)]
-
test_multiplication_with_autoconvert_00009
(input_tuple, expected)¶ test_multiplication_with_autoconvert (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degF’), (10, ‘kelvin’)); expected_output = (3109.28, ‘kelvin**2’)]
-
test_multiplication_with_autoconvert_00010
(input_tuple, expected)¶ test_multiplication_with_autoconvert (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degF’), (10, ‘degC’)); expected_output = (88039.2, ‘kelvin**2’)]
-
test_multiplication_with_autoconvert_00011
(input_tuple, expected)¶ test_multiplication_with_autoconvert (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degF’), (10, ‘degF’)); expected_output = (81129.69, ‘kelvin**2’)]
-
test_multiplication_with_autoconvert_00012
(input_tuple, expected)¶ test_multiplication_with_autoconvert (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degF’), (10, ‘degR’)); expected_output = (3109.28, ‘kelvin*degR’)]
-
test_multiplication_with_autoconvert_00013
(input_tuple, expected)¶ test_multiplication_with_autoconvert (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degF’), (10, ‘delta_degC’)); expected_output = (3109.28, ‘kelvin*delta_degC’)]
-
test_multiplication_with_autoconvert_00014
(input_tuple, expected)¶ test_multiplication_with_autoconvert (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degF’), (10, ‘delta_degF’)); expected_output = (3109.28, ‘kelvin*delta_degF’)]
-
test_multiplication_with_autoconvert_00015
(input_tuple, expected)¶ test_multiplication_with_autoconvert (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degR’), (10, ‘degC’)); expected_output = (28315.0, ‘degR*kelvin’)]
-
test_multiplication_with_autoconvert_00016
(input_tuple, expected)¶ test_multiplication_with_autoconvert (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degR’), (10, ‘degF’)); expected_output = (26092.78, ‘degR*kelvin’)]
-
test_multiplication_with_autoconvert_00017
(input_tuple, expected)¶ test_multiplication_with_autoconvert (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘delta_degC’), (10, ‘degC’)); expected_output = (28315.0, ‘delta_degC*kelvin’)]
-
test_multiplication_with_autoconvert_00018
(input_tuple, expected)¶ test_multiplication_with_autoconvert (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘delta_degC’), (10, ‘degF’)); expected_output = (26092.78, ‘delta_degC*kelvin’)]
-
test_multiplication_with_autoconvert_00019
(input_tuple, expected)¶ test_multiplication_with_autoconvert (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘delta_degF’), (10, ‘degC’)); expected_output = (28315.0, ‘delta_degF*kelvin’)]
-
test_multiplication_with_autoconvert_00020
(input_tuple, expected)¶ test_multiplication_with_autoconvert (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘delta_degF’), (10, ‘degF’)); expected_output = (26092.78, ‘delta_degF*kelvin’)]
-
test_multiplication_with_scalar_00001
(input_tuple, expected)¶ test_multiplication_with_scalar (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((10, ‘kelvin’), 2); expected_output = (20.0, ‘kelvin’)]
-
test_multiplication_with_scalar_00002
(input_tuple, expected)¶ test_multiplication_with_scalar (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((10, ‘kelvin**2’), 2); expected_output = (20.0, ‘kelvin**2’)]
-
test_multiplication_with_scalar_00003
(input_tuple, expected)¶ test_multiplication_with_scalar (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((10, ‘degC’), 2); expected_output = (20.0, ‘degC’)]
-
test_multiplication_with_scalar_00004
(input_tuple, expected)¶ test_multiplication_with_scalar (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((10, ‘1/degC’), 2); expected_output = error]
-
test_multiplication_with_scalar_00005
(input_tuple, expected)¶ test_multiplication_with_scalar (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((10, ‘degC**0.5’), 2); expected_output = error]
-
test_multiplication_with_scalar_00006
(input_tuple, expected)¶ test_multiplication_with_scalar (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((10, ‘degC**2’), 2); expected_output = error]
-
test_multiplication_with_scalar_00007
(input_tuple, expected)¶ test_multiplication_with_scalar (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((10, ‘degC**-2’), 2); expected_output = error]
-
test_subtraction_00001
(input_tuple, expected)¶ test_subtraction (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘kelvin’), (10, ‘kelvin’)); expected_output = (90, ‘kelvin’)]
-
test_subtraction_00002
(input_tuple, expected)¶ test_subtraction (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘kelvin’), (10, ‘degC’)); expected_output = (-183.15, ‘kelvin’)]
-
test_subtraction_00003
(input_tuple, expected)¶ test_subtraction (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘kelvin’), (10, ‘degF’)); expected_output = (-160.93, ‘kelvin’)]
-
test_subtraction_00004
(input_tuple, expected)¶ test_subtraction (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘kelvin’), (10, ‘degR’)); expected_output = (94.44, ‘kelvin’)]
-
test_subtraction_00005
(input_tuple, expected)¶ test_subtraction (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘kelvin’), (10, ‘delta_degC’)); expected_output = (90, ‘kelvin’)]
-
test_subtraction_00006
(input_tuple, expected)¶ test_subtraction (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘kelvin’), (10, ‘delta_degF’)); expected_output = (94.44, ‘kelvin’)]
-
test_subtraction_00007
(input_tuple, expected)¶ test_subtraction (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degC’), (10, ‘kelvin’)); expected_output = (363.15, ‘delta_degC’)]
-
test_subtraction_00008
(input_tuple, expected)¶ test_subtraction (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degC’), (10, ‘degC’)); expected_output = (90, ‘delta_degC’)]
-
test_subtraction_00009
(input_tuple, expected)¶ test_subtraction (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degC’), (10, ‘degF’)); expected_output = (112.22, ‘delta_degC’)]
-
test_subtraction_00010
(input_tuple, expected)¶ test_subtraction (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degC’), (10, ‘degR’)); expected_output = (367.59, ‘delta_degC’)]
-
test_subtraction_00011
(input_tuple, expected)¶ test_subtraction (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degC’), (10, ‘delta_degC’)); expected_output = (90, ‘degC’)]
-
test_subtraction_00012
(input_tuple, expected)¶ test_subtraction (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degC’), (10, ‘delta_degF’)); expected_output = (94.44, ‘degC’)]
-
test_subtraction_00013
(input_tuple, expected)¶ test_subtraction (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degF’), (10, ‘kelvin’)); expected_output = (541.67, ‘delta_degF’)]
-
test_subtraction_00014
(input_tuple, expected)¶ test_subtraction (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degF’), (10, ‘degC’)); expected_output = (50, ‘delta_degF’)]
-
test_subtraction_00015
(input_tuple, expected)¶ test_subtraction (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degF’), (10, ‘degF’)); expected_output = (90, ‘delta_degF’)]
-
test_subtraction_00016
(input_tuple, expected)¶ test_subtraction (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degF’), (10, ‘degR’)); expected_output = (549.67, ‘delta_degF’)]
-
test_subtraction_00017
(input_tuple, expected)¶ test_subtraction (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degF’), (10, ‘delta_degC’)); expected_output = (82, ‘degF’)]
-
test_subtraction_00018
(input_tuple, expected)¶ test_subtraction (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degF’), (10, ‘delta_degF’)); expected_output = (90, ‘degF’)]
-
test_subtraction_00019
(input_tuple, expected)¶ test_subtraction (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degR’), (10, ‘kelvin’)); expected_output = (82, ‘degR’)]
-
test_subtraction_00020
(input_tuple, expected)¶ test_subtraction (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degR’), (10, ‘degC’)); expected_output = (-409.67, ‘degR’)]
-
test_subtraction_00021
(input_tuple, expected)¶ test_subtraction (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degR’), (10, ‘degF’)); expected_output = (-369.67, ‘degR’)]
-
test_subtraction_00022
(input_tuple, expected)¶ test_subtraction (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degR’), (10, ‘degR’)); expected_output = (90, ‘degR’)]
-
test_subtraction_00023
(input_tuple, expected)¶ test_subtraction (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degR’), (10, ‘delta_degC’)); expected_output = (82, ‘degR’)]
-
test_subtraction_00024
(input_tuple, expected)¶ test_subtraction (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degR’), (10, ‘delta_degF’)); expected_output = (90, ‘degR’)]
-
test_subtraction_00025
(input_tuple, expected)¶ test_subtraction (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘delta_degC’), (10, ‘kelvin’)); expected_output = (90, ‘kelvin’)]
-
test_subtraction_00026
(input_tuple, expected)¶ test_subtraction (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘delta_degC’), (10, ‘degC’)); expected_output = (90, ‘degC’)]
-
test_subtraction_00027
(input_tuple, expected)¶ test_subtraction (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘delta_degC’), (10, ‘degF’)); expected_output = (170, ‘degF’)]
-
test_subtraction_00028
(input_tuple, expected)¶ test_subtraction (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘delta_degC’), (10, ‘degR’)); expected_output = (170, ‘degR’)]
-
test_subtraction_00029
(input_tuple, expected)¶ test_subtraction (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘delta_degC’), (10, ‘delta_degC’)); expected_output = (90, ‘delta_degC’)]
-
test_subtraction_00030
(input_tuple, expected)¶ test_subtraction (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘delta_degC’), (10, ‘delta_degF’)); expected_output = (94.44, ‘delta_degC’)]
-
test_subtraction_00031
(input_tuple, expected)¶ test_subtraction (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘delta_degF’), (10, ‘kelvin’)); expected_output = (45.56, ‘kelvin’)]
-
test_subtraction_00032
(input_tuple, expected)¶ test_subtraction (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘delta_degF’), (10, ‘degC’)); expected_output = (45.56, ‘degC’)]
-
test_subtraction_00033
(input_tuple, expected)¶ test_subtraction (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘delta_degF’), (10, ‘degF’)); expected_output = (90, ‘degF’)]
-
test_subtraction_00034
(input_tuple, expected)¶ test_subtraction (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘delta_degF’), (10, ‘degR’)); expected_output = (90, ‘degR’)]
-
test_subtraction_00035
(input_tuple, expected)¶ test_subtraction (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘delta_degF’), (10, ‘delta_degC’)); expected_output = (82, ‘delta_degF’)]
-
test_subtraction_00036
(input_tuple, expected)¶ test_subtraction (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘delta_degF’), (10, ‘delta_degF’)); expected_output = (90, ‘delta_degF’)]
-
test_truedivision_00001
(input_tuple, expected)¶ test_truedivision (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘kelvin’), (10, ‘kelvin’)); expected_output = (10, ‘’)]
-
test_truedivision_00002
(input_tuple, expected)¶ test_truedivision (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘kelvin’), (10, ‘degC’)); expected_output = error]
-
test_truedivision_00003
(input_tuple, expected)¶ test_truedivision (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘kelvin’), (10, ‘degF’)); expected_output = error]
-
test_truedivision_00004
(input_tuple, expected)¶ test_truedivision (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘kelvin’), (10, ‘degR’)); expected_output = (10, ‘kelvin/degR’)]
-
test_truedivision_00005
(input_tuple, expected)¶ test_truedivision (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘kelvin’), (10, ‘delta_degC’)); expected_output = (10, ‘kelvin/delta_degC’)]
-
test_truedivision_00006
(input_tuple, expected)¶ test_truedivision (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘kelvin’), (10, ‘delta_degF’)); expected_output = (10, ‘kelvin/delta_degF’)]
-
test_truedivision_00007
(input_tuple, expected)¶ test_truedivision (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degC’), (10, ‘kelvin’)); expected_output = error]
-
test_truedivision_00008
(input_tuple, expected)¶ test_truedivision (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degC’), (10, ‘degC’)); expected_output = error]
-
test_truedivision_00009
(input_tuple, expected)¶ test_truedivision (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degC’), (10, ‘degF’)); expected_output = error]
-
test_truedivision_00010
(input_tuple, expected)¶ test_truedivision (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degC’), (10, ‘degR’)); expected_output = error]
-
test_truedivision_00011
(input_tuple, expected)¶ test_truedivision (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degC’), (10, ‘delta_degC’)); expected_output = error]
-
test_truedivision_00012
(input_tuple, expected)¶ test_truedivision (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degC’), (10, ‘delta_degF’)); expected_output = error]
-
test_truedivision_00013
(input_tuple, expected)¶ test_truedivision (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degF’), (10, ‘kelvin’)); expected_output = error]
-
test_truedivision_00014
(input_tuple, expected)¶ test_truedivision (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degF’), (10, ‘degC’)); expected_output = error]
-
test_truedivision_00015
(input_tuple, expected)¶ test_truedivision (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degF’), (10, ‘degF’)); expected_output = error]
-
test_truedivision_00016
(input_tuple, expected)¶ test_truedivision (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degF’), (10, ‘degR’)); expected_output = error]
-
test_truedivision_00017
(input_tuple, expected)¶ test_truedivision (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degF’), (10, ‘delta_degC’)); expected_output = error]
-
test_truedivision_00018
(input_tuple, expected)¶ test_truedivision (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degF’), (10, ‘delta_degF’)); expected_output = error]
-
test_truedivision_00019
(input_tuple, expected)¶ test_truedivision (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degR’), (10, ‘kelvin’)); expected_output = (10, ‘degR/kelvin’)]
-
test_truedivision_00020
(input_tuple, expected)¶ test_truedivision (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degR’), (10, ‘degC’)); expected_output = error]
-
test_truedivision_00021
(input_tuple, expected)¶ test_truedivision (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degR’), (10, ‘degF’)); expected_output = error]
-
test_truedivision_00022
(input_tuple, expected)¶ test_truedivision (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degR’), (10, ‘degR’)); expected_output = (10, ‘’)]
-
test_truedivision_00023
(input_tuple, expected)¶ test_truedivision (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degR’), (10, ‘delta_degC’)); expected_output = (10, ‘degR/delta_degC’)]
-
test_truedivision_00024
(input_tuple, expected)¶ test_truedivision (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘degR’), (10, ‘delta_degF’)); expected_output = (10, ‘degR/delta_degF’)]
-
test_truedivision_00025
(input_tuple, expected)¶ test_truedivision (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘delta_degC’), (10, ‘kelvin’)); expected_output = (10, ‘delta_degC/kelvin’)]
-
test_truedivision_00026
(input_tuple, expected)¶ test_truedivision (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘delta_degC’), (10, ‘degC’)); expected_output = error]
-
test_truedivision_00027
(input_tuple, expected)¶ test_truedivision (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘delta_degC’), (10, ‘degF’)); expected_output = error]
-
test_truedivision_00028
(input_tuple, expected)¶ test_truedivision (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘delta_degC’), (10, ‘degR’)); expected_output = (10, ‘delta_degC/degR’)]
-
test_truedivision_00029
(input_tuple, expected)¶ test_truedivision (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘delta_degC’), (10, ‘delta_degC’)); expected_output = (10, ‘’)]
-
test_truedivision_00030
(input_tuple, expected)¶ test_truedivision (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘delta_degC’), (10, ‘delta_degF’)); expected_output = (10, ‘delta_degC/delta_degF’)]
-
test_truedivision_00031
(input_tuple, expected)¶ test_truedivision (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘delta_degF’), (10, ‘kelvin’)); expected_output = (10, ‘delta_degF/kelvin’)]
-
test_truedivision_00032
(input_tuple, expected)¶ test_truedivision (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘delta_degF’), (10, ‘degC’)); expected_output = error]
-
test_truedivision_00033
(input_tuple, expected)¶ test_truedivision (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘delta_degF’), (10, ‘degF’)); expected_output = error]
-
test_truedivision_00034
(input_tuple, expected)¶ test_truedivision (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘delta_degF’), (10, ‘degR’)); expected_output = (10, ‘delta_degF/degR’)]
-
test_truedivision_00035
(input_tuple, expected)¶ test_truedivision (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘delta_degF’), (10, ‘delta_degC’)); expected_output = (10, ‘delta_degF/delta_degC’)]
-
test_truedivision_00036
(input_tuple, expected)¶ test_truedivision (pint.testsuite.test_quantity.TestOffsetUnitMath) [with input = ((100, ‘delta_degF’), (10, ‘delta_degF’)); expected_output = (10, ‘’)]
-
-
class
pint.testsuite.test_umath.
TestComparisonUfuncs
(methodName='runTest')[source]¶ Universal functions (ufunc) > Comparison functions
http://docs.scipy.org/doc/numpy/reference/ufuncs.html#comparison-functions
greater(x1, x2[, out]) Return the truth value of (x1 > x2) element-wise. greater_equal(x1, x2[, out]) Return the truth value of (x1 >= x2) element-wise. less(x1, x2[, out]) Return the truth value of (x1 < x2) element-wise. less_equal(x1, x2[, out]) Return the truth value of (x1 =< x2) element-wise. not_equal(x1, x2[, out]) Return (x1 != x2) element-wise. equal(x1, x2[, out]) Return (x1 == x2) element-wise.
-
class
pint.testsuite.test_umath.
TestFloatingUfuncs
(methodName='runTest')[source]¶ Universal functions (ufunc) > Floating functions
http://docs.scipy.org/doc/numpy/reference/ufuncs.html#floating-functions
isreal(x) Returns a bool array, where True if input element is real. iscomplex(x) Returns a bool array, where True if input element is complex. isfinite(x[, out]) Test element-wise for finite-ness (not infinity or not Not a Number). isinf(x[, out]) Test element-wise for positive or negative infinity. isnan(x[, out]) Test element-wise for Not a Number (NaN), return result as a bool array. signbit(x[, out]) Returns element-wise True where signbit is set (less than zero). copysign(x1, x2[, out]) Change the sign of x1 to that of x2, element-wise. nextafter(x1, x2[, out]) Return the next representable floating-point value after x1 in the direction of x2 element-wise. modf(x[, out1, out2]) Return the fractional and integral parts of an array, element-wise. ldexp(x1, x2[, out]) Compute y = x1 * 2**x2. frexp(x[, out1, out2]) Split the number, x, into a normalized fraction (y1) and exponent (y2) fmod(x1, x2[, out]) Return the element-wise remainder of division. floor(x[, out]) Return the floor of the input, element-wise. ceil(x[, out]) Return the ceiling of the input, element-wise. trunc(x[, out]) Return the truncated value of the input, element-wise.
-
class
pint.testsuite.test_umath.
TestMathUfuncs
(methodName='runTest')[source]¶ Universal functions (ufunc) > Math operations
http://docs.scipy.org/doc/numpy/reference/ufuncs.html#math-operations
add(x1, x2[, out]) Add arguments element-wise. subtract(x1, x2[, out]) Subtract arguments, element-wise. multiply(x1, x2[, out]) Multiply arguments element-wise. divide(x1, x2[, out]) Divide arguments element-wise. logaddexp(x1, x2[, out]) Logarithm of the sum of exponentiations of the inputs. logaddexp2(x1, x2[, out]) Logarithm of the sum of exponentiations of the inputs in base-2. true_divide(x1, x2[, out]) Returns a true division of the inputs, element-wise. floor_divide(x1, x2[, out]) Return the largest integer smaller or equal to the division of the inputs. negative(x[, out]) Returns an array with the negative of each element of the original array. power(x1, x2[, out]) First array elements raised to powers from second array, element-wise. NOT IMPLEMENTED remainder(x1, x2[, out]) Return element-wise remainder of division. mod(x1, x2[, out]) Return element-wise remainder of division. fmod(x1, x2[, out]) Return the element-wise remainder of division. absolute(x[, out]) Calculate the absolute value element-wise. rint(x[, out]) Round elements of the array to the nearest integer. sign(x[, out]) Returns an element-wise indication of the sign of a number. conj(x[, out]) Return the complex conjugate, element-wise. exp(x[, out]) Calculate the exponential of all elements in the input array. exp2(x[, out]) Calculate 2**p for all p in the input array. log(x[, out]) Natural logarithm, element-wise. log2(x[, out]) Base-2 logarithm of x. log10(x[, out]) Return the base 10 logarithm of the input array, element-wise. expm1(x[, out]) Calculate exp(x) - 1 for all elements in the array. log1p(x[, out]) Return the natural logarithm of one plus the input array, element-wise. sqrt(x[, out]) Return the positive square-root of an array, element-wise. square(x[, out]) Return the element-wise square of the input. reciprocal(x[, out]) Return the reciprocal of the argument, element-wise. ones_like(x[, out]) Returns an array of ones with the same shape and type as a given array.
-
class
pint.testsuite.test_umath.
TestTrigUfuncs
(methodName='runTest')[source]¶ Universal functions (ufunc) > Trigonometric functions
http://docs.scipy.org/doc/numpy/reference/ufuncs.html#trigonometric-functions
sin(x[, out]) Trigonometric sine, element-wise. cos(x[, out]) Cosine elementwise. tan(x[, out]) Compute tangent element-wise. arcsin(x[, out]) Inverse sine, element-wise. arccos(x[, out]) Trigonometric inverse cosine, element-wise. arctan(x[, out]) Trigonometric inverse tangent, element-wise. arctan2(x1, x2[, out]) Element-wise arc tangent of x1/x2 choosing the quadrant correctly. hypot(x1, x2[, out]) Given the “legs” of a right triangle, return its hypotenuse. sinh(x[, out]) Hyperbolic sine, element-wise. cosh(x[, out]) Hyperbolic cosine, element-wise. tanh(x[, out]) Compute hyperbolic tangent element-wise. arcsinh(x[, out]) Inverse hyperbolic sine elementwise. arccosh(x[, out]) Inverse hyperbolic cosine, elementwise. arctanh(x[, out]) Inverse hyperbolic tangent elementwise. deg2rad(x[, out]) Convert angles from degrees to radians. rad2deg(x[, out]) Convert angles from radians to degrees.
-
class
pint.testsuite.test_unit.
TestConvertWithOffset
(methodName='runTest')[source]¶ -
test_to_and_from_offset_units_00001
(input_tuple, expected)¶ test_to_and_from_offset_units (pint.testsuite.test_unit.TestConvertWithOffset) [with input = ({‘degC’: 1}, {‘degC’: 1}); expected_output = 10]
-
test_to_and_from_offset_units_00002
(input_tuple, expected)¶ test_to_and_from_offset_units (pint.testsuite.test_unit.TestConvertWithOffset) [with input = ({‘degC’: 1}, {‘kelvin’: 1}); expected_output = 283.15]
-
test_to_and_from_offset_units_00003
(input_tuple, expected)¶ test_to_and_from_offset_units (pint.testsuite.test_unit.TestConvertWithOffset) [with input = ({‘degC’: 1}, {‘degC’: 1, ‘millimeter’: 1, ‘meter’: -1}); expected_output = error]
-
test_to_and_from_offset_units_00004
(input_tuple, expected)¶ test_to_and_from_offset_units (pint.testsuite.test_unit.TestConvertWithOffset) [with input = ({‘degC’: 1}, {‘kelvin’: 1, ‘millimeter’: 1, ‘meter’: -1}); expected_output = 283150]
-
test_to_and_from_offset_units_00005
(input_tuple, expected)¶ test_to_and_from_offset_units (pint.testsuite.test_unit.TestConvertWithOffset) [with input = ({‘kelvin’: 1}, {‘degC’: 1}); expected_output = -263.15]
-
test_to_and_from_offset_units_00006
(input_tuple, expected)¶ test_to_and_from_offset_units (pint.testsuite.test_unit.TestConvertWithOffset) [with input = ({‘kelvin’: 1}, {‘kelvin’: 1}); expected_output = 10]
-
test_to_and_from_offset_units_00007
(input_tuple, expected)¶ test_to_and_from_offset_units (pint.testsuite.test_unit.TestConvertWithOffset) [with input = ({‘kelvin’: 1}, {‘degC’: 1, ‘millimeter’: 1, ‘meter’: -1}); expected_output = error]
-
test_to_and_from_offset_units_00008
(input_tuple, expected)¶ test_to_and_from_offset_units (pint.testsuite.test_unit.TestConvertWithOffset) [with input = ({‘kelvin’: 1}, {‘kelvin’: 1, ‘millimeter’: 1, ‘meter’: -1}); expected_output = 10000]
-
test_to_and_from_offset_units_00009
(input_tuple, expected)¶ test_to_and_from_offset_units (pint.testsuite.test_unit.TestConvertWithOffset) [with input = ({‘degC’: 1, ‘millimeter’: 1, ‘meter’: -1}, {‘degC’: 1}); expected_output = error]
-
test_to_and_from_offset_units_00010
(input_tuple, expected)¶ test_to_and_from_offset_units (pint.testsuite.test_unit.TestConvertWithOffset) [with input = ({‘degC’: 1, ‘millimeter’: 1, ‘meter’: -1}, {‘kelvin’: 1}); expected_output = error]
-
test_to_and_from_offset_units_00011
(input_tuple, expected)¶ test_to_and_from_offset_units (pint.testsuite.test_unit.TestConvertWithOffset) [with input = ({‘degC’: 1, ‘millimeter’: 1, ‘meter’: -1}, {‘degC’: 1, ‘millimeter’: 1, ‘meter’: -1}); expected_output = 10]
-
test_to_and_from_offset_units_00012
(input_tuple, expected)¶ test_to_and_from_offset_units (pint.testsuite.test_unit.TestConvertWithOffset) [with input = ({‘degC’: 1, ‘millimeter’: 1, ‘meter’: -1}, {‘kelvin’: 1, ‘millimeter’: 1, ‘meter’: -1}); expected_output = error]
-
test_to_and_from_offset_units_00013
(input_tuple, expected)¶ test_to_and_from_offset_units (pint.testsuite.test_unit.TestConvertWithOffset) [with input = ({‘kelvin’: 1, ‘millimeter’: 1, ‘meter’: -1}, {‘degC’: 1}); expected_output = -273.14]
-
test_to_and_from_offset_units_00014
(input_tuple, expected)¶ test_to_and_from_offset_units (pint.testsuite.test_unit.TestConvertWithOffset) [with input = ({‘kelvin’: 1, ‘millimeter’: 1, ‘meter’: -1}, {‘kelvin’: 1}); expected_output = 0.01]
-
test_to_and_from_offset_units_00015
(input_tuple, expected)¶ test_to_and_from_offset_units (pint.testsuite.test_unit.TestConvertWithOffset) [with input = ({‘kelvin’: 1, ‘millimeter’: 1, ‘meter’: -1}, {‘degC’: 1, ‘millimeter’: 1, ‘meter’: -1}); expected_output = error]
-
test_to_and_from_offset_units_00016
(input_tuple, expected)¶ test_to_and_from_offset_units (pint.testsuite.test_unit.TestConvertWithOffset) [with input = ({‘kelvin’: 1, ‘millimeter’: 1, ‘meter’: -1}, {‘kelvin’: 1, ‘millimeter’: 1, ‘meter’: -1}); expected_output = 10]
-
test_to_and_from_offset_units_00017
(input_tuple, expected)¶ test_to_and_from_offset_units (pint.testsuite.test_unit.TestConvertWithOffset) [with input = ({‘degC’: 2}, {‘kelvin’: 2}); expected_output = error]
-
test_to_and_from_offset_units_00018
(input_tuple, expected)¶ test_to_and_from_offset_units (pint.testsuite.test_unit.TestConvertWithOffset) [with input = ({‘degC’: 1, ‘degF’: 1}, {‘kelvin’: 2}); expected_output = error]
-
test_to_and_from_offset_units_00019
(input_tuple, expected)¶ test_to_and_from_offset_units (pint.testsuite.test_unit.TestConvertWithOffset) [with input = ({‘degC’: 1, ‘kelvin’: 1}, {‘kelvin’: 2}); expected_output = error]
-