Skip to content

Add query_regions to esa.hsa#2362

Merged
bsipocz merged 6 commits into
astropy:mainfrom
keflavich:query_regions_hsa
Apr 19, 2022
Merged

Add query_regions to esa.hsa#2362
bsipocz merged 6 commits into
astropy:mainfrom
keflavich:query_regions_hsa

Conversation

@keflavich

Copy link
Copy Markdown
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.

@keflavich keflavich requested a review from lvalerom April 15, 2022 20:02
@pep8speaks

pep8speaks commented Apr 15, 2022

Copy link
Copy Markdown

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

@lvalerom lvalerom left a comment

Copy link
Copy Markdown
Member

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)

Comment thread astroquery/esa/hsa/core.py Outdated
Comment thread astroquery/esa/hsa/core.py Outdated
Co-authored-by: Luis Valero Martín <lvaleromartin@gmail.com>
@keflavich

Copy link
Copy Markdown
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

codecov Bot commented Apr 16, 2022

Copy link
Copy Markdown

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`
Comment thread docs/esa/hsa.rst Outdated
7. Query Region
---------------

.. doctest-skip::

Copy link
Copy Markdown
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

bsipocz commented Apr 19, 2022

Copy link
Copy Markdown
Member

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.

4 participants