From ab0bece70bcc682fd2c3716d1230935cd79e4d3c Mon Sep 17 00:00:00 2001 From: Julian Stirling Date: Wed, 20 Aug 2025 13:14:16 +0100 Subject: [PATCH] Deepcopy default tuning file so it isn't affected by calibration. --- src/openflexure_microscope_server/things/camera/picamera.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/openflexure_microscope_server/things/camera/picamera.py b/src/openflexure_microscope_server/things/camera/picamera.py index 130537de..b12b888a 100644 --- a/src/openflexure_microscope_server/things/camera/picamera.py +++ b/src/openflexure_microscope_server/things/camera/picamera.py @@ -20,6 +20,7 @@ from datetime import datetime import json import logging import os +import copy import tempfile import time from contextlib import contextmanager @@ -138,7 +139,7 @@ class StreamingPiCamera2(BaseCamera): # Set tuning to default tuning. This will be overwritten when the Thing is # connects to the server if tuning is saved to disk. try: - self.tuning = self.default_tuning + self.tuning = copy.deepcopy(self.default_tuning) except NotConnectedToServerError: # This will throw an error after setting as we are not connected to # a server. But we know this, so we ignore the error.