File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1232,20 +1232,20 @@ def viewMaterialProps(self, id):
12321232 """display material properties in message box"""
12331233 mat = openmc .lib .materials [id ]
12341234 if mat .name :
1235- msg_str = "Material {} ({}) Properties\n \n " . format ( id , mat . name )
1235+ msg_str = f "Material { id } ({ mat . name } ) Properties\n \n "
12361236 else :
1237- msg_str = "Material {} Properties\n \n " . format ( id )
1237+ msg_str = f "Material { id } Properties\n \n "
12381238
12391239 # get density and temperature
12401240 dens_g = mat .get_density (units = 'g/cm3' )
12411241 dens_a = mat .get_density (units = 'atom/b-cm' )
1242- msg_str += "Density: {:.3f} g/cm3 ({:.3e} atom/b-cm)\n " . format ( dens_g , dens_a )
1243- msg_str += "Temperature: {} K\n \n " . format ( mat . temperature )
1242+ msg_str += f "Density: { dens_g :.3f} g/cm3 ({ dens_a :.3e} atom/b-cm)\n "
1243+ msg_str += f "Temperature: { mat . temperature } K\n \n "
12441244
12451245 # get nuclides and their densities
12461246 msg_str += "Nuclide densities [atom/b-cm]:\n "
12471247 for nuc , dens in zip (mat .nuclides , mat .densities ):
1248- msg_str += '{ }: {:5.3e}\n '. format ( nuc , dens )
1248+ msg_str += f' { nuc } : { dens :5.3e} \n '
12491249
12501250 msg_box = QMessageBox ()
12511251 msg_box .setText (msg_str )
You can’t perform that action at this time.
0 commit comments