Mgxs generation post process issue

Dear support team,

I am referring to a mgxs generation example from the example git [here]. This example works fine if I run the simulation and post process on the same jupyter notebook. But, if I run the simulation on a separate file and post process on a different notebook by calling the statepoint of the simulation and do the load_from_statepoint(sp) function, I get NameError message. For example, for total xs it will be like this NameError: name ‘total’ is not defined.

I think the name is not defined in the tallies xml even if I did:
total = mgxs.TotalXS(domain=cell, energy_groups=groups)

tallies = openmc.Tallies()
tallies += total.tallies.values()
model.tallies = tallies

Did I miss something here, or is it a bug?

Thanks,
Yohannes

If you divide the example jupyter notebook into two parts and run them individually, you will meet with “undefined” error just as shown in your description. Please carefully define the variables before they are being used in each script.