From a6bd9a86c5ce7f3062f25bc6d48399b35cb8ce01 Mon Sep 17 00:00:00 2001 From: Sterling Harper Date: Wed, 11 Mar 2020 23:30:14 -0400 Subject: [PATCH] Improve Materials.export_to_xml comment --- openmc/material.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/openmc/material.py b/openmc/material.py index 2c81d1e7d5..f19cf12915 100644 --- a/openmc/material.py +++ b/openmc/material.py @@ -1177,7 +1177,9 @@ class Materials(cv.CheckedList): if p.is_dir(): p /= 'materials.xml' - # Open the file in write mode. + # Write materials to the file one-at-a-time. This significantly reduces + # memory demand over allocating a complete ElementTree and writing it in + # one go. with open(str(p), 'w', encoding='utf-8', errors='xmlcharrefreplace') as fh: