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

Catalogs plugin results table #2915

Merged
merged 29 commits into from
Jul 16, 2024
Merged

Catalogs plugin results table #2915

merged 29 commits into from
Jul 16, 2024

Conversation

kcarver1
Copy link
Contributor

@kcarver1 kcarver1 commented Jun 12, 2024

Description

This pull request is to add a table of results to the catalogs plugin in Imviz.

Change log entry

  • Is a change log needed? If yes, is it added to 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, maintainer
    should 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.

  • Are two approvals required? Branch protection rule does not check for the second approval. If a second approval is not necessary, please apply the trivial label.
  • Do the proposed changes actually accomplish desired goals? Also manually run the affected example notebooks, if necessary.
  • Do the proposed changes follow the STScI Style Guides?
  • Are tests added/updated as required? If so, do they follow the STScI Style Guides?
  • Are docs added/updated as required? If so, do they follow the STScI Style Guides?
  • Did the CI pass? If not, are the failures related?
  • Is a milestone set? Set this to bugfix milestone if this is a bug fix and needs to be released ASAP; otherwise, set this to the next major release milestone. Bugfix milestone also needs an accompanying backport label.
  • After merge, any internal documentations need updating (e.g., JIRA, Innerspace)?

@github-actions github-actions bot added imviz plugin Label for plugins common to multiple configurations labels Jun 12, 2024
@kcarver1
Copy link
Contributor Author

Here is what the table currently looks like in the UI:
Screenshot 2024-06-25 at 4 49 29 PM

Displaying the table in a new window:
Screenshot 2024-06-25 at 4 49 50 PM

docs/imviz/plugins.rst Outdated Show resolved Hide resolved
Copy link
Member

@kecnry kecnry left a comment

Choose a reason for hiding this comment

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

Happy to see that the diff isn't too big, nice work! Just have a few suggestions from skimming the code and then once they're addressed I'll do some local tests.

There are also a bunch of codestyle failures, if you scroll down to the section below and click "Details" on the "CI / Code style checks (pull_request)" row (see screenshot) you can see the list of them and address them.

image

jdaviz/configs/imviz/plugins/catalogs/catalogs.vue Outdated Show resolved Hide resolved
jdaviz/configs/imviz/plugins/catalogs/catalogs.py Outdated Show resolved Hide resolved
jdaviz/configs/default/plugins/markers/markers.py Outdated Show resolved Hide resolved
jdaviz/configs/imviz/plugins/catalogs/catalogs.py Outdated Show resolved Hide resolved
@javerbukh javerbukh added this to the 4.0 milestone Jul 1, 2024
Copy link
Collaborator

@rosteen rosteen left a comment

Choose a reason for hiding this comment

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

I left one suggestion for the documentation. Additionally, the UI in my testing doesn't seem to be sizing the table and associated elements correctly:

Screenshot 2024-07-01 at 10 12 04 AM Screenshot 2024-07-01 at 10 12 18 AM

You can see in the first screenshot that it's overflowing the space on the left and right, and in the second screenshot when I expand the plugin, some of the words end up overlapping. One of us can help you tweak the .vue file to try to improve this.

docs/imviz/plugins.rst Outdated Show resolved Hide resolved
Katherine Carver and others added 5 commits July 2, 2024 09:52
… twice to show the differences between displaying at the top and bottom. I am unsure of how to fix the issue with the display on the bottom.
@rosteen
Copy link
Collaborator

rosteen commented Jul 5, 2024

The UI looks good now, looks like the failing test is because the table column names in the catalog file are not "ra" and "dec" - I think they're something like "sky_centroid.ra" instead.

@kcarver1
Copy link
Contributor Author

kcarver1 commented Jul 5, 2024

The UI looks good now, looks like the failing test is because the table column names in the catalog file are not "ra" and "dec" - I think they're something like "sky_centroid.ra" instead.

Yes, this works! I pushed those changes. Do you have any ideas on how to also access the object id? I talked to Cami this morning about it and the example catalog she showed me used 'label' but that fails the tests.

@kcarver1
Copy link
Contributor Author

