ndmanager.IAEASublibrary#
- class ndmanager.IAEASublibrary(kind, library_root, index_node, lib, library, nsub, sublibrary, urls)[source]#
A class to manage a nuclear data sublibrary originating from the IAEA website.
- Raises:
ValueError – If an unknown name style is passed to IAEASublibrary.download
e – Raise errors raised by parallel download of nuclear data files
- Returns:
The sublibrary instance
- Return type:
- download(targetdir, style='nuclide', processes=1)[source]#
Download the all the tapes in the sublibrary to a directory specified by targetdir.
- Parameters:
targetdir (str | Path) – Path to the directory to write the tapes in
style (str, optional) – Style of the tape names. Defaults to “nuclide”. In {‘nuclide’, ‘tsl’, ‘atom’}
processes (int, optional) – Number of download jobs to launch. Defaults to 1.
- Raises:
ValueError – If an unknown name style is passed to IAEASublibrary.download
e – Raise errors raised by parallel download of nuclear data files
- Return type:
None
- download_single(material, targetfile)[source]#
Download an ENDF6 tape for the desired material
- Parameters:
material (str) – The name of the material
targetfile (str | Path) – The path to write the tape to
- Return type:
None
- fetch_tape(material)[source]#
Fetch the content of an ENDF6 tape for the desired material
- Parameters:
material (str) – The name of the material
- Returns:
The content of the tape
- Return type:
str
- classmethod from_website(root, node, kind)[source]#
Constructor to build a sublibrary using IAEA’s website.
- Parameters:
root (str) – Root url of the library
node (str) – Name of the index file in the root directory
kind (str) – The kind of sublibrary (from NSUB)
- Returns:
An IAEASublibrary object
- Return type:
- static insert_separator(string, pos)[source]#
Insert a $ at the pos position in the string.
- Parameters:
string (str) – The base string
pos (int) – The position of the $
- Returns:
A new string with the $ inserted
- Return type:
str
- keys()[source]#
The list of materials in the sublibrary
- Returns:
List of materials in the sublibrary
- Return type:
List[str]
- static parse_index(index, kwargs)[source]#
Parse an sublibrary index from the IAEA website, e.g. https://www-nds.iaea.org/public/download-endf/JEFF-3.3/n-index.htm
- Parameters:
index (List[str]) – The index file lines
kwargs (Dict[str, Any]) – The dictionnary of attributes
- Returns:
The list of material names
- Return type:
List[str]