2.9 dev numpy types

This commit is contained in:
Joel Collins 2020-12-04 13:35:11 +00:00
parent f2a2d880f2
commit 63b633ba44
10 changed files with 156 additions and 90 deletions

View file

@ -3,14 +3,16 @@ import io
import logging
import time
from abc import ABCMeta, abstractmethod
from collections import namedtuple
from types import TracebackType
from typing import BinaryIO, List, Optional, Tuple, Type, Union
from typing import BinaryIO, List, NamedTuple, Optional, Tuple, Type, Union
from labthings import ClientEvent, StrictLock
# Class to store a frames metadata
TrackerFrame = namedtuple("TrackerFrame", ["size", "time"])
class TrackerFrame(NamedTuple):
size: int
time: float
class FrameStream(io.BytesIO):
@ -172,16 +174,17 @@ class BaseCamera(metaclass=ABCMeta):
def start_worker(self, **_) -> bool:
"""Start the background camera thread if it isn't running yet."""
logging.debug(
logging.warning(
"`start_worker` method has been deprecated and is no longer required. Please avoid calling this method."
)
return True
def get_frame(self):
"""Return the current camera frame."""
logging.debug(
"`camera.get_frame` method has been deprecated. Please use `camera.stream.getframe()."
)
"""
Return the current camera frame.
Just an alias of self.stream.getframe()
"""
return self.stream.getframe()
def __enter__(self):