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

Add query_regions to esa.hsa #2362

Merged
merged 6 commits into from
Apr 19, 2022
Merged

Conversation

keflavich
Copy link
Contributor

The ESA HSA tool should have a query_regions tool to match it to the general astroquery API. This is my suggestion for how to do that.

It also passes on some kwargs that could be useful.

@pep8speaks
Copy link

pep8speaks commented Apr 15, 2022

Hello @keflavich! 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 2022-04-19 16:01:41 UTC

@bsipocz bsipocz added this to the v0.4.7 milestone Apr 15, 2022
Copy link
Member

@lvalerom lvalerom left a comment

Choose a reason for hiding this comment

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

Looks good to me. I would add a test case for the new function in hsa_test.py:

def test_query_region(self):
    c = SkyCoord(ra=100.2417*u.degree, dec=9.895*u.degree, frame='icrs')
    parameters = {'coordinate': c,
                  'radius': 0.5}
    dummyTapHandler = DummyHSATapHandler("query_region", parameters)
    hsa = HSAClass(self.get_dummy_tap_handler())
    hsa.query_region(**parameters)
    dummyTapHandler.check_call("query_region", parameters)

astroquery/esa/hsa/core.py Outdated Show resolved Hide resolved
astroquery/esa/hsa/core.py Outdated Show resolved Hide resolved
Co-authored-by: Luis Valero Martín <lvaleromartin@gmail.com>
@keflavich
Copy link
Contributor Author

@lvalerom you can submit your suggested change as a PR onto this one. That's the best way to make sure you get credit for those code changes. Your suggestions are all good.

@codecov
Copy link

codecov bot commented Apr 16, 2022

Codecov Report

Merging #2362 (115b0aa) into main (9143453) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main    #2362   +/-   ##
=======================================
  Coverage   63.17%   63.17%           
=======================================
  Files         132      132           
  Lines       17187    17189    +2     
=======================================
+ Hits        10858    10860    +2     
  Misses       6329     6329           
Impacted Files Coverage Δ
astroquery/esa/hsa/core.py 36.55% <100.00%> (+0.88%) ⬆️

📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more

Add test and documentation to `query_region`
docs/esa/hsa.rst Outdated
7. Query Region
---------------

.. doctest-skip::
Copy link
Member

Choose a reason for hiding this comment

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

I would like to have actual tests for this, either in the doc here, or as remote tests, or both

@bsipocz
Copy link
Member

bsipocz commented Apr 19, 2022

OK, so including the narrative docs we have a decent 84% coverage including the query_region/observations methods, so I go ahead and merge this now.

Thank you both!

@bsipocz bsipocz merged commit fac66a1 into astropy:main Apr 19, 2022
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.

None yet

4 participants