def METHOD_NAME(self, mapping, ts_dest, ts_source):
    for source_num, target_num in mapping.items():
        target_halo = ts_dest.halos.filter_by(halo_number=target_num).first()
        target_halo.NDM = 0
    for source_num, target_num in mapping.items():
        source_halo = ts_source.halos.filter_by(halo_number=source_num).first()
        target_halo = ts_dest.halos.filter_by(halo_number=target_num).first()
        target_halo.NDM += source_halo.NDM