diff --git a/montepy/data_inputs/material.py b/montepy/data_inputs/material.py index d210fd4a..fb494f12 100644 --- a/montepy/data_inputs/material.py +++ b/montepy/data_inputs/material.py @@ -594,15 +594,12 @@ def append(self, nuclide_frac_pair: tuple[Nuclide, float]): self._check_valid_comp(nuclide_frac_pair) self._elements.add(nuclide_frac_pair[0].element) self._nuclei.add(nuclide_frac_pair[0].nucleus) - if not isinstance(nuclide_frac_pair[1], syntax_node.ValueNode): - node = self._generate_default_node( - float, str(nuclide_frac_pair[1]), "\n" + " " * DEFAULT_INDENT - ) - syntax_node.ValueNode(str(nuclide_frac_pair[1]), float) - node.is_negatable_float = True - nuclide_frac_pair = (nuclide_frac_pair[0], node) - else: - node = nuclide_frac_pair[1] + node = self._generate_default_node( + float, str(nuclide_frac_pair[1]), "\n" + " " * DEFAULT_INDENT + ) + syntax_node.ValueNode(str(nuclide_frac_pair[1]), float) + node.is_negatable_float = True + nuclide_frac_pair = (nuclide_frac_pair[0], node) node.is_negative = not self._is_atom_fraction self._components.append(nuclide_frac_pair) self._tree["data"].append_nuclide(("_", nuclide_frac_pair[0]._tree, node)) diff --git a/tests/test_material.py b/tests/test_material.py index e580be69..da71a723 100644 --- a/tests/test_material.py +++ b/tests/test_material.py @@ -154,7 +154,7 @@ def test_material_deleter(_, big_material): assert old_comp[0] not in big_material old_comps = big_material[0:2] del big_material[0:2] - for nuc, _ in old_comps: + for nuc, _f in old_comps: assert nuc not in big_material with pytest.raises(TypeError): del big_material["hi"]