IAEA-NDS / endf-parserpy

Python package for reading, writing, verifying and translating ENDF-6 formatted files
Other
9 stars 4 forks source link

Sequential numbers over 99999 #6

Closed marquezj closed 1 month ago

marquezj commented 2 months ago

I recently found that ENDF-parserpy goes beyond column 80 when the sequential number is above 99999. The solution in NJOY is to go back to 1. I am not sure if that is a proper solution, but at least it works within the 80 columns.

One possibility could be to make the sequential numbers optional in endf_parserpy.EndfParser.write() and endf_parserpy.EndfParser.writefile().

gschnabel commented 1 month ago

I recently found that ENDF-parserpy goes beyond column 80 when the sequential number is above 99999. The solution in NJOY is to go back to 1. I am not sure if that is a proper solution, but at least it works within the 80 columns.

The same strategy for dealing with sequential numbers has been implemented with fa8317a in the EndfParser class and with 728b302 for the C++ parser.

One possibility could be to make the sequential numbers optional in endf_parserpy.EndfParser.write() and endf_parserpy.EndfParser.writefile().

I think this feature is useful in its own right. I've added an include_linenum argument to the EndfParser constructor to let the user control the addition of sequential numbers (fafc3f6). The same option is implemented for the C++ parser and associated EndfParserCpp class with 1b353df.