Skip to content

Commit c872375

Browse files
nkphysicsbsipocz
authored andcommitted
Refactor: Made wfau kwargs keyword only
1 parent 5b0d4cf commit c872375

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

astroquery/wfau/core.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class BaseWFAUClass(QueryWithLogin):
3636
CROSSID_URL = BASE_URL + "CrossID"
3737
TIMEOUT = ""
3838

39-
def __init__(self, username=None, password=None, community=None,
39+
def __init__(self, *, username=None, password=None, community=None,
4040
database='', programme_id='all'):
4141
"""
4242
The BaseWFAUClass __init__ is meant to be overwritten
@@ -108,7 +108,7 @@ def _args_to_payload(self, *args, **kwargs):
108108
request_payload['dec'] = C.b.degree
109109
return request_payload
110110

111-
def _verify_programme_id(self, pid, query_type='catalog'):
111+
def _verify_programme_id(self, pid, *, query_type='catalog'):
112112
"""
113113
Verify the programme ID is valid for the query being executed.
114114
@@ -152,7 +152,7 @@ def _parse_system(self, system):
152152
elif system.lower() in ('j', 'j2000', 'celestical', 'radec'):
153153
return 'J'
154154

155-
def get_images(self, coordinates, waveband='all', frame_type='stack',
155+
def get_images(self, coordinates, *, waveband='all', frame_type='stack',
156156
image_width=1 * u.arcmin, image_height=None, radius=None,
157157
database=None, programme_id=None,
158158
verbose=True, get_query_payload=False,
@@ -212,7 +212,7 @@ def get_images(self, coordinates, waveband='all', frame_type='stack',
212212
return readable_objs
213213
return [obj.get_fits() for obj in readable_objs]
214214

215-
def get_images_async(self, coordinates, waveband='all', frame_type='stack',
215+
def get_images_async(self, coordinates, *, waveband='all', frame_type='stack',
216216
image_width=1 * u.arcmin, image_height=None,
217217
radius=None, database=None,
218218
programme_id=None, verbose=True,
@@ -290,7 +290,7 @@ def get_images_async(self, coordinates, waveband='all', frame_type='stack',
290290
show_progress=show_progress)
291291
for url in image_urls]
292292

293-
def get_image_list(self, coordinates, waveband='all', frame_type='stack',
293+
def get_image_list(self, coordinates, *, waveband='all', frame_type='stack',
294294
image_width=1 * u.arcmin, image_height=None,
295295
radius=None, database=None,
296296
programme_id=None, get_query_payload=False):
@@ -433,7 +433,7 @@ def extract_urls(self, html_in):
433433
links = ahref.findall(html_in)
434434
return links
435435

436-
def query_region(self, coordinates, radius=1 * u.arcmin,
436+
def query_region(self, coordinates, *, radius=1 * u.arcmin,
437437
programme_id=None, database=None,
438438
verbose=False, get_query_payload=False, system='J2000',
439439
attributes=['default'], constraints=''):
@@ -502,7 +502,7 @@ def query_region(self, coordinates, radius=1 * u.arcmin,
502502
result = self._parse_result(response, verbose=verbose)
503503
return result
504504

505-
def query_region_async(self, coordinates, radius=1 * u.arcmin,
505+
def query_region_async(self, coordinates, *, radius=1 * u.arcmin,
506506
programme_id=None,
507507
database=None, get_query_payload=False,
508508
system='J2000', attributes=['default'],
@@ -584,7 +584,7 @@ def query_region_async(self, coordinates, radius=1 * u.arcmin,
584584

585585
return response
586586

587-
def _parse_result(self, response, verbose=False):
587+
def _parse_result(self, response, *, verbose=False):
588588
"""
589589
Parses the raw HTTP response and returns it as a
590590
`~astropy.table.Table`.
@@ -630,7 +630,7 @@ def _parse_result(self, response, verbose=False):
630630
"and the error in self.table_parse_error. "
631631
"Exception: " + str(self.table_parse_error))
632632

633-
def list_catalogs(self, style='short'):
633+
def list_catalogs(self, *, style='short'):
634634
"""
635635
Returns a list of available catalogs in WFAU.
636636
These can be used as ``programme_id`` in queries.
@@ -700,7 +700,7 @@ def _wfau_send_request(self, url, request_payload):
700700
timeout=self.TIMEOUT)
701701
return response
702702

703-
def _check_page(self, url, keyword, wait_time=1, max_attempts=30):
703+
def _check_page(self, url, keyword, *, wait_time=1, max_attempts=30):
704704
page_loaded = False
705705
while not page_loaded and max_attempts > 0:
706706
if self.logged_in():
@@ -722,7 +722,7 @@ def _check_page(self, url, keyword, wait_time=1, max_attempts=30):
722722
raise TimeoutError("Page did not load.")
723723
return response
724724

725-
def query_cross_id_async(self, coordinates, radius=1*u.arcsec,
725+
def query_cross_id_async(self, coordinates, *, radius=1*u.arcsec,
726726
programme_id=None, database=None, table="source",
727727
constraints="", attributes='default',
728728
pairing='all', system='J2000',
@@ -847,7 +847,7 @@ def query_cross_id(self, *args, **kwargs):
847847
return result
848848

849849

850-
def clean_catalog(wfau_catalog, clean_band='K_1', badclass=-9999,
850+
def clean_catalog(wfau_catalog, *, clean_band='K_1', badclass=-9999,
851851
maxerrbits=41, minerrbits=0, maxpperrbits=60):
852852
"""
853853
Attempt to remove 'bad' entries in a catalog.

0 commit comments

Comments
 (0)