Skip to content

Commit 654b84c

Browse files
author
jespinosa
committed
Minor issues resolved
1 parent 0b8c364 commit 654b84c

File tree

2 files changed

+12
-16
lines changed

2 files changed

+12
-16
lines changed

astroquery/esa/hubble/core.py

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,7 @@ def download_product(self, observation_id, *, calibration_level=None,
102102
params["CALIBRATION_LEVEL"] = calibration_level
103103
url += "&CALIBRATION_LEVEL=" + calibration_level
104104

105-
if "product_type" in kwargs:
106-
product_type = kwargs["product_type"]
105+
if product_type:
107106
self.__validate_product_type(product_type)
108107
params["RETRIEVAL_TYPE"] = product_type
109108
filename = self._get_product_filename(product_type, filename)
@@ -219,18 +218,18 @@ def get_postcard(self, observation_id, calibration_level="RAW",
219218

220219
shutil.move(response, filename)
221220

222-
def cone_search(self, coordinates, radius=0.0, filename=None,
223-
output_format='votable', async_job=False,
224-
cache=True, verbose=False):
221+
def cone_search(self, coordinates, radius, filename=None,
222+
output_format='votable', cache=True,
223+
async_job=False, verbose=False):
225224
"""
226225
To execute a cone search defined by a coordinate and a radius
227226
228227
Parameters
229228
----------
229+
radius : float
230+
radius in arcmin of the cone_search
230231
coordinates : astropy.coordinate, mandatory
231232
coordinates of the center in the cone search
232-
radius : float, default 0
233-
radius in arcmin of the cone_search
234233
filename : str, default None
235234
Path and name of the file to store the results.
236235
If the filename is defined, the file will be
@@ -285,8 +284,8 @@ def cone_search(self, coordinates, radius=0.0, filename=None,
285284
verbose=verbose)
286285
return table
287286

288-
def cone_search_criteria(self, target=None, coordinates=None,
289-
radius=0.0,
287+
def cone_search_criteria(self, radius, target=None,
288+
coordinates=None,
290289
calibration_level=None,
291290
data_product_type=None,
292291
intent=None,
@@ -308,12 +307,12 @@ def cone_search_criteria(self, target=None, coordinates=None,
308307
309308
Parameters
310309
----------
310+
radius : float
311+
radius in arcmin of the cone_search
311312
target : str, mandatory if no coordinates is provided
312313
name of the target, that will act as center in the cone search
313314
coordinates : astropy.coordinate, mandatory if no target is provided
314315
coordinates of the center in the cone search
315-
radius : float, default 0
316-
radius in arcmin of the cone_search
317316
calibration_level : str or int, optional
318317
The identifier of the data reduction/processing applied to the
319318
data. RAW (1), CALIBRATED (2), PRODUCT (3) or AUXILIARY (0)

astroquery/esa/hubble/tests/test_esa_hubble.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def get_mockreturn(method, request, url, params, *args, **kwargs):
4242
def ehst_request(request):
4343
try:
4444
mp = request.getfixturevalue("monkeypatch")
45-
except AttributeError: # pytest < 3
45+
except AttributeError:
4646
mp = request.getfuncargvalue("monkeypatch")
4747
mp.setattr(ESAHubbleClass, '_request', get_mockreturn)
4848
return mp
@@ -59,10 +59,7 @@ def get_cone_mockreturn(method, request, url, params, *args, **kwargs):
5959

6060
@pytest.fixture(autouse=True)
6161
def ehst_cone_search(request):
62-
try:
63-
mp = request.getfixturevalue("monkeypatch")
64-
except AttributeError: # pytest < 3
65-
mp = request.getfuncargvalue("monkeypatch")
62+
mp = request.getfixturevalue("monkeypatch")
6663
mp.setattr(ESAHubbleClass, 'cone_search', get_cone_mockreturn)
6764
return mp
6865

0 commit comments

Comments
 (0)