Skip to content

Commit 630686c

Browse files
authored
Merge pull request #2703 from nkphysics/kwarg-konly
Refactors: Make kwargs keyword only for remaining packages
2 parents 1ba336e + af27a78 commit 630686c

File tree

5 files changed

+14
-14
lines changed

5 files changed

+14
-14
lines changed

astroquery/vo_conesearch/validator/inspect.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class ConeSearchResults:
3939
Show download progress bars.
4040
4141
"""
42-
def __init__(self, cache=False, verbose=True):
42+
def __init__(self, *, cache=False, verbose=True):
4343
self.dbtypes = ['good', 'warn', 'exception', 'error']
4444
self.dbs = {}
4545
self.catkeys = {}
@@ -49,7 +49,7 @@ def __init__(self, cache=False, verbose=True):
4949
'conesearch_' + typ, cache=cache, verbose=verbose)
5050
self.catkeys[typ] = self.dbs[typ].list_catalogs()
5151

52-
def tally(self, fout=None):
52+
def tally(self, *, fout=None):
5353
"""
5454
Tally databases.
5555
@@ -74,7 +74,7 @@ def tally(self, fout=None):
7474
str_list.append('total: {0} catalog(s)\n'.format(n_tot))
7575
fout.write('\n'.join(str_list))
7676

77-
def list_cats(self, typ, fout=None, ignore_noncrit=False):
77+
def list_cats(self, typ, *, fout=None, ignore_noncrit=False):
7878
"""
7979
List catalogs in given database.
8080
@@ -131,7 +131,7 @@ def list_cats(self, typ, fout=None, ignore_noncrit=False):
131131
if len(str_list) > 0:
132132
fout.write('\n'.join(str_list))
133133

134-
def print_cat(self, key, fout=None):
134+
def print_cat(self, key, *, fout=None):
135135
"""
136136
Display a single catalog of given key.
137137

astroquery/vo_conesearch/validator/tstquery.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
__all__ = ['parse_cs']
2323

2424

25-
def parse_cs(ivoid, cap_index=1):
25+
def parse_cs(ivoid, *, cap_index=1):
2626
"""Return test query pars as dict for given IVO ID and capability index."""
2727

2828
# Production server.

astroquery/vo_conesearch/validator/validate.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232

3333

3434
@timefunc(num_tries=1)
35-
def check_conesearch_sites(destdir=os.curdir, verbose=True, parallel=True,
35+
def check_conesearch_sites(*, destdir=os.curdir, verbose=True, parallel=True,
3636
url_list='default'):
3737
"""
3838
Validate Cone Search Services.
@@ -155,7 +155,7 @@ def check_conesearch_sites(destdir=os.curdir, verbose=True, parallel=True,
155155
continue
156156

157157
# Use testQuery to return non-empty VO table with max verbosity.
158-
testquery_pars = parse_cs(cur_cat['ivoid'], cur_cat['cap_index'])
158+
testquery_pars = parse_cs(cur_cat['ivoid'], cap_index=cur_cat['cap_index'])
159159
cs_pars_arr = ['{}={}'.format(key, testquery_pars[key])
160160
for key in testquery_pars]
161161
cs_pars_arr += ['VERB=3']

astroquery/vo_conesearch/vo_async.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def __getattr__(self, what):
4949
except AttributeError:
5050
return getattr(self.future, what)
5151

52-
def get(self, timeout=None):
52+
def get(self, *, timeout=None):
5353
"""Get result, if available, then shut down thread.
5454
5555
Parameters

astroquery/vo_conesearch/vos_catalog.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -300,14 +300,14 @@ def list_catalogs(self, pattern=None, sort=True):
300300
"""
301301
return self._match_pattern(list(self._catalogs), pattern, sort)
302302

303-
def list_catalogs_by_url(self, pattern=None, sort=True):
303+
def list_catalogs_by_url(self, *, pattern=None, sort=True):
304304
"""Like :meth:`list_catalogs` but using access URL."""
305305
out_arr = self._match_pattern(list(self._url_keys), pattern, sort)
306306

307307
# Discard URL that maps to nothing
308308
return [a for a in out_arr if len(self._url_keys[a]) > 0]
309309

310-
def add_catalog(self, name, cat, allow_duplicate_url=False):
310+
def add_catalog(self, name, cat, *, allow_duplicate_url=False):
311311
"""
312312
Add a catalog to database.
313313
@@ -440,7 +440,7 @@ def merge(self, other, **kwargs):
440440

441441
return db
442442

443-
def to_json(self, filename, overwrite=False):
443+
def to_json(self, filename, *, overwrite=False):
444444
"""
445445
Write database content to a JSON file.
446446
@@ -527,7 +527,7 @@ def from_json(cls, filename, **kwargs):
527527
return cls(tree)
528528

529529
@classmethod
530-
def from_registry(cls, registry_url, timeout=60, **kwargs):
530+
def from_registry(cls, registry_url, *, timeout=60, **kwargs):
531531
"""
532532
Create a database of VO services from VO registry URL.
533533
@@ -628,7 +628,7 @@ def from_registry(cls, registry_url, timeout=60, **kwargs):
628628
return db
629629

630630

631-
def get_remote_catalog_db(dbname, cache=True, verbose=True):
631+
def get_remote_catalog_db(dbname, *, cache=True, verbose=True):
632632
"""
633633
Get a database of VO services (which is a JSON file) from a remote
634634
location.
@@ -700,7 +700,7 @@ def _get_catalogs(service_type, catalog_db, **kwargs):
700700
return catalogs
701701

702702

703-
def _vo_service_request(url, pedantic, kwargs, cache=True, verbose=False):
703+
def _vo_service_request(url, pedantic, kwargs, *, cache=True, verbose=False):
704704
"""
705705
This is called by :func:`call_vo_service`.
706706

0 commit comments

Comments
 (0)