allowing materials.xml to be specified

This commit is contained in:
Jonathan Shimwell 2023-01-27 14:26:56 +00:00
parent 3f5b90042c
commit 2dbb0c7523

View file

@ -375,7 +375,8 @@ class Results(list):
def export_to_materials(
self,
burnup_index: int,
nuc_with_data: Optional[Iterable[str]] = None
nuc_with_data: Optional[Iterable[str]] = None,
path: PathLike = 'materials.xml'
) -> Materials:
"""Return openmc.Materials object based on results at a given step
@ -394,6 +395,8 @@ class Results(list):
If not provided, nuclides from the cross_sections element of
materials.xml will be used. If that element is not present,
nuclides from openmc.config['cross_sections'] will be used.
path : PathLike
Path to file to write. Defaults to 'materials.xml'.
Returns
-------
@ -407,7 +410,7 @@ class Results(list):
# updated. If for some reason you have modified OpenMC to produce
# new materials as depletion takes place, this method will not
# work as expected and leave out that material.
mat_file = Materials.from_xml("materials.xml")
mat_file = Materials.from_xml(path)
# Only nuclides with valid transport data will be written to
# the new materials XML file. The precedence of nuclides to select