Container

Hold and manage liquids in a container.

MRO
Decorators
dataclasses.dataclass

Methods

  • __init__(
      self,
      liquids : list[tuple[Liquid, decimal.Decimal]]
    ) -> None

    Parameters

    • Name
      self
      Type
      Default
      Description

    • Name
      height
      Type
      Decimal
      Default
      Description

    • Name
      sections
      Type
      list[Shape]
      Default
      Description

    • Name
      max_volume
      Type
      Decimal
      Default
      Description

      The maximum volume in µl that can safely be added to the container.

    • Name
      liquids
      Type
      list[tuple[Liquid, decimal.Decimal]]
      Default
      Description

  • __post_init__(self) -> None

  • @log()

    add_liquid(self, liquid : Liquid, volume : Number) -> None

    Add a certain volume of liquid into this container.

    Parameters

    • Name
      self
      Type
      Default
      Description

    • Name
      liquid
      Type
      Liquid
      Default
      Description

      The type of liquid to add.

    • Name
      volume
      Type
      Number
      Default
      Description

      The volume of liquid in µl to add.

    Exceptions

    Type
    LiquidOverflowError
    Description
    If the volume does not fit into the container anymore.
  • @log()

    add_liquids(self, liquids : list[tuple[Liquid, decimal.Decimal]]) -> None

    Add a mixture of liquids into this container.

    Parameters

    • Name
      self
      Type
      Default
      Description

    • Name
      liquids
      Type
      list[tuple[Liquid, decimal.Decimal]]
      Default
      Description

  • @log()

    remove_liquid(self, volume : Number) -> list[tuple[Liquid, decimal.Decimal]]

    Remove a certain volume from this container.

    Parameters

    • Name
      self
      Type
      Default
      Description

    • Name
      volume
      Type
      Number
      Default
      Description

      The volume of liquid in µl to remove.

    Response

    Type
    list[tuple[Liquid, decimal.Decimal]]
    Description

    Exceptions

    Type
    LiquidUnderflowError
    Description
    If the container does not contain enough liquid to remove.
  • volume_for_height(self, height) -> None

    Parameters

    • Name
      self
      Type
      Default
      Description

    • Name
      height
      Type
      Default
      Description

  • height_for_volume(self, volume) -> None

    Parameters

    • Name
      self
      Type
      Default
      Description

    • Name
      volume
      Type
      Default
      Description

Attributes

  • Name
    max_volume
    Type
    Decimal
    Value

    = Decimal()

    Description

  • Name
    liquids
    Type
    list[tuple[Liquid, decimal.Decimal]]
    Value

    = dataclasses.field(default_factory=list)

    Description

  • Name
    height
    Type
    Decimal
    Value

    = dataclasses.field(init=False)

    Description

  • Name
    _volume
    Type
    Value

    = Decimal()

    Description

  • Name
    _liquid_level
    Type
    Value

    = Decimal()

    Description

  • Name
    logger
    Type
    logging.Logger
    Value

    = None

    Description

  • Name
    volume
    Type
    decimal.Decimal
    Value

    = None

    Description

    The current volume in µl of liquid filling the container.

  • Name
    free_volume
    Type
    decimal.Decimal
    Value

    = None

    Description

    The freely available volume in µl in the container.

  • Name
    liquid_level
    Type
    decimal.Decimal
    Value

    = None

    Description

    The height of the liquid in the container, in mm.

  • Name
    sections
    Type
    list[Shape]
    Value

    = dataclasses.field(default_factory=list)

    Description

  • Name
    max_fitting_volume
    Type
    decimal.Decimal
    Value

    = None

    Description

    The maximum volume that fits into this shape.

Copyright © 2024