Can't seem to merge tallies

Hi all,

I’m trying to merge two tallies from separate runs of the same simulation. Firstly, just to check my understanding, am I right to believe that “merging” tallies means to combine the tallies in such a way that, for example, if tally 1 used 4000 neutrons and tally 2 used 2000, the merged tally is the same (except for randomness) as if a single 6000-neutron simulation had been run?

If so, I’m running into the following problem: when I run tally1.can_merge(tally2) I get True. However, when I run tally1.merge(tally2), I run into the following error: -

File "/home/[...]/openmc/tallies.py", line 370, in mean
    self._mean = self.sum / self.num_realizations
                 ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
TypeError: unsupported operand type(s) for /: 'NoneType' and 'int'

I’ve traced the error back further, and it seems to relate to either the sum never being evaluated (so keeping its initial value as None), or the _sp_filename never getting set (which leads sum to evaluate to None).

Please may you tell me, am I doing something wrong here, or is this a bug?
Thanks