@@ -381,7 +381,7 @@ def add_votable_fields(self, *args):
381
381
"""
382
382
383
383
# the legacy way of adding fluxes
384
- args = list (args )
384
+ args = set (args )
385
385
fluxes_to_add = []
386
386
args_copy = args .copy ()
387
387
for arg in args_copy :
@@ -403,9 +403,10 @@ def add_votable_fields(self, *args):
403
403
# output options
404
404
output_options = self .list_votable_fields ()
405
405
# fluxes are case-dependant
406
- fluxes = output_options [output_options ["type" ] == "filter name" ]["name" ]
406
+ fluxes = set ( output_options [output_options ["type" ] == "filter name" ]["name" ])
407
407
# add fluxes
408
- fluxes_to_add += [flux for flux in args if flux in fluxes ]
408
+ fluxes_from_names = set (flux for flux in args if flux in fluxes )
409
+ fluxes_to_add += fluxes_from_names
409
410
if fluxes_to_add :
410
411
self .joins .append (_Join ("allfluxes" , _Column ("basic" , "oid" ),
411
412
_Column ("allfluxes" , "oidref" )))
@@ -416,6 +417,10 @@ def add_votable_fields(self, *args):
416
417
self .columns_in_output .append (_Column ("allfluxes" , flux + "_" , flux ))
417
418
else :
418
419
self .columns_in_output .append (_Column ("allfluxes" , flux ))
420
+ # remove the arguments already added
421
+ args -= fluxes_from_names
422
+ # remove filters from output options
423
+ output_options = output_options [output_options ["type" ] != "filter name" ]
419
424
420
425
# casefold args because we allow case difference for every other argument (legacy behavior)
421
426
args = set (map (str .casefold , args ))
0 commit comments