New hyperleda service 298#2023
Conversation
|
Hello @iskren-y-g! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found: There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻 Comment last updated at 2021-03-22 17:44:46 UTC |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #2023 +/- ##
==========================================
+ Coverage 64.33% 67.03% +2.69%
==========================================
Files 130 416 +286
Lines 16836 27300 +10464
==========================================
+ Hits 10832 18300 +7468
- Misses 6004 9000 +2996 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Thanks for the contribution! @low-sky, since you requested this long long ago, are you interested in reviewing this PR (or at least testing it out)? |
keflavich
left a comment
There was a problem hiding this comment.
This is a great contribution, thanks! And, sorry there was a bit of delay in reviewing - I'm always backlogged.
I've left several style and cleanup requests. I believe this is actually in working order and can be merged after a bit of cleanup though. Nice work!
|
|
||
| # Based on: https://astroquery.readthedocs.io/en/latest/template.html | ||
|
|
||
| # Imports organized as shown below |
There was a problem hiding this comment.
Could you remove these various comments that are part of the template/tutorial?
|
|
||
| param_str = str(param_lst) | ||
| param_str = param_str[2:param_str.rfind('\'')] | ||
| param_str = param_str.replace('\', \'', ',') |
There was a problem hiding this comment.
this might be more readable as:
| param_str = param_str.replace('\', \'', ',') | |
| param_str = param_str.replace("', '", ',') |
| param_lst.remove(param) | ||
|
|
||
| param_str = str(param_lst) | ||
| param_str = param_str[2:param_str.rfind('\'')] |
There was a problem hiding this comment.
| param_str = param_str[2:param_str.rfind('\'')] | |
| param_str = param_str[2:param_str.rfind("'")] |
| >>> result_table = hyperleda.query_object(obj_name = 'UGC12591', | ||
| properties = 'objname,type,logr25, | ||
| btc,v,modbest,al2000,de2000, | ||
| celposJ(pgc)') |
There was a problem hiding this comment.
Minor whitespace suggestion:
| >>> result_table = hyperleda.query_object(obj_name = 'UGC12591', | |
| properties = 'objname,type,logr25, | |
| btc,v,modbest,al2000,de2000, | |
| celposJ(pgc)') | |
| >>> result_table = hyperleda.query_object(obj_name='UGC12591', | |
| properties='objname,type,logr25, | |
| btc, v, modbest, al2000, de2000, | |
| celposJ(pgc)') |
| request_payload = dict(n='meandata', c='o', of='1,leda,simbad', | ||
| nra='l', nakd='1', | ||
| d='{:}'.format(param_str), | ||
| sql='{:}'.format(ls_SQL_search), ob='', | ||
| a='csv[|]') | ||
| response = self._request("GET", url_http_request, | ||
| params=request_payload) | ||
| sql_result_tbl = Table.read(response.url, format='ascii', delimiter='|') |
There was a problem hiding this comment.
this code looks like it repeats query_sql below. Why not just return self.query_sql(search=ls_SQL_search, properties=properties)?
| # the default tool for users to interact with is an instance of the Class | ||
| hyperleda = HyperLEDAClass() | ||
|
|
||
| # once your class is done, tests should be written | ||
| # See ./tests for examples on this | ||
|
|
||
| # Next you should write the docs in astroquery/docs/module_name | ||
| # using Sphinx. |
There was a problem hiding this comment.
remove the comments, and the capitalization should match that used in other modules (e.g., from astroquery.vizier import Vizier)
| # the default tool for users to interact with is an instance of the Class | |
| hyperleda = HyperLEDAClass() | |
| # once your class is done, tests should be written | |
| # See ./tests for examples on this | |
| # Next you should write the docs in astroquery/docs/module_name | |
| # using Sphinx. | |
| HyperLEDA = HyperLEDAClass() |
| --------------- | ||
|
|
||
| This module can be used to query from the HyperLEDA web service. The | ||
| queries will return the resultsin an astropy Table. Below are two |
There was a problem hiding this comment.
| queries will return the resultsin an astropy Table. Below are two | |
| queries will return the results in an astropy Table. Below are two |
| object,or using an SQL query request to the HyperLEDA SQL data access | ||
| service. | ||
|
|
||
| -------------- |
There was a problem hiding this comment.
| -------------- |
|
|
||
| Query the object by name. For instance if you want to query UGC 1259 | ||
|
|
||
| .. code:: ipython3 |
There was a problem hiding this comment.
I think this is generic python and therefore should be just python
| .. code:: ipython3 | |
| .. code:: python |
| celposJ(pgc) string -- Return the J2000 celestial position of object "pgc" in sexagesimal format | ||
|
|
||
|
|
||
| -------------- |
There was a problem hiding this comment.
I don't think these -----'s separating sections are allowed? I'm not actually sure; how are they supposed to render?
|
Also, could you add a changelog entry? |
Hi all,
I am not sure if there has been any interest/progress on this, but since I already worked on this for my own projects, I decided to prepare a new class to query from HyperLEDA in relation to [#298].
I have followed closely the astropy's guidelines as well as the astroquery's template module to prepare the module and simple tests to match the astroquery API. I also placed a doc example in astroquery/docs/hyperleda/
All tests passed here, so, I hope it is in a decent shape for a review.