Skip to content

Commit 6f637f1

Browse files
committed
Refactor: Made kwargs keyword only for astroquery/utils/
1 parent e724f62 commit 6f637f1

File tree

7 files changed

+11
-11
lines changed

7 files changed

+11
-11
lines changed

astroquery/utils/commons.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ def get_fits(self):
280280

281281
return self._fits
282282

283-
def save_fits(self, savepath, link_cache='hard'):
283+
def save_fits(self, savepath, *, link_cache='hard'):
284284
"""
285285
Save a FITS file to savepath
286286

astroquery/utils/docstr_chompers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ def dec(fn):
1010
return dec
1111

1212

13-
def prepend_docstr_nosections(doc, sections=['Returns', ]):
13+
def prepend_docstr_nosections(doc, *, sections=['Returns', ]):
1414
"""
1515
Decorator to prepend to the function's docstr after stripping out the
1616
list of sections provided (by default "Returns" only).

astroquery/utils/mocks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class MockResponse:
1212
A mocked/non-remote version of `astroquery.query.AstroResponse`
1313
"""
1414

15-
def __init__(self, content=None, url=None, headers={}, content_type=None,
15+
def __init__(self, content=None, *, url=None, headers={}, content_type=None,
1616
stream=False, auth=None, status_code=200, verify=True,
1717
allow_redirects=True, json=None):
1818
assert content is None or hasattr(content, 'decode')

astroquery/utils/process_asyncs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ def newmethod(self, *args, **kwargs):
5353
return cls
5454

5555

56-
def async_to_sync_docstr(doc, returntype='table'):
56+
def async_to_sync_docstr(doc, *, returntype='table'):
5757
"""
5858
Strip of the "Returns" component of a docstr and replace it with "Returns a
5959
table" code

astroquery/utils/progressbar.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def chunk_report(bytes_so_far, chunk_size, total_size):
2121
(bytes_so_far / 1024. ** 2))
2222

2323

24-
def chunk_read(response, chunk_size=1024, report_hook=None):
24+
def chunk_read(response, *, chunk_size=1024, report_hook=None):
2525
content_length = response.info().get('Content-Length')
2626
if content_length is None:
2727
total_size = 0
@@ -51,7 +51,7 @@ def chunk_read(response, chunk_size=1024, report_hook=None):
5151
return result_string
5252

5353

54-
def retrieve(url, outfile, opener=None, overwrite=False):
54+
def retrieve(url, outfile, *, opener=None, overwrite=False):
5555
"""
5656
"retrieve" (i.e., download to file) a URL.
5757
"""

astroquery/utils/schema.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def validate(self, data):
5555

5656
class Use:
5757

58-
def __init__(self, callable_, error=None):
58+
def __init__(self, callable_, *, error=None):
5959
assert callable(callable_)
6060
self._callable = callable_
6161
self._error = error
@@ -97,7 +97,7 @@ def priority(s):
9797

9898
class Schema:
9999

100-
def __init__(self, schema, error=None):
100+
def __init__(self, schema, *, error=None):
101101
self._schema = schema
102102
self._error = error
103103

astroquery/utils/timer.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
__doctest_skip__ = ['timefunc']
2222

2323

24-
def timefunc(num_tries=1, verbose=True):
24+
def timefunc(*, num_tries=1, verbose=True):
2525
"""Decorator to time a function or method.
2626
2727
Parameters
@@ -207,7 +207,7 @@ def time_func(self, arglist):
207207
self._cache_time(arg)
208208

209209
# FUTURE: Implement N^x * O(log(N)) fancy fitting.
210-
def do_fit(self, model=None, fitter=None, power=1, min_datapoints=3):
210+
def do_fit(self, *, model=None, fitter=None, power=1, min_datapoints=3):
211211
"""Fit a function to the lists of arguments and
212212
their respective run time in the cache.
213213
@@ -304,7 +304,7 @@ def predict_time(self, arg):
304304
self._cache_est[arg] = t_est
305305
return t_est
306306

307-
def plot(self, xscale='linear', yscale='linear', xlabeltext='args',
307+
def plot(self, *, xscale='linear', yscale='linear', xlabeltext='args',
308308
save_as=''): # pragma: no cover
309309
"""Plot prediction.
310310

0 commit comments

Comments
 (0)