Code cleanup

This commit is contained in:
Joel Collins 2020-10-14 14:56:29 +00:00
parent 2bfb988460
commit 994e83dbeb
46 changed files with 261 additions and 318 deletions

View file

@ -6,7 +6,6 @@ import shutil
from fractions import Fraction
from uuid import UUID
import flask
import numpy as np
from labthings.json import LabThingsJSONEncoder
@ -27,8 +26,8 @@ class OpenflexureSettingsFile:
expand (bool): Expand paths to valid auxillary config files.
"""
def __init__(self, path: str, defaults: dict = {}):
global DEFAULT_SETTINGS
def __init__(self, path: str, defaults: dict = None):
defaults = defaults or {}
# Set arguments
self.path = path
@ -84,7 +83,7 @@ class JSONEncoder(LabThingsJSONEncoder):
A custom JSON encoder, with type conversions for PiCamera fractions, Numpy integers, and Numpy arrays
"""
def default(self, o, markers=None):
def default(self, o):
if isinstance(o, UUID):
return str(o)
# PiCamera fractions