Skip to content

Commit bfc49a3

Browse files
nkphysicsbsipocz
authored andcommitted
Refactor: Made ipac/irsa/irsa_dust kwargs keyword only
1 parent ceb1196 commit bfc49a3

File tree

1 file changed

+18
-18
lines changed
  • astroquery/ipac/irsa/irsa_dust

1 file changed

+18
-18
lines changed

astroquery/ipac/irsa/irsa_dust/core.py

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class IrsaDustClass(BaseQuery):
4848
'100um': 'e'
4949
}
5050

51-
def get_images(self, coordinate, radius=None,
51+
def get_images(self, coordinate, *, radius=None,
5252
image_type=None, timeout=TIMEOUT, get_query_payload=False,
5353
show_progress=True):
5454
"""
@@ -91,7 +91,7 @@ def get_images(self, coordinate, radius=None,
9191
get_query_payload=get_query_payload, show_progress=show_progress)
9292
return [obj.get_fits() for obj in readable_objs]
9393

94-
def get_images_async(self, coordinate, radius=None, image_type=None,
94+
def get_images_async(self, coordinate, *, radius=None, image_type=None,
9595
timeout=TIMEOUT, get_query_payload=False,
9696
show_progress=True):
9797
"""
@@ -141,7 +141,7 @@ def get_images_async(self, coordinate, radius=None, image_type=None,
141141
show_progress=show_progress)
142142
for U in image_urls]
143143

144-
def get_image_list(self, coordinate, radius=None, image_type=None,
144+
def get_image_list(self, coordinate, *, radius=None, image_type=None,
145145
timeout=TIMEOUT):
146146
"""
147147
Query function that performs coordinate-based query and returns a list
@@ -182,7 +182,7 @@ def get_image_list(self, coordinate, radius=None, image_type=None,
182182
timeout=timeout)
183183
return self.extract_image_urls(response.text, image_type=image_type)
184184

185-
def get_extinction_table(self, coordinate, radius=None, timeout=TIMEOUT,
185+
def get_extinction_table(self, coordinate, *, radius=None, timeout=TIMEOUT,
186186
show_progress=True):
187187
"""
188188
Query function that fetches the extinction table from the query
@@ -220,7 +220,7 @@ def get_extinction_table(self, coordinate, radius=None, timeout=TIMEOUT,
220220
column.unit = str(column.unit)[:-1]
221221
return table
222222

223-
def get_extinction_table_async(self, coordinate, radius=None,
223+
def get_extinction_table_async(self, coordinate, *, radius=None,
224224
timeout=TIMEOUT, show_progress=True):
225225
"""
226226
A query function similar to
@@ -253,11 +253,11 @@ def get_extinction_table_async(self, coordinate, radius=None,
253253
response = self._request("POST", url, data=request_payload,
254254
timeout=timeout)
255255
xml_tree = utils.xml(response.text)
256-
result = SingleDustResult(xml_tree, coordinate)
256+
result = SingleDustResult(xml_tree, query_loc=coordinate)
257257
return commons.FileContainer(result.ext_detail_table(),
258258
show_progress=show_progress)
259259

260-
def get_query_table(self, coordinate, radius=None,
260+
def get_query_table(self, coordinate, *, radius=None,
261261
section=None, timeout=TIMEOUT, url=DUST_SERVICE_URL):
262262
"""
263263
Create and return an `~astropy.table.Table` representing the query
@@ -299,7 +299,7 @@ def get_query_table(self, coordinate, radius=None,
299299
response = self._request("POST", url, data=request_payload,
300300
timeout=timeout)
301301
xml_tree = utils.xml(response.text)
302-
result = SingleDustResult(xml_tree, coordinate)
302+
result = SingleDustResult(xml_tree, query_loc=coordinate)
303303
if section is None or section in ["location", "loc", "l"]:
304304
return result.table(section=section)
305305
try:
@@ -310,7 +310,7 @@ def get_query_table(self, coordinate, radius=None,
310310
'ebv, temperature, location or 100um.')
311311
raise ValueError(msg)
312312

313-
def _args_to_payload(self, coordinate, radius=None):
313+
def _args_to_payload(self, coordinate, *, radius=None):
314314
"""
315315
Accepts the query parameters and returns a dictionary
316316
suitable to be sent as data via a HTTP POST request.
@@ -357,7 +357,7 @@ def _args_to_payload(self, coordinate, radius=None):
357357
payload["regSize"] = reg_size
358358
return payload
359359

360-
def extract_image_urls(self, raw_xml, image_type=None):
360+
def extract_image_urls(self, raw_xml, *, image_type=None):
361361
"""
362362
Extracts the image URLs from the query results and
363363
returns these as a list. If section is missing or
@@ -414,7 +414,7 @@ class SingleDustResult:
414414
initial response. Not intended to be instantiated by the end user.
415415
"""
416416

417-
def __init__(self, xml_tree, query_loc=None):
417+
def __init__(self, xml_tree, *, query_loc=None):
418418
"""
419419
Parameters
420420
----------
@@ -450,7 +450,7 @@ def xml(self):
450450
"""Return the raw xml underlying this SingleDustResult."""
451451
return self._xml
452452

453-
def table(self, section=None):
453+
def table(self, *, section=None):
454454
"""
455455
Create and return a `~astropy.table.Table` representing the query
456456
response.
@@ -467,7 +467,7 @@ def table(self, section=None):
467467
else:
468468
return self._table(code)
469469

470-
def values(self, section=None):
470+
def values(self, *, section=None):
471471
"""
472472
Return the data values contained in the query response,
473473
i.e. the list of values corresponding to a row in the result table.
@@ -733,7 +733,7 @@ class NumberNode(BaseDustNode):
733733
number.
734734
"""
735735

736-
def __init__(self, xml_node, col_name, units=None):
736+
def __init__(self, xml_node, col_name, *, units=None):
737737
"""
738738
Parameters
739739
----------
@@ -881,7 +881,7 @@ def __init__(self, xml_root):
881881
# Create the section's DustNodes
882882
self._dust_nodes = [CoordNode(
883883
xml_nodes[OBJ_NAME], col_names=["RA", "Dec", "coord sys"]),
884-
NumberNode(xml_nodes[REG_SIZE], REG_SIZE, u.deg)]
884+
NumberNode(xml_nodes[REG_SIZE], REG_SIZE, units=u.deg)]
885885

886886
self.create_columns()
887887

@@ -899,7 +899,7 @@ class StatsSection(BaseResultSection):
899899
section.
900900
"""
901901

902-
def __init__(self, xml_root, col_prefix, suffix=""):
902+
def __init__(self, xml_root, col_prefix, *, suffix=""):
903903
"""
904904
Parameters
905905
----------
@@ -984,8 +984,8 @@ def __init__(self, xml_root):
984984

985985
# Create statistics subsections
986986
self._stats_sandf = StatsSection(xml_nodes[STATISTICS],
987-
"ext SandF", "SandF")
988-
self._stats_sfd = StatsSection(xml_nodes[STATISTICS], "ext SFD", "SFD")
987+
"ext SandF", suffix="SandF")
988+
self._stats_sfd = StatsSection(xml_nodes[STATISTICS], "ext SFD", suffix="SFD")
989989

990990
self.create_columns()
991991

0 commit comments

Comments
 (0)