Skip to content

Commit

Permalink
Merge pull request #706 from henrypinkard/main
Browse files Browse the repository at this point in the history
Update AcqEngPy and increase timeout default to avoid failed tests
  • Loading branch information
henrypinkard authored Sep 29, 2023
2 parents 3cb2d07 + ec363e5 commit d6fb88a
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 13 deletions.
2 changes: 1 addition & 1 deletion pycromanager/_version.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
version_info = (0, 29, 7)
version_info = (0, 29, 8)
__version__ = ".".join(map(str, version_info))
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ def copy(self):
e.stageDeviceNamesToAxisNames_ = self.stageDeviceNamesToAxisNames_.copy()
e.xPosition_ = self.xPosition_
e.yPosition_ = self.yPosition_
e.zPosition_ = self.zPosition_
e.miniumumStartTime_ms_ = self.miniumumStartTime_ms_
e.slmImage_ = self.slmImage_
e.acquireImage_ = self.acquireImage_
Expand Down
24 changes: 12 additions & 12 deletions pycromanager/acquisition/java_backend_acquisitions.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ def __init__(
show_display: bool=True,
napari_viewer=None,
saving_queue_size: int=20,
timeout: int=2000,
timeout: int=2500,
port: int=DEFAULT_PORT,
debug: int=False
):
Expand Down Expand Up @@ -286,7 +286,8 @@ def __init__(

try:
self._remote_notification_handler = JavaObject('org.micromanager.remote.RemoteNotificationHandler',
args=[self._acq], port=self._port, new_socket=False)
args=[self._acq], port=self._port, new_socket=False,
timeout=self._timeout)
self._acq_notification_recieving_thread = self._start_receiving_notifications()
self._acq_notification_dispatcher_thread = self._start_notification_dispatcher(notification_callback_fn)
# TODO: can remove this after this feature has been present for a while
Expand Down Expand Up @@ -476,7 +477,7 @@ def _initialize_image_processor(self, **kwargs):

if kwargs['image_process_fn'] is not None:
java_processor = JavaObject(
"org.micromanager.remote.RemoteImageProcessor", port=self._port
"org.micromanager.remote.RemoteImageProcessor", port=self._port, timeout=self._timeout
)
self._acq.add_image_processor(java_processor)
self._processor_thread = self._start_processor(
Expand All @@ -489,29 +490,29 @@ def _initialize_hooks(self, **kwargs):
self._hook_threads = []
if kwargs['event_generation_hook_fn'] is not None:
hook = JavaObject(
"org.micromanager.remote.RemoteAcqHook", port=self._port, args=[self._acq]
"org.micromanager.remote.RemoteAcqHook", port=self._port, args=[self._acq], timeout=self._timeout
)
self._hook_threads.append(self._start_hook(hook, kwargs['event_generation_hook_fn'],
self._event_queue, process=False))
self._acq.add_hook(hook, self._acq.EVENT_GENERATION_HOOK)
if kwargs['pre_hardware_hook_fn'] is not None:
hook = JavaObject(
"org.micromanager.remote.RemoteAcqHook", port=self._port, args=[self._acq]
"org.micromanager.remote.RemoteAcqHook", port=self._port, args=[self._acq], timeout=self._timeout
)
self._hook_threads.append(self._start_hook(hook,
kwargs['pre_hardware_hook_fn'], self._event_queue,
process=False))
self._acq.add_hook(hook, self._acq.BEFORE_HARDWARE_HOOK)
if kwargs['post_hardware_hook_fn'] is not None:
hook = JavaObject(
"org.micromanager.remote.RemoteAcqHook", port=self._port, args=[self._acq]
"org.micromanager.remote.RemoteAcqHook", port=self._port, args=[self._acq], timeout=self._timeout
)
self._hook_threads.append(self._start_hook(hook, kwargs['post_hardware_hook_fn'],
self._event_queue, process=False))
self._acq.add_hook(hook, self._acq.AFTER_HARDWARE_HOOK)
if kwargs['post_camera_hook_fn'] is not None:
hook = JavaObject(
"org.micromanager.remote.RemoteAcqHook", port=self._port, args=[self._acq],
"org.micromanager.remote.RemoteAcqHook", port=self._port, args=[self._acq], timeout=self._timeout
)
self._hook_threads.append(self._start_hook(hook, kwargs['post_camera_hook_fn'],
self._event_queue, process=False))
Expand All @@ -523,7 +524,7 @@ def _create_remote_acquisition(self, **kwargs):
# create a new socket for it to run on so that it can have blocking calls without interfering with
# the main socket or other internal sockets
new_socket=True,
port=self._port, args=[core], debug=self._debug)
port=self._port, args=[core], debug=self._debug, timeout=self._timeout)
show_viewer = kwargs['show_display'] is True and kwargs['napari_viewer'] is None
self._acq = acq_factory.create_acquisition(kwargs['directory'], kwargs['name'], show_viewer,
kwargs['saving_queue_size'], self._debug,)
Expand Down Expand Up @@ -665,9 +666,8 @@ def __init__(

def _create_remote_acquisition(self, port, **kwargs):
core = ZMQRemoteMMCoreJ(port=self._port, timeout=self._timeout)
acq_factory = JavaObject(
"org.micromanager.remote.RemoteAcquisitionFactory", port=self._port, args=[core]
)
acq_factory = JavaObject("org.micromanager.remote.RemoteAcquisitionFactory",
port=self._port, args=[core], timeout=self._timeout)

show_viewer = kwargs['show_display'] is True and\
kwargs['napari_viewer'] is None and\
Expand Down Expand Up @@ -711,7 +711,7 @@ def __init__(
show_display: bool=True,
image_saved_fn: callable=None,
saving_queue_size: int=20,
timeout: int=1000,
timeout: int=2500,
port: int=DEFAULT_PORT,
debug: bool=False,
):
Expand Down

0 comments on commit d6fb88a

Please sign in to comment.