diff --git a/openmc/checkvalue.py b/openmc/checkvalue.py index 32d14c6f8f..a59b38a630 100644 --- a/openmc/checkvalue.py +++ b/openmc/checkvalue.py @@ -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 """ diff --git a/openmc/material.py b/openmc/material.py index 0e1ae8df7b..3babdf6435 100644 --- a/openmc/material.py +++ b/openmc/material.py @@ -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 diff --git a/openmc/tallies.py b/openmc/tallies.py index e27b750a65..11f2fb0676 100644 --- a/openmc/tallies.py +++ b/openmc/tallies.py @@ -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