Repository navigation
FIREFLY-1631: Make it possible to pass table UI options - #82
Conversation
|
Notebooks changed:
Review visual diffs and comment on any notebook cell. All comments sync back to this PR. Powered by ReviewNB |
aventura121
left a comment
There was a problem hiding this comment.
Looks good to me. One friendly, minor nit about the use of flat checks like "options and tbl_options.update(options)" not seeming idiomatic to me, but I see it's a convention in this project. No worries, etc. Nice job.
| def _get_tbl_ui_id(tbl_id): | ||
| """Return the table UI ID that `show_table()` assigns to a table with ID `tbl_id`.""" | ||
| return f'{tbl_id}-ui' | ||
|
|
There was a problem hiding this comment.
this is they way we typically do it, but I am not sure that is enforced anywhere. It might be worth checking with @loitly
There was a problem hiding this comment.
I'm explicitly setting the table ui id in dispatching each show table request so I can depend on it when dispatching set table option.
I agree this is not idiomatic in python but early development on this package brought this convention from JS idioms I believe. |
Fixes FIREFLY-1631
show_table(options=...)being silently ignored: options were nested inside the table request, but Firefly reads them from the top level of the action payloadset_table_options(tbl_id, **options)to change display options of a table that is already shown. It dispatches Firefly'stableUi.updateaction using a predictable UI id (<tbl_id>-ui) thatshow_tablenow assigns, and passes options through as-isTblOptionstypedefdocs/usage/viewing-tables.ipynb(setting options inshow_table, and changing them later withset_table_options) and toexamples/reference-guide.ipynbTesting
See docs built from this PR branch at https://caltech-ipac.github.io/firefly_client/pr/82/ (Usage > Displaying Tables and Catalogs, and API reference for
set_table_options).To try it out, check out this branch and run
docs/usage/viewing-tables.ipynbagainst a Firefly server: