Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Enhance From File catalog loading to support more columns and improve Clear Table functionality #3359
Enhance From File catalog loading to support more columns and improve Clear Table functionality #3359
Changes from 19 commits
2f28144
746d8db
485846e
edf93eb
73aad20
d19de55
5ece13a
3fb6df9
640b615
d7d7439
7799594
a96babd
9dbbeca
b5b4570
670cf31
c2ba76b
0b22f24
04bf999
b1f2277
b8ae09e
dcb5971
289f216
d692f86
7c01d7a
974bee4
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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 does this have to be within
try
? This check should never fail iftable
is successfully read and we already have a blanketexcept
for that. It would only result in a bool.In fact, I think all the
if
after.read
can be after the try-except block. Unless I missed something here?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.
Thank you for catching that! Honestly, I don’t know what I was thinking when I moved those checks inside the try-except block. You’re absolutely right that they belong outside since they’re not handling exceptions from QTable.read. I’ve fixed it now, and I appreciate your sharp eye for detail!
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.
I think it is always a list. No need to recast.
https://github.com/astropy/astropy/blob/53b673bb4fd98da7b8972837a9650469bc130b02/astropy/table/table.py#L2218
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 loaded table has to have a 'sky centroid' column, but it is then broken up into ra and dec, which means when its written back out it cant be read back in because it doesn't have 'sky centroid'. would it be possible to add a check when loading if the table already contains a ra and dec column rather than unpacking sky centroid? as it is, a table written out by the app can not be read back in
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.
Does that problem pre-date this PR? Just wondering if round-tripping is in scope here (e.g., writing it out back as sky centroid as a single column in ECSV format).
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.
export_table
is ultimately called which will treat the theTableMixin
columns as aQTable
jdaviz/jdaviz/core/template_mixin.py
Line 4790 in 48be154
sky_centroid
, you wouldn't be able to read it back in after exporting. This is also true if you try exporting Gaia or SDSS.In the case of 'from file', we already have the
sky_centroid
column, so we could add the sky_centroid column with the same name to our table, export the table, and then the exported file is able to be reloaded into Imviz.The other catalogs options could be added in a follow up effort for either writing the
sky_centroid
column to the loaded catalog table or handle it on export.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.
I was trying to keep it aligned with the other
Search
options, but I didn't think of the export functionality then. Thanks for the additional context, all; I will keep the existingsky_centroid
column in the table.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.
I don't grok why there is "Object ID" and then there is "id" but cleaning that up is out of scope here.
That said, I noticed that "id" here is now
idx + 1
but stilllen(self.table)
on L271 above. Should this inconsistency be addressed in this PR or is this also out of scope?