-
Notifications
You must be signed in to change notification settings - Fork 74
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
Add functionality to load catalogs from a file #3359
base: main
Are you sure you want to change the base?
Add functionality to load catalogs from a file #3359
Conversation
|
||
elif isinstance(item, (np.float32, np.float64)): | ||
return float(item) | ||
elif isinstance(item, u.Quantity): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This way we lost the unit info, is that important?
Also I wonder if we can take advantage of the JsonCsutomEncoder that astropy already has for some of these: https://github.com/astropy/astropy/blob/93b6f551b9ed00c4a422b754eae0261f1a7552c9/astropy/utils/misc.py#L366
assert imviz_helper.viewers['imviz-0']._obj.state.x_max == 958.38461 | ||
assert imviz_helper.viewers['imviz-0']._obj.state.y_min == 278.86265 | ||
assert imviz_helper.viewers['imviz-0']._obj.state.y_max == 378.8691 | ||
assert imviz_helper.viewers['imviz-0']._obj.state.x_min == 1022.5631800000001 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did the test results change?
CHANGES.rst
Outdated
@@ -21,6 +21,8 @@ Imviz | |||
- Catalog Search plugin now exposes a maximum sources limit for all catalogs and resolves an edge case | |||
when loading a catalog from a file that only contains one source. [#3337] | |||
|
|||
- Catalog Search plugin now supports loading catalog data directly from files. [#3359] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we clarify somehow that this adds support for the additional columns (otherwise I worry we might get confused that this is when support for loading from file was first introduced at all)?
We should also probably add a section in user docs to document exactly what format of such file the plugin can actually ingest? |
Already exists and probably still relevant: https://jdaviz.readthedocs.io/en/latest/imviz/plugins.html#catalog-search. Any specific changes you think are needed? |
Re: doc -- OK I was confused by the title of PR and change log. Nvm |
@@ -88,13 +89,15 @@ def __init__(self, *args, **kwargs): | |||
def _file_parser(path): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The docs say that the label
column must exist, but we don't actually enforce that so you are able to load with just the sky_centroid
column. This results in the Object ID
column = N/A, so I think we should add a condition here so we make sure that column also exists.
Description
This pull request introduces:
Catalog Loading from File:
- Users can now load catalog data (e.g., .ecsv files) directly into the table.
Improved Clear Table Functionality:
- The "Clear Table" button now clears the table, removes markers, and resets selected rows in the viewer.
Screen.Recording.2024-12-15.at.10.42.00.PM.mov
Fixes #
Change log entry
CHANGES.rst
? If you want to avoid merge conflicts,list the proposed change log here for review and add to
CHANGES.rst
before merge. If no, maintainershould add a
no-changelog-entry-needed
label.Checklist for package maintainer(s)
This checklist is meant to remind the package maintainer(s) who will review this pull request of some common things to look for. This list is not exhaustive.
trivial
label.