From d4e7d067a39b6067665c9a506154ade1498fa696 Mon Sep 17 00:00:00 2001 From: Joel Collins Date: Thu, 31 Jan 2019 16:48:39 +0000 Subject: [PATCH] Removed fraction conversion --- openflexure_microscope/camera/pi.py | 19 ------------------- 1 file changed, 19 deletions(-) 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))