openmc.data.DataLibrary¶
-
class
openmc.data.
DataLibrary
[source]¶ Collection of cross section data libraries.
Variables: libraries (list of dict) – List in which each item is a dictionary summarizing cross section data from a single file. The dictionary has keys ‘path’, ‘type’, and ‘materials’. -
export_to_xml
(path='cross_sections.xml')[source]¶ Export cross section data library to an XML file.
Parameters: path (str) – Path to file to write. Defaults to ‘cross_sections.xml’.
-
classmethod
from_xml
(path=None)[source]¶ Read cross section data library from an XML file.
Parameters: path (str, optional) – Path to XML file to read. If not provided, the OPENMC_CROSS_SECTIONS
environment variable will be used.Returns: data – Data library object initialized from the provided XML Return type: openmc.data.DataLibrary
-
get_by_material
(name)[source]¶ Return the library dictionary containing a given material.
Parameters: name (str) – Name of material, e.g. ‘Am241’ Returns: library – Dictionary summarizing cross section data from a single file; the dictionary has keys ‘path’, ‘type’, and ‘materials’. Return type: dict or None
-