@@ -421,7 +421,7 @@ def query_async(
421
421
return request_payload
422
422
return self ._request (** params_d )
423
423
424
- def list_fields (self , keyword = None , cache = True ):
424
+ def list_fields (self , keyword = None , * , cache = True ):
425
425
"""List MOC Server fields.
426
426
427
427
In the MOC Server, the fields are free. This means that anyone publishing there
@@ -458,7 +458,9 @@ def list_fields(self, keyword=None, cache=True):
458
458
hips_publisher 14 CDS
459
459
460
460
"""
461
- fields_descriptions = dict (self .list_fields_async (cache = cache ).json ()[0 ])
461
+ fields_descriptions = dict (
462
+ self ._request (method = "GET" , url = self .URL , timeout = self .TIMEOUT , cache = cache ,
463
+ params = {"get" : "example" , "fmt" : "json" }).json ()[0 ])
462
464
occurrences = [
463
465
int (value .split ("x" )[0 ][1 :]) for value in fields_descriptions .values ()
464
466
]
@@ -478,37 +480,6 @@ def list_fields(self, keyword=None, cache=True):
478
480
]
479
481
return list_fields
480
482
481
- def list_fields_async (self , cache = True ):
482
- """List MOC Server fields asynchronously.
483
-
484
- In the MOC Server, the fields are free. This means that anyone publishing there
485
- can set a new field. This results in a long set of possible fields, that are
486
- more or less frequent in the database.
487
- This method allows to retrieve all fields currently existing, with their
488
- occurrences and an example.
489
-
490
- Parameters
491
- ----------
492
- keyword : str, optional
493
- A keyword to filter the output for fields that have the keyword in their
494
- name. This is not case-sensitive.
495
- If you don't give a keyword, you will retrieve all existing fields.
496
- cache: bool, optional
497
- Whether the response should be cached.
498
-
499
- Returns
500
- -------
501
- `~requests.models.Response`
502
-
503
- """
504
- return self ._request (
505
- method = "GET" ,
506
- url = self .URL ,
507
- timeout = self .TIMEOUT ,
508
- cache = cache ,
509
- params = {"get" : "example" , "fmt" : "json" },
510
- )
511
-
512
483
def list_coordinate_systems (self ):
513
484
"""Return the list of coordinate systems currently available in the MOC Server.
514
485
0 commit comments