Skip to content

Commit 1b1670a

Browse files
nkphysicsbsipocz
authored andcommitted
Refactor: Made ibe kwargs keyword only
1 parent 671b0c5 commit 1b1670a

File tree

3 files changed

+17
-17
lines changed

3 files changed

+17
-17
lines changed

astroquery/ipac/irsa/ibe/core.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ class IbeClass(BaseQuery):
3030
TABLE = conf.table
3131
TIMEOUT = conf.timeout
3232

33-
def query_region(self, coordinate=None, where=None, mission=None, dataset=None,
34-
table=None, columns=None, width=None, height=None,
35-
intersect='OVERLAPS', most_centered=False):
33+
def query_region(self, *, coordinate=None, where=None, mission=None,
34+
dataset=None, table=None, columns=None, width=None,
35+
height=None, intersect='OVERLAPS', most_centered=False):
3636
"""
3737
For certain missions, this function can be used to search for image and
3838
catalog files based on a point, a box (bounded by great circles) and/or
@@ -106,7 +106,7 @@ def query_region(self, coordinate=None, where=None, mission=None, dataset=None,
106106

107107
return Table.read(response.text, format='ipac', guess=False)
108108

109-
def query_region_sia(self, coordinate=None, mission=None,
109+
def query_region_sia(self, *, coordinate=None, mission=None,
110110
dataset=None, table=None, width=None,
111111
height=None, intersect='OVERLAPS',
112112
most_centered=False):
@@ -126,7 +126,7 @@ def query_region_sia(self, coordinate=None, mission=None,
126126
return commons.parse_votable(
127127
response.text).get_first_table().to_table()
128128

129-
def query_region_async(self, coordinate=None, where=None, mission=None, dataset=None,
129+
def query_region_async(self, *, coordinate=None, where=None, mission=None, dataset=None,
130130
table=None, columns=None, width=None, height=None,
131131
action='search', intersect='OVERLAPS', most_centered=False):
132132
"""
@@ -251,7 +251,7 @@ def query_region_async(self, coordinate=None, where=None, mission=None, dataset=
251251

252252
return self._request('GET', url, args, timeout=self.TIMEOUT)
253253

254-
def list_missions(self, cache=True):
254+
def list_missions(self, *, cache=True):
255255
"""
256256
Return a list of the available missions
257257
@@ -277,7 +277,7 @@ def list_missions(self, cache=True):
277277

278278
return missions
279279

280-
def list_datasets(self, mission=None, cache=True):
280+
def list_datasets(self, *, mission=None, cache=True):
281281
"""
282282
For a given mission, list the available datasets
283283
@@ -314,7 +314,7 @@ def list_datasets(self, mission=None, cache=True):
314314

315315
return datasets
316316

317-
def list_tables(self, mission=None, dataset=None, cache=True):
317+
def list_tables(self, *, mission=None, dataset=None, cache=True):
318318
"""
319319
For a given mission and dataset (see
320320
`~astroquery.ipac.irsa.ibe.IbeClass.list_missions`,
@@ -348,11 +348,11 @@ def list_tables(self, mission=None, dataset=None, cache=True):
348348
"Must be one of: {1}"
349349
.format(mission, self.list_missions()))
350350

351-
if dataset not in self.list_datasets(mission, cache=cache):
351+
if dataset not in self.list_datasets(mission=mission, cache=cache):
352352
raise ValueError("Invalid dataset {0} specified for mission {1}."
353353
"Must be one of: {2}"
354354
.format(dataset, mission,
355-
self.list_datasets(mission, cache=True)))
355+
self.list_datasets(mission=mission, cache=True)))
356356

357357
url = "{URL}search/{mission}/{dataset}/".format(URL=self.URL,
358358
mission=mission,
@@ -368,7 +368,7 @@ def list_tables(self, mission=None, dataset=None, cache=True):
368368
# def get_data(self, **kwargs):
369369
# return self.query_region_async(retrieve_data=True, **kwargs)
370370

371-
def show_docs(self, mission=None, dataset=None, table=None):
371+
def show_docs(self, *, mission=None, dataset=None, table=None):
372372
"""
373373
Open the documentation for a given table in a web browser.
374374
@@ -390,7 +390,7 @@ def show_docs(self, mission=None, dataset=None, table=None):
390390

391391
return webbrowser.open(url)
392392

393-
def get_columns(self, mission=None, dataset=None, table=None):
393+
def get_columns(self, *, mission=None, dataset=None, table=None):
394394
"""
395395
Get the schema for a given table.
396396

astroquery/ipac/irsa/ibe/tests/test_ibe.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,22 +67,22 @@ def test_list_missions(patch_get):
6767

6868

6969
def test_list_datasets(patch_get):
70-
assert Ibe.list_datasets('ptf') == ['images']
70+
assert Ibe.list_datasets(mission='ptf') == ['images']
7171

7272

7373
def test_list_tables(patch_get):
74-
assert Ibe.list_tables('ptf', 'images') == ['level1', 'level2']
74+
assert Ibe.list_tables(mission='ptf', dataset='images') == ['level1', 'level2']
7575

7676

7777
def test_get_columns(patch_get):
78-
columns = Ibe.get_columns('ptf', 'images', 'level1')
78+
columns = Ibe.get_columns(mission='ptf', dataset='images', table='level1')
7979
assert len(columns) == 173
8080
assert columns[0]['name'] == 'expid'
8181

8282

8383
def test_ibe_pos(patch_get):
8484
table = Ibe.query_region(
85-
SkyCoord(148.969687 * u.deg, 69.679383 * u.deg),
85+
coordinate=SkyCoord(148.969687 * u.deg, 69.679383 * u.deg),
8686
where='expid <= 43010')
8787
assert isinstance(table, Table)
8888
assert len(table) == 21

astroquery/ipac/irsa/ibe/tests/test_ibe_remote.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
@pytest.mark.remote_data
1414
def test_ibe_pos():
1515
table = ibe.Ibe.query_region(
16-
SkyCoord(148.969687 * u.deg, 69.679383 * u.deg),
16+
coordinate=SkyCoord(148.969687 * u.deg, 69.679383 * u.deg),
1717
where='expid <= 43010')
1818
assert isinstance(table, Table)
1919
assert len(table) == 21

0 commit comments

Comments
 (0)