-
-
Notifications
You must be signed in to change notification settings - Fork 400
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: refactor to use TAP #2954
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
01a826c
to
6b01523
Compare
This comment was marked as outdated.
This comment was marked as outdated.
52edbf9
to
535ddfc
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2954 +/- ##
==========================================
+ Coverage 67.17% 67.52% +0.34%
==========================================
Files 231 233 +2
Lines 18247 18224 -23
==========================================
+ Hits 12258 12305 +47
+ Misses 5989 5919 -70 ☔ View full report in Codecov by Sentry. |
1fde941
to
e5563ad
Compare
This comment was marked as outdated.
This comment was marked as outdated.
This won't make the cut for 0.4.7, and after that one is out I'm planning to bump the minimum required versions (at least to astropy 5.0, but maybe even something newer), so no need to do workaround for support for old versions. |
We enforce W504 and ignore W503 as break before operator is a bit more legible logic. |
befe1c5
to
585b93d
Compare
585b93d
to
90480f7
Compare
Hello! I'm almost in a un-draft state :) Here are the remaining points that I'm unsure about:
|
d79cddc
to
5ca38bc
Compare
Sorry for the delay in responding:
Next release, 0.4.8. At some point I'll refactor the versioning and related infrastructure, but don't have an ETA when it happens.
I suspect this also run into the same pyvo related RTD failure and was unrelated to your changes. |
Switching back to draft, I'm tweaking a bit the support of the legacy 'query_criteria' |
d3981a5
to
aaf9c5b
Compare
and move from os to pathlib
this commit also adds a patch to simbad's query_objects in the tests
simbad calls lru_cache from python core library, so no cache_location
Co-authored-by: Adam Ginsburg <[email protected]>
This was not tested remotely. And for now, this is extremely slow. Thus, the remote test for the wildcards in 'query_objects' is skipped except if SKIP_SLOW is set to False. On the other hand, when there is no wildcard in 'query_objects' there is a way faster method (join the small table on the left). So this PR also implements this. To use this faster method, the 'construct_query' had to become a bit general and now accepts a 'from_table' argument that defaults to 'basic'.
Co-authored-by: Brigitta Sipőcz <[email protected]>
Hi astroquery,
List of changes:
Adding criteria
Formerly, there was only one way to enter criteria on the output, and it was the
query_criteria
method.This method is now deprecated, and works on a 'reproduce at the best of our capabilities but cannot garantie that everything will work' basis.
But it is replaced by a new
criteria
argument in everyquery_***
method (exceptquery_tap
because people can directly write that into their ADQL string).This new interface looks like this:
Where the criteria string can be translated from the old syntax to the new one with the helper class:
On the output
Adding columns to the output
Some 'votable_fields' options have changed. The old ones should still work and raise a warning indicating the new name in the TAP interface.
That'd look like this:
Every other possibility can be listed with:
(note that the number of possible options went from 107 to 97, among with 12 tables that really don't exist in Simbad since years. So the possibilities are now slightly bigger 🙂 )
Changes in output style
All these could be hidden to the users by modifying the output table in query_tap on python side. Is it worth it?
Empty result
Empty result is valid in TAP. So the default
ROW_LIMIT
could not stay at zero to mean infinity. I copied VizieR module API and went with -1.It also means that a query with no answer returns an empty table and not None like before. This broke JWST module testing, so this PR also has some changes here. Should not break anything, but I'm not an expert of their module.
Caching
Caching in the simbad module is now handled by python built-in
lru_cache
. This might be reverted if we add a caching mechanism to BaseVOQuery (something that'd keep things in a votable-xml format in the default astroquery cache folder maybe?). But I did not go all this way yet.Changes to query_*** methods (except the criteria argument covered above)
Query_object
The
script number ID
inquery_object
is replaced bymatched_id
that contains the ID that corresponded to the wildcard expression.It looks like this:
Query_objects
It now has a
user_specified_id
column as requested in #967 . Theobject_number_id
replacesscript_number_id
(but this could be reverted, it's just strange as there is really one script so I took the liberty to change it)Looks like this:
Note that the requested feature (I could not find the issue anymore, so maybe it's a complaint we received directly in CDS) that objects not found would return an empty line is there: M503 obviously does not exist.
Query_bibcode
The output is very different.
Former output:
New output:
I know it's a very different output but I really hated the former one. I can try to reproduce the old one but☹️
Also, it is now possible to retrieve the abstract with
abstract=True
.Query_region, query_catalog, query_bibobj, query_object_ids
No big changes
In JWST
As Simbad is used in the tests, I just patched what I could how I could, may not be the prettiest way to go :/
Also, now an empty response returns an empty table and not None, so I reflected that in jwst
core.py
.Issues linked to this PR
Fixes: #2198
Fixes: #1468
Fixes: #2041
Partially: #967 (It is done for query_objects, but not for query_region yet)
closes: #2292