Skip to content

Commit 7c4b8b3

Browse files
committed
fix mypy, black
1 parent 214c688 commit 7c4b8b3

File tree

3 files changed

+14
-5
lines changed

3 files changed

+14
-5
lines changed

src/alhambra_mixes/mixes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ def emphasize(text: str, tablefmt: str | TableFormat, strong: bool = False) -> s
330330
"""
331331
# formats a title for a table produced using tabulate,
332332
# in the formats tabulate understands
333-
if tablefmt in ["html", "unsafehtml", html_with_borders_tablefmt]: # type: ignore
333+
if tablefmt in ["html", "unsafehtml", html_with_borders_tablefmt]: # type: ignore
334334
if strong:
335335
emph_text = f"<strong>{text}</strong>"
336336
else:

src/alhambra_mixes/quantitate.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,16 +41,23 @@
4141

4242
from __future__ import annotations
4343

44-
from typing import Any, Iterable, Sequence, Type, cast
44+
from typing import Any, Iterable, Sequence, Type, Union, cast
4545
import pint
4646
import warnings
4747
import pandas
4848
from decimal import Decimal as D
4949
import decimal
5050

5151
from pint import Quantity
52-
from .mixes import Q_, ureg, DNAN, uL, uM, nM, _parse_conc_optional
53-
from .mixes import _parse_vol_optional as parse_vol
52+
from .mixes import Q_, ureg, DNAN, uL, uM, nM
53+
from .mixes import _parse_vol_optional
54+
55+
56+
def parse_vol(vol: Union[float, int, str, Quantity[D]]) -> Quantity[D]:
57+
if isinstance(vol, (float, int)):
58+
vol = Quantity(D(vol), "µL")
59+
return _parse_vol_optional(vol)
60+
5461

5562
__all__ = (
5663
"measure_conc_and_dilute",

tests/test_mixes.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,13 @@ def test_invalid_wellrefs():
8282
with pytest.raises(ValueError):
8383
WellPos("i123nvalid string")
8484

85-
def _itertools_pairwise(iterable): # FIXME: in 3.10
85+
86+
def _itertools_pairwise(iterable): # FIXME: in 3.10
8687
a, b = itertools.tee(iterable)
8788
next(b, None)
8889
return zip(a, b)
8990

91+
9092
def test_all_wellref_96():
9193
allbyrow96 = [f"{r}{c}" for r in "ABCDEFGH" for c in range(1, 13)]
9294
for x, y in _itertools_pairwise(allbyrow96):

0 commit comments

Comments
 (0)