Apply suggestions from @drewejohnson code review

Co-Authored-By: Andrew Johnson <drewej@protonmail.com>
This commit is contained in:
Paul Romano 2020-03-25 06:45:03 -05:00 committed by GitHub
parent 9fffaa0c26
commit 4ad2ad3ab8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 5 deletions

View file

@ -19,7 +19,7 @@ def check_type(name, value, expected_type, expected_iter_type=None, *, none_ok=F
expected_iter_type : type or Iterable of type or None, optional
Expected type of each element in value, assuming it is iterable. If
None, no check will be performed.
none_ok : bool
none_ok : bool, optional
Whether None is allowed as a value
"""

View file

@ -794,10 +794,10 @@ class Material(IDManagerMixin):
xml_element = ET.Element("nuclide")
xml_element.set("name", nuclide[0])
if nuclide[2] == 'ao':
xml_element.set("ao", str(nuclide[1]))
if nuclide.percent_type == 'ao':
xml_element.set("ao", str(nuclide.percent))
else:
xml_element.set("wo", str(nuclide[1]))
xml_element.set("wo", str(nuclide.percent))
return xml_element

View file

@ -1097,7 +1097,7 @@ class Tally(IDManagerMixin):
return np.arange(self.num_nuclides)
# Determine the score indices from any of the requested scores
nuclide_indices = np.zeros(len(nuclides), dtype=int)
nuclide_indices = np.zeros_like(nuclides, dtype=int)
for i, nuclide in enumerate(nuclides):
nuclide_indices[i] = self.get_nuclide_index(nuclide)
return nuclide_indices