Skip to content

Commit

Permalink
Deprecate Labware.positions
Browse files Browse the repository at this point in the history
This lookup dictionary encoded a well numbering scheme
which differs between Tecan EVO and Tecan Fluent liquid handlers.

Users should use these functions instead:
* `evotools.get_well_position`
* `fluenttools.get_well_position`
  • Loading branch information
michaelosthege committed Mar 26, 2024
1 parent 8aa9891 commit 1765f3c
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 30 deletions.
6 changes: 6 additions & 0 deletions robotools/liquidhandling/labware.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,12 @@ def indices(self) -> Dict[str, Tuple[int, int]]:
@property
def positions(self) -> Dict[str, int]:
"""Mapping of well-ids to EVOware-compatible position numbers."""
warnings.warn(
"`Labware.positions` is deprecated in favor of model-specific implementations."
"Use `robotools.evotools.get_well_positions()` or `robotools.fluenttools.get_well_positions()`.",
DeprecationWarning,
stacklevel=2,
)
return self._positions

@property
Expand Down
62 changes: 32 additions & 30 deletions robotools/liquidhandling/test_labware.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,15 @@ def test_init(self) -> None:
"B03": (1, 2),
}
assert plate.indices == exp
assert plate.positions == {
"A01": 1,
"A02": 3,
"A03": 5,
"B01": 2,
"B02": 4,
"B03": 6,
}
with pytest.warns(DeprecationWarning, match="in favor of model-specific"):
assert plate.positions == {
"A01": 1,
"A02": 3,
"A03": 5,
"B01": 2,
"B02": 4,
"B03": 6,
}
return

def test_invalid_init(self) -> None:
Expand Down Expand Up @@ -215,28 +216,29 @@ def test_init_trough(self) -> None:
"E03": (0, 2),
"E04": (0, 3),
}
assert trough.positions == {
"A01": 1,
"A02": 6,
"A03": 11,
"A04": 16,
"B01": 2,
"B02": 7,
"B03": 12,
"B04": 17,
"C01": 3,
"C02": 8,
"C03": 13,
"C04": 18,
"D01": 4,
"D02": 9,
"D03": 14,
"D04": 19,
"E01": 5,
"E02": 10,
"E03": 15,
"E04": 20,
}
with pytest.warns(DeprecationWarning, match="in favor of model-specific"):
assert trough.positions == {
"A01": 1,
"A02": 6,
"A03": 11,
"A04": 16,
"B01": 2,
"B02": 7,
"B03": 12,
"B04": 17,
"C01": 3,
"C02": 8,
"C03": 13,
"C04": 18,
"D01": 4,
"D02": 9,
"D03": 14,
"D04": 19,
"E01": 5,
"E02": 10,
"E03": 15,
"E04": 20,
}
return

def test_initial_volumes(self) -> None:
Expand Down

0 comments on commit 1765f3c

Please sign in to comment.