Skip to content

fix table.close in batch_roi_export_to_table.py#33

Merged
jburel merged 2 commits intoome:masterfrom
will-moore:fix_table_close_in_script
Sep 2, 2021
Merged

fix table.close in batch_roi_export_to_table.py#33
jburel merged 2 commits intoome:masterfrom
will-moore:fix_table_close_in_script

Conversation

@will-moore
Copy link
Copy Markdown
Member

@will-moore will-moore commented Aug 23, 2021

See https://github.com/ome/training-scripts/pull/89/files#r688333998

This fixes a bug in batch_roi_export_to_table.py since we must now do table.getOriginalFile() before closing the table.

To test,

  • Upload script to a server
  • Run from webclient, choosing a Project, Dasetet or a few Images - *Script is designed to work with idr0021 data
  • Bulk-annotation table should be linked to the parent Project

@github-actions
Copy link
Copy Markdown

Binder 👈 Launch a binder notebook on branch fix_table_close_in_script

@pwalczysko
Copy link
Copy Markdown
Member

pwalczysko commented Aug 25, 2021

Uploaded to outreach server. Ran the script on a dataset with 3 images.
I am getting a csv created and attached successfully to the Dataset, but no table because

Traceback (most recent call last):
  File "./script", line 439, in <module>
    run_script()
  File "./script", line 422, in run_script
    result = batch_roi_export(conn, script_params)
  File "./script", line 343, in batch_roi_export
    save_table(conn, images, image_data, script_params, project)
  File "./script", line 253, in save_table
    table.initialize(data)
  File "/opt/omero/server/venv3/lib64/python3.6/site-packages/omero_Tables_ice.py", line 1347, in initialize
    return _M_omero.grid.Table._op_initialize.invoke(self, ((cols, ), _ctx))
ValueError: invalid value for element 0 of sequence<double>

is reported in the exclamation mark icon

@will-moore
Copy link
Copy Markdown
Member Author

Apologies, now that I read the script again, I realise this is designed to work with idr0021 data.
Probably for other data it's trying to choose channels that don't exist etc, and getting None values in the table.

I just uploaded the script to merge-ci (via webclient, logged-in as root) - it's under a test_pr_33 script menu.
And ran it against 1 Dataset from idr0021: https://merge-ci.openmicroscopy.org/web/webclient/?show=dataset-3184
This created a csv and OMERO.table on the parent Project.

@will-moore will-moore changed the title table.close() after linking in batch_roi_export_to_table.py fix table.close in batch_roi_export_to_table.py Aug 31, 2021
Copy link
Copy Markdown
Member

@joshmoore joshmoore left a comment

Choose a reason for hiding this comment

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

This certainly matches the change that was needed elsewhere. 👍

@will-moore
Copy link
Copy Markdown
Member Author

Try/finally in 2d4e600

@jburel
Copy link
Copy Markdown
Member

jburel commented Sep 2, 2021

Thanks @will-moore

@jburel jburel merged commit 1d31ed6 into ome:master Sep 2, 2021
@will-moore will-moore deleted the fix_table_close_in_script branch September 10, 2021 16:40
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.

4 participants