Skip to content

Commit 0cc58b7

Browse files
authored
Merge pull request #2610 from keflavich/vizier_keywordonly
Refactor: make Vizier kwargs keyword-only
2 parents 2ac0cb8 + c024d54 commit 0cc58b7

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

CHANGES.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -435,6 +435,7 @@ vizier
435435

436436
- It is now possible to specify 'galatic' centers in region queries to
437437
have box queries oriented along the galactic axes. [#2152]
438+
- Optional keyword arguments are now keyword only. [#2610]
438439

439440

440441
Infrastructure, Utility and Other Changes and Additions

astroquery/vizier/core.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ def get_catalogs_async(self, catalog, verbose=False, return_type='votable',
272272

273273
return response
274274

275-
def query_object_async(self, object_name, catalog=None, radius=None,
275+
def query_object_async(self, object_name, *, catalog=None, radius=None,
276276
coordinate_frame=None, get_query_payload=False,
277277
return_type='votable', cache=True):
278278
"""
@@ -323,7 +323,7 @@ def query_object_async(self, object_name, catalog=None, radius=None,
323323
data=data_payload, timeout=self.TIMEOUT, cache=cache)
324324
return response
325325

326-
def query_region_async(self, coordinates, radius=None, inner_radius=None,
326+
def query_region_async(self, coordinates, *, radius=None, inner_radius=None,
327327
width=None, height=None, catalog=None,
328328
get_query_payload=False, cache=True,
329329
return_type='votable', column_filters={},
@@ -332,6 +332,8 @@ def query_region_async(self, coordinates, radius=None, inner_radius=None,
332332
Serves the same purpose as `query_region` but only
333333
returns the HTTP response rather than the parsed result.
334334
335+
At least one of ``radius`` or ``width`` must be specified.
336+
335337
Parameters
336338
----------
337339
coordinates : str, `astropy.coordinates` object, or `~astropy.table.Table`
@@ -454,7 +456,7 @@ def query_region_async(self, coordinates, radius=None, inner_radius=None,
454456
data=data_payload, timeout=self.TIMEOUT, cache=cache)
455457
return response
456458

457-
def query_constraints_async(self, catalog=None, return_type='votable',
459+
def query_constraints_async(self, *, catalog=None, return_type='votable',
458460
cache=True, get_query_payload=False,
459461
**kwargs):
460462
"""
@@ -641,7 +643,7 @@ def _args_to_payload(self, *args, **kwargs):
641643
# merge result
642644
return "\n".join(script)
643645

644-
def _parse_result(self, response, get_catalog_names=False, verbose=False,
646+
def _parse_result(self, response, *, get_catalog_names=False, verbose=False,
645647
invalid='warn'):
646648
"""
647649
Parses the HTTP response to create a `~astropy.table.Table`.
@@ -708,7 +710,7 @@ def valid_keywords(self):
708710
return self._valid_keyword_dict
709711

710712

711-
def parse_vizier_tsvfile(data, verbose=False):
713+
def parse_vizier_tsvfile(data, *, verbose=False):
712714
"""
713715
Parse a Vizier-generated list of tsv data tables into a list of astropy
714716
Tables.
@@ -729,7 +731,7 @@ def parse_vizier_tsvfile(data, verbose=False):
729731
return tables
730732

731733

732-
def parse_vizier_votable(data, verbose=False, invalid='warn',
734+
def parse_vizier_votable(data, *, verbose=False, invalid='warn',
733735
get_catalog_names=False):
734736
"""
735737
Given a votable as string, parse it into dict or tables

0 commit comments

Comments
 (0)