f4enix.input.d1suned.ReactionFile#
- class f4enix.input.d1suned.ReactionFile(reactions: list[Reaction], name: str = 'react')#
Bases:
objectReaction file object
- Parameters:
reactions (list[Reaction]) – contains all reaction objects contained in the file.
name (name, optional) – file name. The default is ‘react’.
Examples
It is possible to change the libraries of a reaction file
>>> from f4enix.input.d1suned import ReactionFile ... reac_file = ReactionFile.from_text('reac_fe') ... reac_file.change_lib('98c')
- Return type:
None.
Methods
__init__(reactions[, name])Reaction file object
change_lib(newlib[, libmanager])change the parent library tag of the reactions.
filter_by_paths(pathways)Use a list of pathways to filter the reaction list.
from_text(filepath)Generate a reaction file directly from text file
Get a list of all parents
write(path)write formatted reaction file
- change_lib(newlib: str, libmanager: LibManager | None = None)#
change the parent library tag of the reactions. If no libmanager is provided, the check on the availability of the parent in the xsdir file will be not performed.
- Parameters:
newlib (str) – (e.g. 31c).
libmanager (LibManager, optional) – Object managing library operations. The default is None.
- Return type:
None.
- filter_by_paths(pathways: list[Pathway]) None#
Use a list of pathways to filter the reaction list.
- Parameters:
pathways (list[Pathway]) – reactions must be present in this list of pathways to be kept in the reaction file.
- classmethod from_text(filepath: PathLike | str) ReactionFile#
Generate a reaction file directly from text file
- Parameters:
cls (TYPE) – DESCRIPTION.
filepath (os.PathLike | str) – file to read.
- Returns:
Reaction File Object.
- Return type:
- get_parents() list[Nuclide]#
Get a list of all parents
- Returns:
list of parents nuclides from all reactions
- Return type:
set[str]
- write(path: PathLike) None#
write formatted reaction file
- Parameters:
path (os.PathLike) – path to the output file (only dir).
- Return type:
None.