Fix bug in WeightWindowGenerator for empty energy bounds (#3263)

This commit is contained in:
Paul Romano 2025-01-15 06:35:37 -06:00 committed by GitHub
parent 549cc0973c
commit 6d731934f4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -897,7 +897,10 @@ class WeightWindowGenerator:
mesh_id = int(get_text(elem, 'mesh'))
mesh = meshes[mesh_id]
energy_bounds = [float(x) for x in get_text(elem, 'energy_bounds').split()]
if (energy_bounds := get_text(elem, 'energy_bounds')) is not None:
energy_bounds = [float(x) for x in energy_bounds.split()]
else:
energy_bounds = None
particle_type = get_text(elem, 'particle_type')
wwg = cls(mesh, energy_bounds, particle_type)