Make random ray boolean parsing case-insensitive for proper round-trip

Co-authored-by: jtramm <1009059+jtramm@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot] 2025-10-01 14:52:47 +00:00
parent f6978dcbdf
commit 8743e9dc0d
2 changed files with 3 additions and 3 deletions

View file

@ -2122,11 +2122,11 @@ class Settings:
self.random_ray['source_shape'] = child.text
elif child.tag == 'volume_normalized_flux_tallies':
self.random_ray['volume_normalized_flux_tallies'] = (
child.text in ('true', '1')
child.text.lower() in ('true', '1')
)
elif child.tag == 'adjoint':
self.random_ray['adjoint'] = (
child.text in ('true', '1')
child.text.lower() in ('true', '1')
)
elif child.tag == 'sample_method':
self.random_ray['sample_method'] = child.text

View file

@ -165,7 +165,7 @@ def test_export_to_xml(run_in_tmpdir):
assert recovered_mesh.upper_right == [2., 2., 2.]
assert s.random_ray['volume_estimator'] == 'hybrid'
assert s.random_ray['source_shape'] == 'linear'
assert s.random_ray['volume_normalized_flux_tallies'] == False
assert s.random_ray['volume_normalized_flux_tallies'] == True
assert s.random_ray['adjoint'] == False
assert s.random_ray['sample_method'] == 'halton'
assert s.max_secondaries == 1_000_000