Merge pull request #2364 from shimwell/allowing_export_with_different_materials_files

allowing materials.xml to be specified
This commit is contained in:
Paul Romano 2023-01-31 13:33:22 -06:00 committed by GitHub
commit f1bbeda7f5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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 materials XML file to read. 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