Skip to content

Add note about zarr etc requirement for export script with zarr images#686

Open
will-moore wants to merge 3 commits intoome:masterfrom
will-moore:document_export_script_zarr_requirement
Open

Add note about zarr etc requirement for export script with zarr images#686
will-moore wants to merge 3 commits intoome:masterfrom
will-moore:document_export_script_zarr_requirement

Conversation

@will-moore
Copy link
Copy Markdown
Member

Document need for export script to install zarr if figure has zarr images.

Currently script fails to import zarr, so will error if it contains zarr images (see below).

I guess we could have it silently skip OME-zarr images if zarr import fails?

Traceback (most recent call last):
  File "/home/omero-x/omero/tmp/omero_omero-x/50918/processufqayf2_.dir/./script", line 3562, in <module>
    handle_main()
  File "/home/omero-x/omero/tmp/omero_omero-x/50918/processufqayf2_.dir/./script", line 3506, in handle_main
    run_script()
  File "/home/omero-x/omero/tmp/omero_omero-x/50918/processufqayf2_.dir/./script", line 3485, in run_script
    file_annotation = export_figure(conn, script_params)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/omero-x/omero/tmp/omero_omero-x/50918/processufqayf2_.dir/./script", line 3437, in export_figure
    return fig_export.build_figure()
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/omero-x/omero/tmp/omero_omero-x/50918/processufqayf2_.dir/./script", line 1257, in build_figure
    self.add_panels_to_page(panels_json, page)
  File "/home/omero-x/omero/tmp/omero_omero-x/50918/processufqayf2_.dir/./script", line 2761, in add_panels_to_page
    pil_img = self.draw_panel(panel, page, i)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/omero-x/omero/tmp/omero_omero-x/50918/processufqayf2_.dir/./script", line 2580, in draw_panel
    pil_img = self.get_panel_image(panel, orig_name)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/omero-x/omero/tmp/omero_omero-x/50918/processufqayf2_.dir/./script", line 2492, in get_panel_image
    scale, pil_img = self.render_zarr_to_pil(panel)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/omero-x/omero/tmp/omero_omero-x/50918/processufqayf2_.dir/./script", line 2328, in render_zarr_to_pil
    import zarr
ModuleNotFoundError: No module named 'zarr'

cc @pwalczysko

@pwalczysko
Copy link
Copy Markdown
Member

I guess we could have it silently skip OME-zarr images if zarr import fails?

That strongly resembles the discussion we had on the reportlab case, cc @Rdornier . I think it is better to have it properly failed rather than silently dropping data.

Comment thread README.rst Outdated
$ pip install reportlab markdown

* Optional: Figure legends can be formatted using Markdown syntax. To see this correctly in the exported PDF info page, we need `Python Markdown <https://python-markdown.github.io/>`_:
* Optional: If your figure contains OME-Zarr images, you will also need to install the dependencies for rendering OME-Zarr images in the export script.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

like that, optional, indeed

@pwalczysko
Copy link
Copy Markdown
Member

Tested the recommended workflow and indeed the pip install zarr dask fsspec[http] into the server venv solves the export of figures which contain zarr.
It also reads well.

Thank you

@will-moore
Copy link
Copy Markdown
Member Author

@pwalczysko Sorry to add more to this PR, but since we're editing script install instructions.... I realised that the current workflow "upload script then dependencies" won't work on a fresh install since the upload will fail if you don't already have dependencies installed. So I've switched the order.

Also made it clearer that OME-Zarr support (for script export) is still in rc status. Don't want people getting confused before it's released proper.

@pwalczysko
Copy link
Copy Markdown
Member

@pwalczysko Sorry to add more to this PR, but since we're editing script install instructions.... I realised that the current workflow "upload script then dependencies" won't work on a fresh install since the upload will fail if you don't already have dependencies installed. So I've switched the order.

Also made it clearer that OME-Zarr support (for script export) is still in rc status. Don't want people getting confused before it's released proper.

Yes, thanks, this is a clear logical swap and the highlight to RC is also helpful imho.

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.

2 participants