Update read_mod.py for mcnp5 and tally8 - #7
Conversation
Hi , i download release file and chose directory but it couldnt detect my mcnp5 outputs and tally 8 , and show me error like this "Name off processed file: o007.out
Traceback (most recent call last):
File "D:\Downloads\Compressed\MCNP_TallyPlotter-0.8.4\MCNP_TallyPlotter-0.8.4\modules\read_mod.py", line 250, in read_tally
if energy[0] > cutoff_en:
^^^^^^^^^
UnboundLocalError: cannot access local variable 'cutoff_en' where it is not associated with a value
Read process crash for this file: o007.out"
so with hlep of git copliot i solved this problem and now to works with my mcnp5 outputs but i dont know why original developer disabled some codes for tally 8 , i enabled one of them also so the fix work, the next codes for tally 8 still disabled.
|
Hi, For example: do all F8 tallies include a zero bin and an epsilon bin? I believe these were originally subtracted during visualization, but I’m not entirely sure if that’s the correct approach. If you can give me a brief explanation, I’d be happy to revise that part accordingly. Also, thank you for the info about the file names. I don’t think I’ve ever tested names like that before, so I’m not surprised it failed, but the fix should be straightforward. |
|
Hi again , sorry for delay, cell 7 |
1.Fix the bug of one additional zero for tally f8 . 2. add new feature that generate separate excel files of outputs with their own name
|
Hi there. Fix: Removed the overwriting line and adjusted the skip from +2 to +1. This correctly skips only the zero-energy epsilon bin, while the existing cutoff-prepend logic provides the proper 0 MeV lower bound for the first bin. The same fix was applied to the multi-item tally loop. Both plot and Excel output now show one clean zero at the start of the spectrum as expected. New feature — Export tallies to separate xlsx files A new "Export to separate xlsx" button has been added. It asks for an output directory, groups the selected tallies by their source output file, and writes one .xlsx per output named after the original file (e.g. Anif5.xlsx). The original single-file export button is unchanged. Files changed: modules/read_mod.py, modules/export_mod.py, mcnp_tally_plot_main.py |
Added a new export feature that allows users to export selected tallies to separate .xlsx files based on their source output files, while keeping the original export functionality unchanged.
Hi , i download release file and chose directory but it couldnt detect my mcnp5 outputs and tally 8 , and show me error like this "Name off processed file: o007.out Traceback (most recent call last):
File "D:\Downloads\Compressed\MCNP_TallyPlotter-0.8.4\MCNP_TallyPlotter-0.8.4\modules\read_mod.py", line 250, in read_tally
if energy[0] > cutoff_en:
^^^^^^^^^
UnboundLocalError: cannot access local variable 'cutoff_en' where it is not associated with a value Read process crash for this file: o007.out"
so with hlep of git copliot i solved this problem and now to works with my mcnp5 outputs but i dont know why original developer disabled some codes for tally 8 , i enabled one of them also so the fix work, the next codes for tally 8 can still be disabled. thank you for this great app.
ps: files that their name is pure number like 1.txt , cant be plotted.