Skip to content

Commit

Permalink
Fix various type hints
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelosthege committed Feb 13, 2024
1 parent 72bd174 commit 1c3eb8a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
14 changes: 7 additions & 7 deletions robotools/liquidhandling/labware.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@


import warnings
from typing import Dict, List, Optional, Sequence, Tuple, Union
from typing import Dict, List, Mapping, Optional, Sequence, Tuple, Union

import numpy as np

Expand Down Expand Up @@ -91,7 +91,7 @@ def __init__(
max_volume: float,
initial_volumes: Optional[Union[float, np.ndarray]] = None,
virtual_rows: Optional[int] = None,
component_names: Optional[Dict[str, Optional[str]]] = None,
component_names: Optional[Mapping[str, Optional[str]]] = None,
) -> None:
"""Creates a `Labware` object.
Expand Down Expand Up @@ -221,10 +221,10 @@ def get_well_composition(self, well: str) -> Dict[str, float]:

def add(
self,
wells: Sequence[str],
wells: Union[str, Sequence[str], np.ndarray],
volumes: Union[float, Sequence[float], np.ndarray],
label: Optional[str] = None,
compositions: Optional[List[Optional[Dict[str, float]]]] = None,
compositions: Optional[Sequence[Optional[Mapping[str, float]]]] = None,
) -> None:
"""Adds volumes to wells.
Expand Down Expand Up @@ -280,7 +280,7 @@ def add(

def remove(
self,
wells: Sequence[str],
wells: Union[str, Sequence[str], np.ndarray],
volumes: Union[float, Sequence[float], np.ndarray],
label: Optional[str] = None,
) -> None:
Expand Down Expand Up @@ -366,8 +366,8 @@ def __init__(
*,
min_volume: float,
max_volume: float,
initial_volumes: Union[float, np.ndarray] = 0,
column_names: Optional[Sequence[Union[str, None]]] = None,
initial_volumes: Union[float, Sequence[float], np.ndarray] = 0,
column_names: Optional[Sequence[Optional[str]]] = None,
) -> None:
"""Creates a `Labware` object.
Expand Down
6 changes: 3 additions & 3 deletions robotools/transform.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from numpy.typing import ArrayLike


def make_well_index_dict(R: int, C: int) -> dict:
def make_well_index_dict(R: int, C: int) -> Dict[str, Tuple[int, int]]:
"""Create a dictionary mapping well IDs to their numpy indices.
Parameters
Expand Down Expand Up @@ -49,7 +49,7 @@ def make_well_array(R: int, C: int) -> numpy.ndarray:
class WellShifter:
"""Helper object to shift a set of well IDs within a MTP."""

def __init__(self, shape_A: tuple, shape_B: tuple, shifted_A01: str) -> None:
def __init__(self, shape_A: Tuple[int, int], shape_B: Tuple[int, int], shifted_A01: str) -> None:
"""Create a helper object for shifting wells around.
Parameters
Expand Down Expand Up @@ -123,7 +123,7 @@ def unshift(self, wells: ArrayLike) -> numpy.ndarray:
class WellRotator:
"""Helper object to rotate a set of well IDs within a MTP."""

def __init__(self, original_shape: tuple) -> None:
def __init__(self, original_shape: Tuple[int, int]) -> None:
"""Create a helper object for shifting wells around.
Parameters
Expand Down

0 comments on commit 1c3eb8a

Please sign in to comment.