@@ -605,8 +605,7 @@ def __init__(self, *args, copy=True, representation_type=None,
605605
606606 if kwargs :
607607 raise TypeError (
608- 'Coordinate frame got unexpected keywords: {}' .format (
609- list (kwargs )))
608+ f'Coordinate frame got unexpected keywords: { list (kwargs )} ' )
610609
611610 # We do ``is None`` because self._data might evaluate to false for
612611 # empty arrays or data == 0
@@ -622,8 +621,7 @@ def __init__(self, *args, copy=True, representation_type=None,
622621 self ._no_data_shape = check_broadcast (* shapes .values ())
623622 except ValueError :
624623 raise ValueError (
625- "non-scalar attributes with inconsistent "
626- "shapes: {}" .format (shapes ))
624+ f"non-scalar attributes with inconsistent shapes: { shapes } " )
627625
628626 # Above, we checked that it is possible to broadcast all
629627 # shapes. By getting and thus validating the attributes,
@@ -1395,11 +1393,9 @@ def __repr__(self):
13951393 frameattrs = f' ({ frameattrs } )'
13961394
13971395 if data_repr :
1398- return '<{} Coordinate{}: {}>' .format (self .__class__ .__name__ ,
1399- frameattrs , data_repr )
1396+ return f'<{ self .__class__ .__name__ } Coordinate{ frameattrs } : { data_repr } >'
14001397 else :
1401- return '<{} Frame{}>' .format (self .__class__ .__name__ ,
1402- frameattrs )
1398+ return f'<{ self .__class__ .__name__ } Frame{ frameattrs } >'
14031399
14041400 def _data_repr (self ):
14051401 """Returns a string representation of the coordinate data."""
@@ -1483,9 +1479,7 @@ def _frame_attrs_repr(self):
14831479 attrstr = attr ._astropy_repr_in_frame ()
14841480 else :
14851481 attrstr = str (attr )
1486- attr_strs .append ("{attribute_name}={attrstr}" .format (
1487- attribute_name = attribute_name ,
1488- attrstr = attrstr ))
1482+ attr_strs .append (f"{ attribute_name } ={ attrstr } " )
14891483
14901484 return ', ' .join (attr_strs )
14911485
0 commit comments