File tree Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -392,12 +392,13 @@ def add_votable_fields(self, *args):
392
392
"https://astroquery.readthedocs.io/en/latest/simbad/simbad_evolution.html"
393
393
" to see the new ways to interact with SIMBAD's fluxes." )
394
394
if re .match (r"^flux.*\(.+\)$" , arg ):
395
- warnings .warn ("The notation 'flux(XXX)' is deprecated since 0.4.8 in favor of 'XXX'. "
396
- "You will see the column appearing with its new name in the output. "
397
- "See section on filters in "
395
+ filter_name = re .findall (r"\((\w+)\)" , arg )[0 ]
396
+ warnings .warn (f"The notation 'flux({ filter_name } )' is deprecated since 0.4.8 in favor of "
397
+ f"'{ filter_name } '. You will see the column appearing with its new name "
398
+ "in the output. See section on filters in "
398
399
"https://astroquery.readthedocs.io/en/latest/simbad/simbad_evolution.html "
399
400
"to see the new ways to interact with SIMBAD's fluxes." , DeprecationWarning , stacklevel = 2 )
400
- fluxes_to_add .append (re . findall ( r"\((\w+)\)" , arg )[ 0 ] )
401
+ fluxes_to_add .append (filter_name )
401
402
args .remove (arg )
402
403
403
404
# output options
Original file line number Diff line number Diff line change @@ -271,7 +271,7 @@ def test_add_votable_fields_errors():
271
271
simbad_instance = simbad .SimbadClass ()
272
272
with pytest .raises (ValueError , match = r"The votable fields \'flux_\*\*\*\(filtername\)\' are removed *" ):
273
273
simbad_instance .add_votable_fields ("flux_error(u)" )
274
- with pytest .warns (DeprecationWarning , match = r"The notation \'flux\(XXX \)\' is deprecated since 0.4.8 *" ):
274
+ with pytest .warns (DeprecationWarning , match = r"The notation \'flux\(u \)\' is deprecated since 0.4.8 *" ):
275
275
simbad_instance .add_votable_fields ("flux(u)" )
276
276
assert "u_" in str (simbad_instance .columns_in_output )
277
277
# big letter J filter exists, but not small letter j
@@ -312,7 +312,7 @@ def test_add_votable_fields_errors():
312
312
def test_add_list_of_fluxes ():
313
313
# regression test for https://github.com/astropy/astroquery/issues/3185#issuecomment-2599191953
314
314
simbad_instance = simbad .Simbad ()
315
- with pytest .warns (DeprecationWarning , match = r"The notation \'flux\(XXX \)\' is deprecated since 0.4.8 *" ):
315
+ with pytest .warns (DeprecationWarning , match = r"The notation \'flux\([UJ] \)\' is deprecated since 0.4.8 *" ):
316
316
simbad_instance .add_votable_fields ("flux(U)" , "flux(J)" )
317
317
318
318
You can’t perform that action at this time.
0 commit comments