not printing nuclides with 0 percent to terminal (option 2 ) (#3448)

This commit is contained in:
Jonathan Shimwell 2025-08-21 11:14:21 +02:00 committed by GitHub
parent 68e894c4b0
commit e878aeb82f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 1 additions and 2 deletions

View file

@ -233,7 +233,7 @@ class StepResult:
) from e
for nuc, _ in sorted(self.index_nuc.items(), key=lambda x: x[1]):
atoms = self[0, mat_id, nuc]
if atoms < 0.0:
if atoms <= 0.0:
continue
atom_per_bcm = atoms / vol * 1e-24
material.add_nuclide(nuc, atom_per_bcm)

View file

@ -220,5 +220,4 @@ def test_stepresult_get_material(res):
# Spot check number densities
densities = mat1.get_nuclide_atom_densities()
assert densities['Xe135'] == pytest.approx(1e-14)
assert densities['I135'] == pytest.approx(1e-21)
assert densities['U234'] == pytest.approx(1.00506e-05)