endf6_plumbing

The endf_parserpy.utils.endf6_plumbing module implements convenience functions for common operations on dictionaries with ENDF-6 data, as returned by the parsefile() method of the EndfParserPy class.

endf_parserpy.update_directory(endf_dic, parser=None, lines=None, read_opts=None)[source]

Update the ENDF directory in MF1/MT451.

Parameters:
  • endf_dic (dict) – Dictionary of appropriate structure with ENDF-6 data.

  • parser (EndfParserBase) – An EndfParserBase instance

  • lines (list[str]) – A list of strings with the ENDF-6 formatted data corresponding to the data in endf_dict. If this argument is provided, the parser argument will be ignored.

  • read_opts (dict) – A dictionary with reading options provided as read_opts argument overrides the reading options of the EndfParserBase instance.

endf_parserpy.utils.endf6_plumbing.set_description(endf_dic, text)[source]

Set the description in the MF1/MT451 section.

Updates the DESCRIPTION variable in endf_dic[1][451] and adjusts the corresponding counter variable NWD.

Parameters:
  • endf_dic (dict) – Dictionary with ENDF-6 data

  • text (str) – String with description. Lines with more than 66 characters are trimmed.

endf_parserpy.utils.endf6_plumbing.get_description(endf_dic)[source]

Retrieve the description from MF1/MT451 section.

Parameters:

endf_dic (dict) – Dictionary with ENDF-6 data

Returns:

String with the description extracted from MF1/MT451

Return type:

str

endf_parserpy.utils.endf6_plumbing.insert_description(endf_dic, text, after_line=0)[source]

Insert text in the description in MF1/MT451.

Insert the text provided into the DESCRIPTION in endf_dic[1][451] and adjusts the corresponding counter variable NWD.

Parameters:
  • endf_dic (dict) – Dictionary with ENDF-6 data

  • text (str) – String with text to be inserted.

  • after_line (int) – After which line text should be inserted. after_line=0 inserted the text provided at the very beginning.