openmc.data.DataLibrary¶
- class openmc.data.DataLibrary[source]¶
Collection of cross section data libraries.
This class behaves like a list where each item is a dictionary summarizing cross section data from a single file. The dictionary has keys ‘path’, ‘type’, and ‘materials’.
Changed in version 0.14.0: This class now behaves like a list rather than requiring you to access the list of libraries through a special attribute.
- 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, openmc.config[‘cross_sections’] will be used.
- Returns
data – Data library object initialized from the provided XML
- Return type
- get_by_material(name, data_type='neutron')[source]¶
Return the library dictionary containing a given material.
- Parameters
- Returns
library – Dictionary summarizing cross section data from a single file; the dictionary has keys ‘path’, ‘type’, and ‘materials’.
- Return type
dict or None