omero.conversions module

Conversion utilities for changing between units.

class conversions.Add(*conversions)[source]

Bases: Conversion

Sums all the Conversion instances which are passed in to the constructor.

class conversions.Conversion(*conversions)[source]

Bases: object

Base-functor like object which can be used for preparing complex equations for converting from one unit to another. Primarily these classes and static methods are used via code-generation. Sympy-generated strings are placed directly into code. If the proper imports are in place, then a top-level Conversion (usually of type Add or Mul is returned from the evaluation).

join(sym)[source]
class conversions.Int(i)[source]

Bases: Conversion

Simple representation of a possibly very large integer.

class conversions.Mul(*conversions)[source]

Bases: Conversion

Multiplies all the Conversion instances which are passed in to the constructor.

class conversions.Pow(base, exp)[source]

Bases: Conversion

Raises the first argument (base) to the power of the second (exponent).

class conversions.Rat(n, d)[source]

Bases: Conversion

Divides the first argument (numerator) by the second (denominator).

unwrap(x, original)[source]
class conversions.Sym(s)[source]

Bases: Conversion

Represents the variable of the source unit and simply returns the original value passed to it.