unitelabs.labware.liquids.mixture

Attributes

  • Name
    Number
    Type
    Value

    = typing.Union[str, int, float, tuple[int, collections.abc.Sequence[int], int], decimal.Decimal]

    Description

Functions

  • parse_number(value : Number) -> decimal.Decimal

    Convert any valid number to a decimal value.

    Parameters

    • Name
      value
      Type
      Number
      Default
      Description

      The number to convert.

    Response

    Type
    decimal.Decimal
    Description

    The decimal value.

  • log(level : typing.Union[typing.Literal['CRITICAL', 'FATAL', 'ERROR', 'WARN', 'WARNING', 'INFO', 'DEBUG'], Level]) -> None

    Log the method execution of a class with the provided arguments.

    Parameters

    • Name
      level
      Type
      typing.Union[typing.Literal['CRITICAL', 'FATAL', 'ERROR', 'WARN', 'WARNING', 'INFO', 'DEBUG'], Level]
      Default
      = NOTSET
      Description

      The log level to be used for logging.

Classes

  • Mixture

    Combination of liquids mixed together.

    Bases
    collections.abc.MutableSequence[Ingredient]

    Methods

    • __init__(self, ingredients : typing.Optional[collections.abc.Iterable[Ingredient]]) -> None

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        ingredients
        Type
        typing.Optional[collections.abc.Iterable[Ingredient]]
        Default
        = None
        Description

    • __len__(self) -> int

      Return len(self).

      Response

      Type
      int
      Description

    • __contains__(self, value : typing.Union[Liquid, Sample]) -> bool

      Return value in self.

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        value
        Type
        typing.Union[Liquid, Sample]
        Default
        Description

      Response

      Type
      bool
      Description

    • __getitem__(self, index : typing.Union[typing.SupportsIndex, slice]) -> typing.Union[Ingredient, list[Ingredient]]

      x.__getitem__(y) <==> x[y]

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        index
        Type
        typing.Union[typing.SupportsIndex, slice]
        Default
        Description

      Response

      Type
      typing.Union[Ingredient, list[Ingredient]]
      Description

    • __setitem__(self, index : typing.Union[typing.SupportsIndex, slice], value : typing.Union[Ingredient, collections.abc.Iterable[Ingredient]]) -> None

      Set self[key] to value.

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        index
        Type
        typing.Union[typing.SupportsIndex, slice]
        Default
        Description

      • Name
        value
        Type
        typing.Union[Ingredient, collections.abc.Iterable[Ingredient]]
        Default
        Description

    • __delitem__(self, index : typing.Union[typing.SupportsIndex, slice]) -> None

      Delete self[key].

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        index
        Type
        typing.Union[typing.SupportsIndex, slice]
        Default
        Description

    • __iter__(self) -> collections.abc.Iterator[Ingredient]

      Implement iter(self).

      Response

      Type
      collections.abc.Iterator[Ingredient]
      Description

    • __reversed__(self) -> collections.abc.Iterator[Ingredient]

      Return a reverse iterator over the list.

      Response

      Type
      collections.abc.Iterator[Ingredient]
      Description

    • __add__(self, other : typing.Union[Mixture, collections.abc.Iterable[Ingredient], Ingredient]) -> Mixture

      Return self+other.

      Parameters

      Response

      Type
      Mixture
      Description

    • __radd__(self, other : typing.Union[Mixture, collections.abc.Iterable[Ingredient], Ingredient]) -> Mixture

      Return other+self.

      Parameters

      Response

      Type
      Mixture
      Description

    • __iadd__(self, other : typing.Union[Mixture, collections.abc.Iterable[Ingredient], Ingredient]) -> Mixture

      Implement self+=value.

      Parameters

      Response

      Type
      Mixture
      Description

    • __str__(self) -> None

      Return str(self).

    • __repr__(self) -> None

      Return repr(self).

    • __eq__(self, value : typing.Union[Mixture, collections.abc.Iterable[Ingredient]]) -> bool

      Return self==value.

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        value
        Type
        typing.Union[Mixture, collections.abc.Iterable[Ingredient]]
        Default
        Description

      Response

      Type
      bool
      Description

    • @log()

      add(self, value : typing.Union[Liquid, Sample], volume : Number) -> None

      Add volume of liquid to this mixture.

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        value
        Type
        typing.Union[Liquid, Sample]
        Default
        Description

        The type of liquid to add.

      • Name
        volume
        Type
        Number
        Default
        Description

        The volume of liquid in µl to add.

    • @log()

      append(self, value : Ingredient) -> None

      Append object to the end of the list.

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        value
        Type
        Ingredient
        Default
        Description

    • @log()

      extend(self, values : typing.Union[Mixture, collections.abc.Iterable[Ingredient]]) -> None

      Extend list by appending elements from the iterable.

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        values
        Type
        typing.Union[Mixture, collections.abc.Iterable[Ingredient]]
        Default
        Description

    • @log()

      insert(self, index : typing.SupportsIndex, value : Ingredient) -> None

      Insert value before index.

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        index
        Type
        typing.SupportsIndex
        Default
        Description

      • Name
        value
        Type
        Ingredient
        Default
        Description

    • @log()

      pop(self, index : typing.SupportsIndex) -> Ingredient

      Remove and return item at index (default last).

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        index
        Type
        typing.SupportsIndex
        Default
        Description

      Response

      Type
      Ingredient
      Description

      Exceptions

      Type
      IndexError
      Description
      if list is empty or index is out of range.
    • @log()

      remove(self, volume : Number) -> Mixture

      Remove volume proportionally from mixture.

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        volume
        Type
        Number
        Default
        Description

        The volume of liquid in µl to remove.

      Response

      Type
      Mixture
      Description

      The removed mixture of liquid.

      Exceptions

      Type
      ValueError
      Description
      If the volume to remove exceeds the current volume.
    • @log()

      clear(self) -> None

      Remove all items from the mixture.

    • copy(self) -> Mixture

      Return a shallow copy of the mixture.

      Response

      Type
      Mixture
      Description

    • count(self, value : typing.Union[Liquid, Sample]) -> int

      Return number of occurrences of value.

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        value
        Type
        typing.Union[Liquid, Sample]
        Default
        Description

      Response

      Type
      int
      Description

    • index(self, value : typing.Union[Liquid, Sample], start : typing.SupportsIndex, stop : typing.SupportsIndex) -> int

      Return first index of value.

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        value
        Type
        typing.Union[Liquid, Sample]
        Default
        Description

      • Name
        start
        Type
        typing.SupportsIndex
        Default
        = 0
        Description

      • Name
        stop
        Type
        typing.SupportsIndex
        Default
        = sys.maxsize
        Description

      Response

      Type
      int
      Description

      Exceptions

      Type
      ValueError
      Description
      if the value is not present.
    • reverse(self) -> None

      Reverse sequence in place.

    Attributes

    • Name
      _ingredients
      Type
      list[Ingredient]
      Value

      = list(ingredients) if ingredients is not None else []

      Description

    • Name
      _volume
      Type
      decimal.Decimal
      Value

      = sum(v.amount for v in self._ingredients, start=decimal.Decimal(0))

      Description

    • Name
      logger
      Type
      logging.Logger
      Value

      = None

      Description

    • Name
      volume
      Type
      decimal.Decimal
      Value

      = None

      Description

      The current volume in µl of liquid in this mixture.

    • Name
      ingredients
      Type
      list[Ingredient]
      Value

      = None

      Description

      The current ingredients in this mixture.

Copyright © 2024