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

Adding support to tables #58

Merged
merged 24 commits into from
Nov 11, 2022
Merged

Adding support to tables #58

merged 24 commits into from
Nov 11, 2022

Conversation

erickmartins
Copy link
Collaborator

Description

Adds post_table and get_table, at least partially covering #16. An optional pandas dependency is added via the installation option ezomero[tables] - if that is available, posting a table from a pandas DataFrame and returning a table to a pandas DataFrame are enabled; otherwise, tables are posted/returned as simple lists of row-lists.

Checklist

Docstrings, unit tests and flake8 pass done.

For reviewers

  • Check that the PR title is short, concise, and will make sense 1 year
    later.
  • Check that new functions are imported in corresponding __init__.py.

ezomero/_gets.py Outdated
ann = conn.getObject('FileAnnotation', file_ann_id)
orig_table_file = conn.getObject('OriginalFile', ann.getFile().id)
resources = conn.c.sf.sharedResources()
table_obj = resources.openTable(orig_table_file._obj)
Copy link
Collaborator

Choose a reason for hiding this comment

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

do we need to catch whether someone gives a file ID that is not a table?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think we should - good catch. I'll try and figure out how to do that.

@@ -237,7 +246,7 @@ def post_map_annotation(conn, object_type, object_id, kv_dict, ns,
>>> post_map_annotation(conn, "Image", 56, d, ns)
234
"""

print("group at begin", conn.getGroupFromContext().getId())
Copy link
Collaborator

Choose a reason for hiding this comment

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

What is the significance of this line, and 276?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

that was me trying to debug the across-groups issue and forgetting to remove prints :)


Notes
-------
Currently not working with `across_groups` - the `OriginalFile` seems to
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this worth a question to the OME team before merging?

Copy link
Collaborator Author

@erickmartins erickmartins Nov 1, 2022

Choose a reason for hiding this comment

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

I think it's worth pushing it as is and opening a new issue for that problem - we can reach out to them when working that issue. The vast majority of people are not trying to post tables across groups.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

(in fact I had already created issue #59 lol)

@mellertd mellertd merged commit 59dff7d into main Nov 11, 2022
@erickmartins erickmartins mentioned this pull request Nov 11, 2022
@erickmartins erickmartins deleted the tables branch December 8, 2022 14:48
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.

None yet

2 participants