Skip to content

Commit 87fb8f1

Browse files
committed
Refactor: Fix esa where changes to utils breaks esa
1 parent 87c7fc7 commit 87fb8f1

File tree

4 files changed

+15
-15
lines changed

4 files changed

+15
-15
lines changed

astroquery/esa/hubble/core.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ def download_product(self, observation_id, *, calibration_level=None,
105105
params["PRODUCTTYPE"] = product_type
106106

107107
filename = self._get_product_filename(product_type, filename)
108-
self._tap.load_data(params, filename, verbose=verbose)
108+
self._tap.load_data(params_dict=params, output_file=filename, verbose=verbose)
109109

110110
return filename
111111

@@ -254,7 +254,7 @@ def get_artifact(self, artifact_id, *, filename=None, verbose=False):
254254
if filename is None:
255255
filename = artifact_id
256256

257-
self._tap.load_data(params, filename, verbose=verbose)
257+
self._tap.load_data(params_dict=params, output_file=filename, verbose=verbose)
258258

259259
return filename
260260

@@ -302,7 +302,7 @@ def get_postcard(self, observation_id, *, calibration_level="RAW",
302302
if filename is None:
303303
filename = observation_id
304304

305-
self._tap.load_data(params, filename, verbose=verbose)
305+
self._tap.load_data(params_dict=params, output_file=filename, verbose=verbose)
306306

307307
return filename
308308

@@ -505,7 +505,7 @@ def _query_tap_target(self, target):
505505
subContext = conf.EHST_TARGET_ACTION
506506
connHandler = self._tap._TapPlus__getconnhandler()
507507
data = urlencode(params)
508-
target_response = connHandler.execute_secure(subContext, data, True)
508+
target_response = connHandler.execute_secure(subContext, data, verbose=True)
509509
for line in target_response:
510510
target_result = json.loads(line.decode("utf-8"))
511511
if target_result['objects']:
@@ -763,7 +763,7 @@ def get_status_messages(self):
763763
try:
764764
subContext = conf.EHST_MESSAGES
765765
connHandler = self._tap._TapPlus__getconnhandler()
766-
response = connHandler.execute_tapget(subContext, False)
766+
response = connHandler.execute_tapget(subContext, verbose=False)
767767
if response.status == 200:
768768
for line in response:
769769
string_message = line.decode("utf-8")

astroquery/esa/jwst/core.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,9 @@ def load_tables(self, *, only_names=False, include_shared_tables=False,
9393
-------
9494
A list of table objects
9595
"""
96-
return self.__jwsttap.load_tables(only_names,
97-
include_shared_tables,
98-
verbose)
96+
return self.__jwsttap.load_tables(only_names=only_names,
97+
include_shared_tables=include_shared_tables,
98+
verbose=verbose)
9999

100100
def load_table(self, table, *, verbose=False):
101101
"""Loads the specified table
@@ -112,7 +112,7 @@ def load_table(self, table, *, verbose=False):
112112
-------
113113
A table object
114114
"""
115-
return self.__jwsttap.load_table(table, verbose)
115+
return self.__jwsttap.load_table(table, verbose=verbose)
116116

117117
def launch_job(self, query, *, name=None, output_file=None,
118118
output_format="votable", verbose=False, dump_to_file=False,
@@ -686,7 +686,7 @@ def get_status_messages(self):
686686
try:
687687
subContext = conf.JWST_MESSAGES
688688
connHandler = self.__jwsttap._TapPlus__getconnhandler()
689-
response = connHandler.execute_tapget(subContext, False)
689+
response = connHandler.execute_tapget(subContext, verbose=False)
690690
if response.status == 200:
691691
for line in response:
692692
string_message = line.decode("utf-8")

astroquery/esa/jwst/tests/test_jwsttap.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ def test_list_async_jobs(self):
231231

232232
def test_query_region(self):
233233
connHandler = DummyConnHandler()
234-
tapplus = TapPlus("http://test:1111/tap", connhandler=connHandler)
234+
tapplus = TapPlus(url="http://test:1111/tap", connhandler=connHandler)
235235
tap = JwstClass(tap_plus_handler=tapplus, show_messages=False)
236236

237237
# Launch response: we use default response because the
@@ -364,7 +364,7 @@ def test_query_region(self):
364364

365365
def test_query_region_async(self):
366366
connHandler = DummyConnHandler()
367-
tapplus = TapPlus("http://test:1111/tap", connhandler=connHandler)
367+
tapplus = TapPlus(url="http://test:1111/tap", connhandler=connHandler)
368368
tap = JwstClass(tap_plus_handler=tapplus, show_messages=False)
369369
jobid = '12345'
370370
# Launch response
@@ -436,7 +436,7 @@ def test_query_region_async(self):
436436

437437
def test_cone_search_sync(self):
438438
connHandler = DummyConnHandler()
439-
tapplus = TapPlus("http://test:1111/tap", connhandler=connHandler)
439+
tapplus = TapPlus(url="http://test:1111/tap", connhandler=connHandler)
440440
tap = JwstClass(tap_plus_handler=tapplus, show_messages=False)
441441
# Launch response: we use default response because the
442442
# query contains decimals
@@ -521,7 +521,7 @@ def test_cone_search_sync(self):
521521

522522
def test_cone_search_async(self):
523523
connHandler = DummyConnHandler()
524-
tapplus = TapPlus("http://test:1111/tap", connhandler=connHandler)
524+
tapplus = TapPlus(url="http://test:1111/tap", connhandler=connHandler)
525525
tap = JwstClass(tap_plus_handler=tapplus, show_messages=False)
526526
jobid = '12345'
527527
# Launch response

docs/esa/hubble/hubble.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ This third case will download the science files associated to the observation 'j
8282

8383
>>> from astroquery.esa.hubble import ESAHubble
8484
>>> esahubble = ESAHubble()
85-
>>> esahubble.get_postcard(observation_id="j6fl25s4q", calibration_level="RAW", resolution=256, filename="raw_postcard_for_j6fl25s4q.jpg") # doctest: +IGNORE_OUTPUT
85+
>>> esahubble.get_postcard("j6fl25s4q", calibration_level="RAW", resolution=256, filename="raw_postcard_for_j6fl25s4q.jpg") # doctest: +IGNORE_OUTPUT
8686

8787
This will download the postcard for the observation 'J8VP03010' with low
8888
resolution (256) and it will stored in a jpg called

0 commit comments

Comments
 (0)