kcarver1 commented Jul 5, 2024

What should happen when a user searches through the SDSS catalog and then tries to search through their own file? Should the table automatically be cleared?

@rosteen
Copy link
Collaborator

rosteen commented Jul 5, 2024

What should happen when a user searches through the SDSS catalog and then tries to search through their own file? Should the table automatically be cleared?

That's a good question. I think my first instinct is to append to the existing table, since there's a clear button if the user does actually want to clear their results.

Edit: athough maybe in that case we would want a "source" column in the table to show where each row came from 🤔

@kecnry
Copy link
Member

kecnry commented Jul 5, 2024

I would say for now the table should do whatever behavior currently exists for the markers so that they relate directly to each other.

Copy link

codecov bot commented Jul 8, 2024

Codecov Report

Attention: Patch coverage is 83.33333% with 3 lines in your changes missing coverage. Please review.

Project coverage is 88.73%. Comparing base (07cc0f3) to head (a662b76).
Report is 187 commits behind head on main.

Files with missing lines Patch % Lines
jdaviz/configs/imviz/plugins/catalogs/catalogs.py 83.33% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2915      +/-   ##
==========================================
- Coverage   88.76%   88.73%   -0.04%     
==========================================
  Files         111      111              
  Lines       17172    17262      +90     
==========================================
+ Hits        15243    15317      +74     
- Misses       1929     1945      +16     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@kecnry kecnry left a comment

Choose a reason for hiding this comment

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

This is looking great! Just two suggestions to consider, but I think they could both be deferred to the follow-up effort if you'd rather.

Comment on lines 217 to 218
# find new to add in a way to append the source id to the table
# 'Object ID': row['label']} ; 'label' is failing tests
Copy link
Member

Choose a reason for hiding this comment

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

you can always do something like:

'Object ID': row.get('label', '')

which will then use the "label" column if it exists, and otherwise will fill that entry with an empty string.

Comment on lines 207 to 218
# adding in coordinates and Source IDs into the catalog table
if self.catalog_selected == "SDSS":
for row in self.app._catalog_source_table:
row_info = {'Right Ascension (degrees)': row['ra'],
'Declination (degrees)': row['dec'],
'Object ID': row['objid']}
self.table.add_item(row_info)

if self.catalog_selected == 'From File...':
for row in self.app._catalog_source_table:
# find new to add in a way to append the source id to the table
# 'Object ID': row['label']} ; 'label' is failing tests
Copy link
Member

Choose a reason for hiding this comment

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

instead of repeating these if-statements, can we move this logic into the previous if/elif statements and reference the object directly instead of having to rely on self.app._catalog_source_table?

Or would SkyCoordTable which is populated for each case and then used for the markers be able to take the object IDs as well, in which case we wouldn't need separate cases at all and would also benefit from being able to act on filtered_skycoord_table in case any entries have been removed (otherwise we'll have to deal with this later when implementing click-to-zoom functionality since some entries might be missing marks)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hey Kyle, I moved the code into the original if/elif statements. Could you further explain what you mean when you say "reference the object directly"? Are you referring to query_region_result?

Copy link
Member

Choose a reason for hiding this comment

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

Awesome thanks! I just meant that you could use skycoord_table and table instead of self.app._catalog_source_table since I'm guessing we'll need to get rid of that eventually, but that really doesn't matter and I can see arguments both ways - feel free to leave it as is now!

Copy link
Collaborator

@rosteen rosteen left a comment

Choose a reason for hiding this comment

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

Looks good to me - you can let my approval stand if you do end up taking Kyle's suggestions and he approves.

Katherine Carver and others added 2 commits July 15, 2024 08:12
Copy link
Member

@kecnry kecnry left a comment

Choose a reason for hiding this comment

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

Looks good to me now - thanks for all your hard work!

@kecnry kecnry changed the title adding changes to catalog Catalogs plugin results table Jul 16, 2024
@kecnry kecnry merged commit 23b3edd into spacetelescope:main Jul 16, 2024
16 of 19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
imviz plugin Label for plugins common to multiple configurations
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants