def set_n_photons(self, initial=None, imaging=None,
                      imaging_sources=None, imaging_dust=None,
                      raytracing_sources=None, raytracing_dust=None,
                      stats=0):
        '''
        Set the number of photons for the different iterations

        Note that any values not specified will be set to the default
        values.

        Parameters
        ----------
        initial : float, optional
            Number of photons for the initial specific energy iterations
        imaging : float, optional
            Number of photons for the main SED/image iteration. This argument
            is used in the case of non-monochromatic radiation transfer.
        imaging_sources : float, optional
            Number of photons emitted from sources during the main SED/image
            iteration in the case of monochromatic radiation transfer.
        imaging_dust : float, optional
            Number of photons emitted from dust during the main SED/image
            iteration in the case of monochromatic radiation transfer.
        raytracing_sources : float, optional
            Number of photons emitted from sources during the raytracing
            SED/image iteration, if applicable.
        raytracing_dust : float, optional
            Number of photons emitted from dust during the raytracing
            SED/image iteration, if applicable.
        stats : float, optional
            How often to print out statistics. Also used to determine the
            photon chunk size for MPI.
        '''

        # Reset number of photons to avoid issues when reading in models
        self.n_photons.clear()

        if self.n_iter == 0:
            if initial is not None:
                raise Exception("[n_photons] initial should not be set since no initial interations are being computed")
            else:
                if self.n_photons in 'initial':
                    del self.n_photons['initial']
        else:
            if initial is None:
                raise Exception("[n_photons] initial should be set since the initial iterations are being computed")
            else:
                self.n_photons['initial'] = initial

        if self.raytracing:
            if raytracing_sources is None:
                raise Exception("[n_photons] raytracing_sources needs to be set in raytracing mode")
            else:
                self.n_photons['raytracing_sources'] = raytracing_sources
            if raytracing_dust is None:
                raise Exception("[n_photons] raytracing_dust needs to be set in raytracing mode")
            else:
                self.n_photons['raytracing_dust'] = raytracing_dust
        else:
            if raytracing_sources is not None:
                raise Exception("[n_photons] raytracing_sources should not be set as raytracing is not being used")
            if raytracing_dust is not None:
                raise Exception("[n_photons] raytracing_dust should not be set as raytracing is not being used")

        if self._monochromatic:
            if imaging_sources is None:
                raise Exception("[n_photons] imaging_sources needs to be set in monochromatic mode")
            else:
                self.n_photons['last_sources'] = imaging_sources
            if imaging_dust is None:
                raise Exception("[n_photons] imaging_dust needs to be set in monochromatic mode")
            else:
                self.n_photons['last_dust'] = imaging_dust
            if imaging is not None:
                raise Exception("[n_photons] imaging should not be set in monochromatic mode")
        else:
            if imaging_sources is not None:
                raise Exception("[n_photons] imaging_sources should not be set as the monochromatic option is not being used")
            if imaging_dust is not None:
                raise Exception("[n_photons] imaging_dust should not be set as the monochromatic option is not being used")
            if imaging is None:
                raise Exception("[n_photons] imaging should bet set")
            else:
                self.n_photons['last'] = imaging

        self.n_photons['stats'] = stats
dataset/ETHPy150Open hyperion-rt/hyperion/hyperion/conf/conf_files.py/RunConf.set_n_photons/swapped operands of `in`