Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AcquisitionFuture.await_image_saved does not return image and metadata #799

Closed
ilyakolb opened this issue Oct 24, 2024 · 1 comment
Closed

Comments

@ilyakolb
Copy link
Contributor

Using the command:

img,metadata = future.await_image_saved(event['axes'], return_image = True, return_metadata=True)

Expected behavior is that both the image and metadata are returned.

Actual behavior:

    img,metadata = future.await_image_saved(event['axes'], return_image = True, return_metadata=True)
    ^^^^^^^^^^^^
ValueError: too many values to unpack (expected 2)

Only the image data is being returned because line 152 from the code below never gets called (the function returns on one of the previous if statements).

if return_image:
if isinstance(axes, list):
return [self._acq.get_dataset().read_image(**ax) for ax in axes]
else:
return self._acq.get_dataset().read_image(**axes)
if return_metadata:
if isinstance(axes, list):
return [self._acq.get_dataset().read_metadata(**ax) for ax in axes]
else:
return self._acq.get_dataset().read_metadata(**axes)
if return_image and return_metadata:
if isinstance(axes, list):
return [(self._acq.get_dataset().read_image(**ax), self._acq.get_dataset().read_metadata(**ax)) for ax in axes]
else:
return self._acq.get_dataset().read_image(**axes), self._acq.get_dataset().read_metadata(**axes)

@ilyakolb
Copy link
Contributor Author

Fixed in #800

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant