@@ -45,7 +45,7 @@ class VizierClass(BaseQuery):
45
45
schema .Or ([_str_schema ], _str_schema , None ),
46
46
error = "catalog must be a list of strings or a single string" )
47
47
48
- def __init__ (self , columns = ["*" ], column_filters = {}, catalog = None ,
48
+ def __init__ (self , * , columns = ["*" ], column_filters = {}, catalog = None ,
49
49
keywords = None , ucd = "" , timeout = conf .timeout ,
50
50
vizier_server = conf .server , row_limit = conf .row_limit ):
51
51
"""
@@ -178,7 +178,7 @@ def keywords(self, value):
178
178
def keywords (self ):
179
179
self ._keywords = None
180
180
181
- def find_catalogs (self , keywords , include_obsolete = False , verbose = False ,
181
+ def find_catalogs (self , keywords , * , include_obsolete = False , verbose = False ,
182
182
max_catalogs = None , return_type = 'votable' ):
183
183
"""
184
184
Search Vizier for catalogs based on a set of keywords, e.g. author name
@@ -244,7 +244,7 @@ def find_catalogs(self, keywords, include_obsolete=False, verbose=False,
244
244
245
245
return result
246
246
247
- def get_catalogs_async (self , catalog , verbose = False , return_type = 'votable' ,
247
+ def get_catalogs_async (self , catalog , * , verbose = False , return_type = 'votable' ,
248
248
get_query_payload = False ):
249
249
"""
250
250
Query the Vizier service for a specific catalog
@@ -677,7 +677,7 @@ def _parse_result(self, response, *, get_catalog_names=False, verbose=False,
677
677
"""
678
678
if response .content [:5 ] == b'<?xml' :
679
679
try :
680
- return parse_vizier_votable (
680
+ return _parse_vizier_votable (
681
681
response .content , verbose = verbose , invalid = invalid ,
682
682
get_catalog_names = get_catalog_names )
683
683
except Exception as ex :
@@ -691,7 +691,7 @@ def _parse_result(self, response, *, get_catalog_names=False, verbose=False,
691
691
"self.parsed_result.\n Exception: " +
692
692
str (self .table_parse_error ))
693
693
elif response .content [:5 ] == b'#\n # ' :
694
- return parse_vizier_tsvfile (response .content , verbose = verbose )
694
+ return _parse_vizier_tsvfile (response .content , verbose = verbose )
695
695
elif response .content [:6 ] == b'SIMPLE' :
696
696
return fits .open (BytesIO (response .content ),
697
697
ignore_missing_end = True )
@@ -710,19 +710,19 @@ def valid_keywords(self):
710
710
return self ._valid_keyword_dict
711
711
712
712
713
- def parse_vizier_tsvfile (data , * , verbose = False ):
713
+ def _parse_vizier_tsvfile (data , * , verbose = False ):
714
714
"""
715
715
Parse a Vizier-generated list of tsv data tables into a list of astropy
716
716
Tables.
717
717
718
718
Parameters
719
719
----------
720
- data : ascii str
721
- An ascii string containing the vizier-formatted list of tables
720
+ data : response content bytes
721
+ Bytes containing the vizier-formatted list of tables
722
722
"""
723
723
724
724
# http://stackoverflow.com/questions/4664850/find-all-occurrences-of-a-substring-in-python
725
- split_indices = [m .start () for m in re .finditer ('\n \n #' , data )]
725
+ split_indices = [m .start () for m in re .finditer (b '\n \n #' , data )]
726
726
# we want to slice out chunks of the file each time
727
727
split_limits = zip (split_indices [:- 1 ], split_indices [1 :])
728
728
tables = [ascii .read (BytesIO (data [a :b ]), format = 'fast_tab' , delimiter = '\t ' ,
@@ -731,8 +731,8 @@ def parse_vizier_tsvfile(data, *, verbose=False):
731
731
return tables
732
732
733
733
734
- def parse_vizier_votable (data , * , verbose = False , invalid = 'warn' ,
735
- get_catalog_names = False ):
734
+ def _parse_vizier_votable (data , * , verbose = False , invalid = 'warn' ,
735
+ get_catalog_names = False ):
736
736
"""
737
737
Given a votable as string, parse it into dict or tables
738
738
"""
0 commit comments