From bac0e886f573d479b79e64f90f26056d3b6f30c7 Mon Sep 17 00:00:00 2001 From: Henry Pinkard <7969470+henrypinkard@users.noreply.github.com> Date: Thu, 5 Oct 2023 11:20:27 -0700 Subject: [PATCH 1/2] fix some python backend bugs --- .../acquisition/acq_eng_py/main/acq_notification.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pycromanager/acquisition/acq_eng_py/main/acq_notification.py b/pycromanager/acquisition/acq_eng_py/main/acq_notification.py index 6358cc8b..e1ce5679 100644 --- a/pycromanager/acquisition/acq_eng_py/main/acq_notification.py +++ b/pycromanager/acquisition/acq_eng_py/main/acq_notification.py @@ -36,21 +36,21 @@ def to_string(): return "image" def __init__(self, type, id, phase=None): - if type == AcqNotification.Acquisition.to_string(): + if type == AcqNotification.Acquisition: self.type = AcqNotification.Acquisition self.id = id self.phase = phase - elif type == AcqNotification.Image.to_string() and phase == AcqNotification.Image.DATA_SINK_FINISHED: + elif type == AcqNotification.Image and phase == AcqNotification.Image.DATA_SINK_FINISHED: self.type = AcqNotification.Image self.id = id self.phase = phase elif phase in [AcqNotification.Camera.PRE_SNAP, AcqNotification.Camera.POST_EXPOSURE, AcqNotification.Camera.PRE_SEQUENCE_STARTED]: self.type = AcqNotification.Camera - self.id = json.loads(id) + self.id = id elif phase in [AcqNotification.Hardware.PRE_HARDWARE, AcqNotification.Hardware.POST_HARDWARE]: self.type = AcqNotification.Hardware - self.id = json.loads(id) + self.id = id elif phase == AcqNotification.Image.IMAGE_SAVED: self.type = AcqNotification.Image self.id = id From c79cc6a2fddf5ec6880b5c8c5304743e92fbad96 Mon Sep 17 00:00:00 2001 From: Henry Pinkard <7969470+henrypinkard@users.noreply.github.com> Date: Thu, 5 Oct 2023 11:29:15 -0700 Subject: [PATCH 2/2] remove directory from python backend acq --- pycromanager/acquisition/python_backend_acquisitions.py | 3 --- scripts/python_backend.py | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/pycromanager/acquisition/python_backend_acquisitions.py b/pycromanager/acquisition/python_backend_acquisitions.py index d34292dd..b52e5c6e 100644 --- a/pycromanager/acquisition/python_backend_acquisitions.py +++ b/pycromanager/acquisition/python_backend_acquisitions.py @@ -19,7 +19,6 @@ class PythonBackendAcquisition(Acquisition, metaclass=NumpyDocstringInheritanceM def __init__( self, - directory: str=None, name: str='default_acq_name', image_process_fn: callable=None, event_generation_hook_fn: callable = None, @@ -38,8 +37,6 @@ def __init__( dict(signature(PythonBackendAcquisition.__init__).parameters.items())[arg_name].default) for arg_name in arg_names } super().__init__(**named_args) - if directory is not None: - raise NotImplementedError('Saving to disk is not yet implemented for the python backend. ') self._dataset = RAMDataStorage() self._finished = False self._notifications_finished = False diff --git a/scripts/python_backend.py b/scripts/python_backend.py index 7b3e50a9..3024e19b 100644 --- a/scripts/python_backend.py +++ b/scripts/python_backend.py @@ -2,7 +2,7 @@ mm_app_path = r"C:\Users\henry\Micro-Manager-nightly" config = mm_app_path + r"\MMConfig_demo.cfg" -start_headless(mm_app_path, config, python_backend=True) +start_headless(mm_app_path, config, python_backend=False) with Acquisition() as acq: acq.acquire(multi_d_acquisition_events(num_time_points=10))