luca-fiorito-11 / sandy

Sampling nuclear data and uncertainty
MIT License
48 stars 28 forks source link

add delimiters in _get_section_df #318

Closed nplinden closed 4 months ago

nplinden commented 5 months ago

Currently the Endf6._get_section_df method uses the "?" as a default value to transform endf6 file into dataframes. This default argument is never set to other values in the rest of the codebase.

When using sandy to process endf6 files that contain the "?" character, the processing fails. For example, Pu240, Sn117 and Sn124 of JEFF-3.1.1 can't be processed using sandy because they contains "?" in the MF=1 MT=451 block.

This change defines multiples delimiters and tries them all to ensure at least one will work. The last one ¤ is non-ascii and will cause pandas read_csv function to fall back to the slower python engine (rather than the faster c engine), raising a warning. However ascii endf6 should never contain ¤, so this is a safe fallback delimiter to choose.