diff --git a/openflexure_microscope/camera/pi.py b/openflexure_microscope/camera/pi.py index a4698d52..f39034e6 100644 --- a/openflexure_microscope/camera/pi.py +++ b/openflexure_microscope/camera/pi.py @@ -28,9 +28,6 @@ import time import numpy as np import logging -# Used for conversion only -from fractions import Fraction - # Pi camera import picamera import picamera.array @@ -62,21 +59,6 @@ CONFIG_KEYS = { } -# Useful methods - -def fractions_to_floats(value): - """Deal with horrible, horrible PiCamera fractions""" - result = value - if type(value) is list or type(value) is tuple: - result = [float(v) if isinstance(v, Fraction) else v for v in value] - if type(value) is tuple: - result = tuple(result) - else: - if isinstance(value, Fraction): - result = float(value) - return result - - # MAIN CLASS class StreamingCamera(BaseCamera): """Raspberry Pi camera implementation of StreamingCamera. @@ -152,7 +134,6 @@ class StreamingCamera(BaseCamera): for key, _ in self.config['picamera_settings'].items(): try: value = getattr(self.camera, key) - value = fractions_to_floats(value) conf_dict['picamera_settings'][key] = value except AttributeError: logging.debug("Unable to read PiCamera attribute {}".format(key))