# Buggy code
def __init__(
    self,
    geometry,
    settings,
    chain_file=None,
    prev_results=None,
    diff_burnable_mats=False,
    fission_q=None,
    dilute_initial=1.0e3,
):
    super().__init__(chain_file, fission_q, dilute_initial, prev_results)
    self.round_number = False
    self.settings = settings
    self.geometry = geometry
    self.diff_burnable_mats = diff_burnable_mats

    if self.prev_res is not None:
        # Reload volumes into geometry
        self.prev_results[-1].transfer_volumes(geometry)

    # Differentiate burnable materials with multiple instances
    if self.diff_burnable_mats:
        self._differentiate_burnable_mats()

    # Clear out OpenMC, create task lists, distribute
    openmc.reset_auto_ids()
    self.burnable_mats, volume, nuclides = self._get_burnable_mats()
    self.local_mats = _distribute(self.burnable_mats)

    # Generate map from local materials => material index
    self._mat_index_map = {lm: self.burnable_mats.index(lm) for lm in self.local_mats}

    # Determine which nuclides have incident neutron data
    self.nuclides_with_data = self._get_nuclides_with_data()

    # Select nuclides with data that are also in the chain
    self._burnable_nucs = [
        nuc.name for nuc in self.chain.nuclides if nuc.name in self.nuclides_with_data
    ]

    # Extract number densities from the geometry / previous depletion run
    self._extract_number(self.local_mats, volume, nuclides, self.prev_res)

    # Create reaction rates array
    self.reaction_rates = ReactionRates(
        self.local_mats, self._burnable_nucs, self.chain.reactions
    )

    # Get classes to assist working with tallies
    self._rate_helper = DirectReactionRateHelper(
        self.reaction_rates.n_nuc, self.reaction_rates.n_react
    )
    self._energy_helper = ChainFissionHelper()


# Traceback (IndexError)
Reading c_H_in_H2O from /home/drew/nndc_hdf5/c_H_in_H2O.h5
Maximum neutron transport energy: 20000000.000000 eV for U235
Reading tallies XML file...
Writing summary.h5 file...
Time to matexp:  0.1556260585784912
Traceback (most recent call last):
File "restart.py", line 20, in <module>
openmc.deplete.integrator.predictor(op, [time_steps[0]], power)
File "/home/drew/openmc/openmc/deplete/integrator/predictor.py", line 100, in predictor
op_results = [operator(x[0], power[-1])]
File "/home/drew/openmc/openmc/deplete/operator.py", line 175, in __call__
self.number.set_density(vec)
File "/home/drew/openmc/openmc/deplete/atom_number.py", line 214, in set_density
self.set_mat_slice(i, density_slice)
File "/home/drew/openmc/openmc/deplete/atom_number.py", line 199, in set_mat_slice
self[mat, :self.n_nuc_burn] = val
File "/home/drew/openmc/openmc/deplete/atom_number.py", line 104, in __setitem__
self.number[mat, nuc] = val
IndexError: index 0 is out of bounds for axis 0 with size 0
Reading I135 from /home/drew/nndc_hdf5/I135.h5
Reading Xe135 from /home/drew/nndc_hdf5/Xe135.h5

# Fixed code
def __init__(
    self,
    geometry,
    settings,
    chain_file=None,
    prev_results=None,
    diff_burnable_mats=False,
    fission_q=None,
    dilute_initial=1.0e3,
):
    super().__init__(chain_file, fission_q, dilute_initial, prev_results)
    self.round_number = False
    self.prev_res = None
    self.settings = settings
    self.geometry = geometry
    self.diff_burnable_mats = diff_burnable_mats

    # Differentiate burnable materials with multiple instances
    if self.diff_burnable_mats:
        self._differentiate_burnable_mats()

    # Clear out OpenMC, create task lists, distribute
    openmc.reset_auto_ids()
    self.burnable_mats, volume, nuclides = self._get_burnable_mats()
    self.local_mats = _distribute(self.burnable_mats)

    # Generate map from local materials => material index
    self._mat_index_map = {lm: self.burnable_mats.index(lm) for lm in self.local_mats}

    if self.prev_res is not None:
        # Reload volumes into geometry
        prev_results[-1].transfer_volumes(geometry)

        # Store previous results in operator
        # Distribute reaction rates according to those tracked
        # on this process
        if comm.size == 1:
            self.prev_res = prev_results
        else:
            self.prev_res = ResultsList()
            mat_indexes = _distribute(range(len(self.burnable_mats)))
            for res_obj in prev_results:
                new_res = res_obj.distribute(self.local_mats, mat_indexes)
                self.prev_res.append(new_res)

    # Determine which nuclides have incident neutron data
    self.nuclides_with_data = self._get_nuclides_with_data()

    # Select nuclides with data that are also in the chain
    self._burnable_nucs = [
        nuc.name for nuc in self.chain.nuclides if nuc.name in self.nuclides_with_data
    ]

    # Extract number densities from the geometry / previous depletion run
    self._extract_number(self.local_mats, volume, nuclides, self.prev_res)

    # Create reaction rates array
    self.reaction_rates = ReactionRates(
        self.local_mats, self._burnable_nucs, self.chain.reactions
    )

    # Get classes to assist working with tallies
    self._rate_helper = DirectReactionRateHelper(
        self.reaction_rates.n_nuc, self.reaction_rates.n_react
    )
    self._energy_helper = ChainFissionHelper()