A few style fixes in material.py

This commit is contained in:
Paul Romano 2023-01-13 13:36:51 +07:00
parent 0a8454d7f7
commit 606457a1f0

View file

@ -416,10 +416,10 @@ class Material(IDManagerMixin):
self._atoms = volume_calc.atoms[self.id]
else:
raise ValueError('No volume information found for material ID={}.'
.format(self.id))
.format(self.id))
else:
raise ValueError('No volume information found for material ID={}.'
.format(self.id))
.format(self.id))
def set_density(self, units: str, density: Optional[float] = None):
"""Set the density of the material
@ -531,11 +531,10 @@ class Material(IDManagerMixin):
params['percent_type'] = percent_type
## check if nuclide
# check if nuclide
if not component.isalpha():
self.add_nuclide(component, **params)
else: # is element
kwargs = params
else:
self.add_element(component, **params)
def remove_nuclide(self, nuclide: str):
@ -1583,7 +1582,6 @@ class Materials(cv.CheckedList):
if trailing_indent:
file.write(indentation)
def export_to_xml(self, path: PathLike = 'materials.xml'):
"""Export material collection to an XML file.