user_tools
- endf_parserpy.list_parsed_sections(dic)[source]
List all MF/MT sections that were parsed.
- Parameters:
dic (dict) – A
dictin the form as returned by the.parsefile()method of theendf_parserpy.endf_parser.EndfParserclass.- 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:
- endf_parserpy.list_unparsed_sections(dic)[source]
List all MF/MT sections that are not parsed.
- Parameters:
dic (dict) – A
dictin the form as returned by the.parsefile()method of theendf_parserpy.endf_parser.EndfParserclass.- 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:
- endf_parserpy.sanitize_fieldname_types(dic)[source]
Sanitize the keys of a
dictobject with ENDF-6 data.The Python
dictdatatype supports the use of keys of typeintwhereas 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 typestrto typeint.Noteworthy, this conversion is necessary before using the
.writefilemethod of theendf_parserpy.endf_parser.EndfParserclass if the dictionary with ENDF-6 data has been retrieved from a JSON file.- Parameters:
dic (dict) – A
dict_likeobject.- Returns:
Datatypes are changed in-place in the
dict_likeobject provided asdicargument.- Return type:
None