Skip to content

Commit

Permalink
Merge pull request #103 from LaboratoireMecaniqueLille/docs/wrong_sha…
Browse files Browse the repository at this point in the history
…pe_typehint

Wrong type hint for the image shape argument
  • Loading branch information
WeisLeDocto authored Feb 25, 2024
2 parents b214162 + 03b937d commit cfd5a75
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/crappy/blocks/camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ def __init__(self,
save_backend: Optional[str] = None,
image_generator: Optional[Callable[[float, float],
np.ndarray]] = None,
img_shape: Optional[Tuple[int, int]] = None,
img_shape: Optional[Union[Tuple[int, int],
Tuple[int, int, int]]] = None,
img_dtype: Optional[str] = None,
**kwargs) -> None:
"""Sets the arguments and initializes the parent class.
Expand Down
2 changes: 1 addition & 1 deletion src/crappy/blocks/camera_processes/camera_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def set_shared(self,
lock: RLock,
barrier: Barrier,
event: Event,
shape: Tuple[int, int],
shape: Union[Tuple[int, int], Tuple[int, int, int]],
dtype,
to_draw_conn: Optional[Connection],
outputs: List[Link],
Expand Down
4 changes: 2 additions & 2 deletions src/crappy/tool/camera_config/camera_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from platform import system
import numpy as np
from time import time, sleep
from typing import Optional, Tuple
from typing import Optional, Tuple, Union
from pkg_resources import resource_string
from io import BytesIO
import logging
Expand Down Expand Up @@ -79,7 +79,7 @@ def __init__(self,

super().__init__()
self._camera = camera
self.shape = None
self.shape: Optional[Union[Tuple[int, int], Tuple[int, int, int]]] = None
self.dtype = None
self._logger: Optional[logging.Logger] = None

Expand Down

0 comments on commit cfd5a75

Please sign in to comment.