-
-
Notifications
You must be signed in to change notification settings - Fork 404
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
Refactor astroquery.heasarc to use VO protocols #2997
base: main
Are you sure you want to change the base?
Conversation
Hello @zoghbi-a! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:
Comment last updated at 2025-01-10 21:26:57 UTC |
43e9fe4
to
7f74228
Compare
What is the motivation for this? Are there any datasets that are only accessible using the webform, but not the VO backends? (If the only motivation is to keep what has been here, then it's not necessary, removing everything as part of the refactor is totally fine. Ideally, the old user codes should keep working, but with such a large backend restructure we also have precedence for breaking those) Doing a proper review may take me until I'm back from the interop. |
All the tables should available through the new API, so it is kept in case some people are using it. If it is ok to remove the old class, I don't see a stopper. |
A rename doesn't really solve this scenario, as the continued support would have only worked if the name was kept the same, maybe with a deprecation warning. So, before diving into a review, I would suggest cleaning up the old class. Maybe try to keep as much of the test examples/docs examples working as possible, or maybe working with a deprecation warning (e.g. in case some of the keywords need to be dropped, or renamed). |
The new class implements most of the useful methods of the old class with a deprecation warning. I will then delete the old class and keep the methods and warnings in the new class. |
354384f
to
baf95ed
Compare
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 only leave a WIP review for now, that focuses only on the API, and will try to come back and look into the code itself later, hopefully later this week or next week. I was thinking it's useful to leave what I have for now, than hold it back until I have the time to do the full review.
@bsipocz, is there a timeline for completing the review? |
00af79e
to
b854991
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2997 +/- ##
=======================================
Coverage ? 67.60%
=======================================
Files ? 229
Lines ? 18473
Branches ? 0
=======================================
Hits ? 12489
Misses ? 5984
Partials ? 0 ☔ View full report in Codecov by Sentry. |
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 did an airport review, thus couldn't run the remote tests and their coverage.
Neither was building the documentation, but what I have noticed that it is full of both code and text typos, so please have a careful look at it.
The module itself looks reasonably good, my primary comments are the same I already left in the summer, namely it would be great if methods and arg names could be more similar to those already existing in some of the modules (e.g. avoid using table
as a kwarg as it leads to either confusion or code mistakes.
VO_URL = conf.VO_URL | ||
TAR_URL = conf.TAR_URL | ||
S3_BUCKET = conf.S3_BUCKET |
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.
Do we need these here, or the properties could pick them up? (like we do in alma
or the other modules that use pyvo based tap?)
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.
Are you suggesting that these should not be configurable but rather as fixed variables?
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 am inclined to leave it like this as it helps with testing staging and test servers.
5ecfa95
to
717ba57
Compare
560a2ad
to
1ce3523
Compare
1ce3523: rebasing to pick the latest changes in main and squashing all the changes. |
42ae40c
to
dba6380
Compare
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.
There are a lot of minor comments mostly focusing on consistency, and fixing a couple of typos in the docs, too. Please try to clean them up.
More importantly, I see 26 remote tests and doctest failures, those should be fixed before merging.
self._meta_info = self._meta_info[self._meta_info['value'] > 0] | ||
return self._meta_info | ||
|
||
def _get_default_columns(self, catalog_name): |
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.
Make get_default_columns
and get_default_radius
consistent, either both private or public depending on whether the end user is expected to use it, but not one of each
|
||
if url is None: | ||
url = conf.server | ||
def set_session(self, session): |
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.
make it private then? If it's not something the end user should do routinely then better to be tucked away a bit.
|
||
Return | ||
------ | ||
a list of column names |
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.
language nitpicking: The returned output is not a list but a column. Please update the docstring (really, just dropping 'list' is enough, as it can be misleading for someone to expect a python list. Do it here and in the description above, too)
(self._meta['table'] == catalog_name) | ||
& (self._meta['par'] == '') | ||
] | ||
radius = np.double(meta['value'][0]) * u.arcmin |
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 using np.double here and not e.g. np.float
instead?
""" | ||
return self.list_catalogs(master=False) | ||
|
||
def list_columns(self, catalog_name, full=False): |
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 have both get_default_columns
and this list_columns
methods, practically the default behaviour here could be what get_default_columns is atm, and another keyword could add the more detailed version with the description and unit columns.
The capabilities are currently very limited ... feature requests and contributions welcome! | ||
There main interface for the Heasarc services``heasarc.Heasac`` now uses | ||
Virtual Observatory protocols with the Xamin interface, which offers | ||
more powerful search options than the old Browse interface. |
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.
this still stands, no need to mention the old ways, but at least fix the language.
NGC_3783 60902005 174.7571 -37.7385 | ||
|
||
To query a region around some position, specifying the search radius, | ||
we use `~~astropy.units.Quantity`: |
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.
we use `~~astropy.units.Quantity`: | |
we use `~astropy.units.Quantity`: |
|
||
If no radius value is given, a default that is appropriate | ||
for each catalog is used. You can see the value of the default | ||
radius values by calling `~~astroquery.heasarc.HeasarcClass.get_default_radius`, |
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.
radius values by calling `~~astroquery.heasarc.HeasarcClass.get_default_radius`, | |
radius values by calling `~astroquery.heasarc.HeasarcClass.get_default_radius`, |
passing the name of the catalog. | ||
|
||
The list of returned columns can also be given as a comma-separated string to | ||
`~~astroquery.heasarc.HeasarcClass.query_region`: |
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.
`~~astroquery.heasarc.HeasarcClass.query_region`: | |
`~astroquery.heasarc.HeasarcClass.query_region`: |
13008 1RXS J075526.1+391111 55536.6453587963 Liu 1.4842785992883953 | ||
|
||
If no columns are given, the call will return a set of default columns. | ||
If you want all the columns returned, use ``columns='*'``` |
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.
If you want all the columns returned, use ``columns='*'``` | |
If you want all the columns returned, use ``columns='*'`` |
This a major refactor of the
heasarc
module to use the VO interface to the archive. The main motivation is:The main changes inlcude:
The old class has been renamedHeasarcClass
->HeasarcBrowseClass
. The initialized instance is also renameHeasarc
->HeasarcBrowse
. The same for the test files.HeasarcClass
has been removed, and its main methods are included in the class with a deprecation message.HeasarcClass
class uses an interface similar to those used in other modules e.g. ipac.irsa.