Skip to content

Conversation

@gibsongreen
Copy link
Contributor

@gibsongreen gibsongreen commented Oct 16, 2025

Description

This pull request adds the sky centroid column to the catalog search table. When importing from file into the plugin, we require the sky centroid column, but on export, we do not actually store this column, so to enable reingestion this column is added.

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?
  • If new remote data is added that uses MAST, is the URI added to the cache-download.yml workflow?
  • 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 Oct 16, 2025
@gibsongreen gibsongreen added the trivial Only needs one approval instead of two label Oct 16, 2025
@gibsongreen gibsongreen added this to the 4.4.2 milestone Oct 16, 2025
@codecov
Copy link

codecov bot commented Oct 16, 2025

Codecov Report

❌ Patch coverage is 51.61290% with 15 lines in your changes missing coverage. Please review.
✅ Project coverage is 87.59%. Comparing base (5a8dcac) to head (1fdc0d8).
⚠️ Report is 13 commits behind head on main.

Files with missing lines Patch % Lines
jdaviz/configs/imviz/plugins/catalogs/catalogs.py 51.61% 15 Missing ⚠️

❌ Your patch check has failed because the patch coverage (51.61%) is below the target coverage (90.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3841      +/-   ##
==========================================
+ Coverage   86.77%   87.59%   +0.81%     
==========================================
  Files         184      188       +4     
  Lines       25146    25730     +584     
==========================================
+ Hits        21821    22537     +716     
+ Misses       3325     3193     -132     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

why are the RA and Dec columns that already exist not sufficient to reingest? And if we're "rebuilding" a SkyCoord, we probably can't assume icrs, but would need to track that internally.

@gibsongreen
Copy link
Contributor Author

@kecnry my first attempt at this was updating the parser logic to allow Ra/Dec if both columns existed in the file loaded. We do explicitly have the names of the columns and can use that to create the SkyCoord when the search function is actually called. We would need to update the documentation and have an additional logic block where if there isn't a sky_centroid column in the file, the to check for Ra/Dec and construct it. I've already thought through this and have a commit that just needs to be cleaned up if we want to go in this route. I chose this since it was the least amount of code change for the desired result, and that in the docs we currently say we require the sky_centroid column, so it felt more natural if we require it that the table that we create should also have it. Let me know if that's the preferred route and I'll get the commit up ASAP (or update the existing logic without the IRCS assumption)

@kecnry
Copy link
Member

kecnry commented Oct 16, 2025

is this specifically for ingesting back into the (soon-to-be-deprecated) catalogs plugin or into the new catalogs importer?

@gibsongreen
Copy link
Contributor Author

The plugin, this is what @cshanahan1 and I were talking in Slack a bit about, the original bug the ticket was about wasn't reproducible but this one still existed and so trying to find the simplest solution was the goal just to have in working in the meantime

Copy link
Contributor

@cshanahan1 cshanahan1 left a comment

Choose a reason for hiding this comment

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

this fixes the issue in the plugin, looks good!

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.

Can test coverage be added for the roundtrip?

Comment on lines +168 to +169
ra_candidates = ["Right Ascension (degrees)", "ra", "RA"]
dec_candidates = ["Declination (degrees)", "dec", "DEC"]
Copy link
Member

Choose a reason for hiding this comment

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

probably fine for now (I was thinking we could re-use the logic from the catalogs importer, but ultimately that will probably replace this entire plugin soon, so probably not worth generalizing it now)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was thinking the same thing, it could and should be more robust than this but held off on it for now.

Comment on lines +397 to +400
if "Right Ascension (degrees)" in tbl.colnames:
ra = row["Right Ascension (degrees)"]
elif "ra" in tbl.colnames or "RA" in tbl.colnames:
ra = row.get("ra", row.get("RA"))
Copy link
Member

Choose a reason for hiding this comment

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

do we need an else after the elif, or is no other case possible due to logic earlier?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The file parser gets hit first so if that is able to find both the RA and Dec columns we know that the naming convention for the columns is correct at this point.

@gibsongreen
Copy link
Contributor Author

Can test coverage be added for the roundtrip?

Yes I wanted to add a test to boost the codecov coverage but I wanted to make sure we were on the same page about how this should be handled, I'll get that up ASAP.

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 trivial Only needs one approval instead of two

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants