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

Check Well exists before trying to load data #296

Merged
merged 2 commits into from
Sep 29, 2023

Conversation

will-moore
Copy link
Member

Fixes #263.

For sparse Plates with empty Wells, we shouldn't try to load empty Wells.
Here, we check if the Well exists first - and return zeros.

To test, try to open a sparse plate in napari, e.g.

$ napari https://uk1s3.embassy.ebi.ac.uk/idr/zarr/v0.4/idr0072B/9512.zarr

Should see no errors in the terminal.
Without this PR you get lots of errors like this...

Traceback (most recent call last):
  File "/Users/wmoore/opt/anaconda3/envs/omeroweb2/bin/napari", line 8, in <module>
    sys.exit(main())
  File "/Users/wmoore/opt/anaconda3/envs/omeroweb2/lib/python3.9/site-packages/napari/__main__.py", line 551, in main
    _maybe_rerun_with_macos_fixes()
  File "/Users/wmoore/opt/anaconda3/envs/omeroweb2/lib/python3.9/site-packages/napari/__main__.py", line 539, in _maybe_rerun_with_macos_fixes
    result = subprocess.run(cmd, env=env, cwd=cwd)
  File "/Users/wmoore/opt/anaconda3/envs/omeroweb2/lib/python3.9/subprocess.py", line 507, in run
    stdout, stderr = process.communicate(input, timeout=timeout)
  File "/Users/wmoore/opt/anaconda3/envs/omeroweb2/lib/python3.9/subprocess.py", line 1126, in communicate
    self.wait()
  File "/Users/wmoore/opt/anaconda3/envs/omeroweb2/lib/python3.9/subprocess.py", line 1189, in wait
    return self._wait(timeout=timeout)
  File "/Users/wmoore/opt/anaconda3/envs/omeroweb2/lib/python3.9/subprocess.py", line 1917, in _wait
    (pid, sts) = self._try_wait(0)
  File "/Users/wmoore/opt/anaconda3/envs/omeroweb2/lib/python3.9/subprocess.py", line 1875, in _try_wait
    (pid, sts) = os.waitpid(self.pid, wait_flags)
KeyboardInterrupt

@codecov
Copy link

codecov bot commented Aug 18, 2023

Codecov Report

All modified lines are covered by tests ✅

Files Coverage Δ
ome_zarr/reader.py 90.66% <100.00%> (-0.71%) ⬇️

📢 Thoughts on this report? Let us know!.

@imagesc-bot
Copy link

This pull request has been mentioned on Image.sc Forum. There might be relevant details there:

https://forum.image.sc/t/strange-behavior-of-ome-zarr-created-by-bioformats2raw-from-a-czi-image/85177/4

@will-moore will-moore added this to the 0.8.1 milestone Sep 13, 2023
@will-moore will-moore merged commit 2739e55 into ome:master Sep 29, 2023
12 checks passed
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

Successfully merging this pull request may close these issues.

Sparse plate, with "missing" Wells shouldn't throw exceptions
3 participants