Hello, I am trying to replicate the Gamma detector example from here:
I get the error (‘NoneType’ object has no attribute p) and if I just leave the .p out (which I don’t get in the first place) I get the error (unsupported operand type(s) for *: 'NoneType and ‘float’).
I also replaced the simple chain file by “chain_endfb71_pwr” but I don’t think this is where the problem comes from. Any ideas? The error comes from the very last lines of source_2_Cs137 and source_2_Ba137 definition.
Honestly I ran the example with only changing the chain file to the one you are using and I got it to run properly with only warnings on the use of openmc.Source, as this has been switched to IndependentSource in newest versions, but this is only a naming warning not an error. You’re right that the chain file shouldn’t matter as long as it has photon information, which if this was the issue it would directly tell you that photon info was missing for that isotope. The file you are using contains this data and shouldn’t be a problem. I would double check that you copied things over perfectly, and depending on your method of running the code there might be a syntax issue occurring. Also for this issue that line of code is only summing the probabilities of photon emissions from Cs-137 to Ba-137m since this is the only decay mode of Cs-137 that emits photons, which occurs when Ba-137m decays to Ba-137. If you can’t get the code to work for whatever reason you can just search these values up and sum them yourself and input it into the code as a float.