mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 22:26:08 -04:00
A few style fixes in material.py
This commit is contained in:
parent
0a8454d7f7
commit
606457a1f0
1 changed files with 4 additions and 6 deletions
|
|
@ -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.
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue