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

[SIMBAD] Add filter names as possible votable fields #3052

Merged
merged 2 commits into from
Jun 27, 2024

Conversation

ManonMarchand
Copy link
Member

I'd like to tweak a bit the way I handled the fluxes votable fields deprecations in the SIMBAD rework.

In the current version, this:

from astroquery.simbad import Simbad
simbad = Simbad()
simbad.add_votable_fields("flux(u)")

works with a warning that does not say how this should be replaced.

This PR adds new votable fields for the SIMBAD's filters. And thus we can provide a clearer warning that points to this new replacement. This uses the allfluxes table from SIMBAD's relational schema (http://simbad.cds.unistra.fr/simbad/tap/tapsearch.html) that only contains the magnitude value.

There is also a clearer error message for the deprecated flux_**() votable fields that were falling in the generic error message for unknown fields. There is now a message that says that the replacement is the votable field flux which adds the whole flux table with every information covered by these former votable fields.


In addition, the allfluxes votable field was broken

from astroquery.simbad import Simbad
simbad = Simbad()
simbad.add_votable_fields("allfluxes")

would make every query fail because the names of the columns are casefolded while this table is an exception in the database and is case-sensitive. This is fixed in this PR.

Copy link
Contributor

@keflavich keflavich left a comment

Choose a reason for hiding this comment

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

This change looks great to me. Thanks for your detailed attention to the user experience! It's especially good to see users no longer being asked to write SQL.

@bsipocz bsipocz added this to the v0.4.8 milestone Jun 26, 2024
@bsipocz bsipocz added the simbad label Jun 26, 2024
Copy link
Member

@bsipocz bsipocz left a comment

Choose a reason for hiding this comment

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

Looks all good pending a minor clarification. I don't think that changelog is required as the VO backend refactoring hasn't yet been released yet.


- "column of basic": a column of the basic table. There fields can also be explored with
`~astroquery.simbad.SimbadClass.list_columns`.
- "table": a table other than basic that has a declared direct join
- "bundle of basic columns": a pre-selected bundle of columns of basic. Ex: "parallax" will add all
columns relevant to parallax
- "filter": a filter name
Copy link
Member

Choose a reason for hiding this comment

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

maybe rephrase the description to make sure it's clear that filter is for an optical filter rather than a VO/any other computing filtering expression. I expected the latter :)

(maybe if possible, then rename it to filter name? that would make it unambiguous)

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah sure! Did not think about that ^^
This is renamed (and I also tried to make it a bit clearer in the documentation)

@bsipocz bsipocz merged commit 1be9420 into astropy:main Jun 27, 2024
8 checks passed
@bsipocz
Copy link
Member

bsipocz commented Jun 27, 2024

Thanks!

@ManonMarchand ManonMarchand deleted the fix-add-votable-fields-fluxes branch October 18, 2024 07:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants