Skip to content

Commit 49a6770

Browse files
committed
height<>volume functions in Tube.__init__
1 parent 945f6bc commit 49a6770

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

pylabrobot/resources/tube.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
from typing import List, Optional, Tuple
22

3+
from traitlets import Callable
4+
35
from pylabrobot.resources.container import Container
46
from pylabrobot.resources.liquid import Liquid
57

@@ -21,6 +23,8 @@ def __init__(
2123
material_z_thickness: Optional[float] = None,
2224
category: str = "tube",
2325
model: Optional[str] = None,
26+
compute_volume_from_height: Optional[Callable[[float], float]] = None,
27+
compute_height_from_volume: Optional[Callable[[float], float]] = None,
2428
):
2529
"""Create a new tube.
2630
@@ -43,6 +47,8 @@ def __init__(
4347
category=category,
4448
max_volume=max_volume,
4549
model=model,
50+
compute_volume_from_height=compute_volume_from_height,
51+
compute_height_from_volume=compute_height_from_volume,
4652
)
4753
self.tracker.register_callback(self._state_updated)
4854

0 commit comments

Comments
 (0)