user_tools

endf_parserpy.list_parsed_sections(dic)[source]

List all MF/MT sections that were parsed.

Parameters:

dic (dict) – A dict in the form as returned by the .parsefile() method of the endf_parserpy.endf_parser.EndfParser class.

Returns:

A tuple of tuples with pairs of MF and MT numbers that are available in parsed form. For instance, if MF=1/MT=451 an MF=2/MT=151 were not parsed, the return value would be ((1, 451), (2, 151)).

Return type:

tuple[tuple[int,int]]

endf_parserpy.list_unparsed_sections(dic)[source]

List all MF/MT sections that are not parsed.

Parameters:

dic (dict) – A dict in the form as returned by the parsefile() method of the EndfParser class.

Returns:

A tuple of tuples with pairs of MF and MT numbers that were not parsed. For instance, if MF=1/MT=451 an MF=2/MT=151 were not parsed, the return value would be ((1, 451), (2, 151)).

Return type:

tuple[tuple[int,int]]

endf_parserpy.sanitize_fieldname_types(dic)[source]

Sanitize the keys of a dict object with ENDF-6 data.

The Python dict datatype supports the use of keys of type int whereas hashtable implementations in other language may only allow the use of strings. For example, the JSON format only allows strings as keys. This function recursively replaces all keys containing integer numbers but being of type str to type int.

Noteworthy, this conversion is necessary before using the writefile() method of the EndfParser class if the dictionary with ENDF-6 data has been retrieved from a JSON file.

Parameters:

dic (dict) – A dict-like object.

Returns:

Datatypes are changed in-place in the dict-like object provided as dic argument.

Return type:

None