def _upgrade_chunk_info(chunk_info, improved_chunk_info):
    """Replace chunk info items with better ones while preserving number of dumps."""
    for key, improved_info in improved_chunk_info.items():
        original_info = chunk_info.get(key, improved_info)
        if improved_info['shape'][1:] != original_info['shape'][1:]:
            raise ValueError(
                "Original '{}' array has shape {} while improvedversion has shape {}"
                .format(key, original_info['shape'], improved_info['shape']))
        chunk_info[key] = improved_info
    return chunk_info
