montepy.Library#
- class montepy.Library(library: str)#
Bases:
SingletonGroupA class to represent an MCNP nuclear data library, e.g.,
80c.Examples
import montepy library = montepy.Library("710nc") assert library.library == "710nc" assert str(library) == "710nc" assert library.library_type == montepy.LibraryType.NEUTRON assert library.number == 710 assert library.suffix == "c"
Note
This class is immutable, and hashable, meaning it is suitable as a dictionary key.
Added in version 1.0.0.
- Parameters:
library (str) – The name of the library.
- Raises:
TypeError – if a string is not provided.
ValueError – if a valid library is not provided.
Attributes:
The full name of the library.
The
LibraryTypeof this library.The base number in the library.
The suffix of the library, or the final character of its definition.
- property library_type: LibraryType#
The
LibraryTypeof this library.This corresponds to the type of library this would specified in a material definition e.g.,
NLIB,PLIB, etc.See also
- Returns:
the type of library this library is.
- Return type: