Skip to content

Commit 8b2d532

Browse files
nkphysicsbsipocz
authored andcommitted
Refactor: Made hips2fits kwargs keyword only
1 parent e1b9bc6 commit 8b2d532

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

astroquery/hips2fits/core.py

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ class hips2fitsClass(BaseQuery):
5555
def __init__(self, *args):
5656
super().__init__()
5757

58-
def query_with_wcs(self, hips, wcs, format="fits", min_cut=0.5, max_cut=99.5, stretch="linear", cmap="Greys_r",
59-
get_query_payload=False, verbose=False):
58+
def query_with_wcs(self, hips, wcs, *, format="fits", min_cut=0.5, max_cut=99.5, stretch="linear",
59+
cmap="Greys_r", get_query_payload=False, verbose=False):
6060
"""
6161
Query the `CDS hips2fits service <http://alasky.u-strasbg.fr/hips-image-services/hips2fits>`_ with an
6262
astropy WCS.
@@ -138,7 +138,7 @@ def query_with_wcs(self, hips, wcs, format="fits", min_cut=0.5, max_cut=99.5, st
138138
>>> plt.show(im)
139139
140140
"""
141-
response = self.query_with_wcs_async(get_query_payload, hips=hips, wcs=wcs, format=format,
141+
response = self.query_with_wcs_async(get_query_payload=get_query_payload, hips=hips, wcs=wcs, format=format,
142142
min_cut=min_cut, max_cut=max_cut, stretch=stretch, cmap=cmap)
143143

144144
if get_query_payload:
@@ -148,7 +148,7 @@ def query_with_wcs(self, hips, wcs, format="fits", min_cut=0.5, max_cut=99.5, st
148148
return result
149149

150150
@class_or_instance
151-
def query_with_wcs_async(self, get_query_payload=False, **kwargs):
151+
def query_with_wcs_async(self, *, get_query_payload=False, **kwargs):
152152
request_payload = self._args_to_payload(**kwargs)
153153

154154
# primarily for debug purposes, but also useful if you want to send
@@ -167,8 +167,9 @@ def query_with_wcs_async(self, get_query_payload=False, **kwargs):
167167

168168
return response
169169

170-
def query(self, hips, width, height, projection, ra, dec, fov, coordsys="icrs", rotation_angle=Angle(0 * u.deg),
171-
format="fits", min_cut=0.5, max_cut=99.5, stretch="linear", cmap="Greys_r",
170+
def query(self, hips, width, height, projection, ra, dec, fov, *,
171+
coordsys="icrs", rotation_angle=Angle(0 * u.deg), format="fits",
172+
min_cut=0.5, max_cut=99.5, stretch="linear", cmap="Greys_r",
172173
get_query_payload=False, verbose=False):
173174
"""
174175
Query the `CDS hips2fits service <http://alasky.u-strasbg.fr/hips-image-services/hips2fits>`_.
@@ -268,9 +269,10 @@ def query(self, hips, width, height, projection, ra, dec, fov, coordsys="icrs",
268269
>>> plt.show(im)
269270
"""
270271

271-
response = self.query_async(get_query_payload, hips=hips, width=width, height=height, projection=projection,
272-
ra=ra, dec=dec, fov=fov, coordsys=coordsys, rotation_angle=rotation_angle,
273-
format=format, min_cut=min_cut, max_cut=max_cut, stretch=stretch, cmap=cmap)
272+
response = self.query_async(get_query_payload=get_query_payload, hips=hips, width=width, height=height,
273+
projection=projection, ra=ra, dec=dec, fov=fov, coordsys=coordsys,
274+
rotation_angle=rotation_angle, format=format, min_cut=min_cut,
275+
max_cut=max_cut, stretch=stretch, cmap=cmap)
274276

275277
if get_query_payload:
276278
return response
@@ -279,7 +281,7 @@ def query(self, hips, width, height, projection, ra, dec, fov, coordsys="icrs",
279281
return result
280282

281283
@class_or_instance
282-
def query_async(self, get_query_payload=False, **kwargs):
284+
def query_async(self, *, get_query_payload=False, **kwargs):
283285
request_payload = self._args_to_payload(**kwargs)
284286

285287
# primarily for debug purposes, but also useful if you want to send

0 commit comments

Comments
 (0)