import time


def reset_metrics_for_epoch(metrics, mode):
    """
    Resets the running and batch-specific metrics for a new epoch.
    """
    metrics[mode]["epoch-drmsd-full"] = metrics[mode]["batch-drmsd-full"] = 0
    metrics[mode]["epoch-lndrmsd-full"] = metrics[mode]["batch-lndrmsd-full"] = 0
    metrics[mode]["epoch-mse-full"] = metrics[mode]["batch-mse-full"] = 0
    metrics[mode]["epoch-combined-full"] = metrics[mode]["batch-combined-full"] = 0
    metrics[mode]["epoch-rmsd-full"] = metrics[mode]["batch-rmsd-full"] = 0

    metrics[mode]["epoch-drmsd-bb"] = metrics[mode]["batch-drmsd-bb"] = 0
    metrics[mode]["epoch-lndrmsd-bb"] = metrics[mode]["batch-lndrmsd-bb"] = 0
    metrics[mode]["epoch-mse-sc"] = metrics[mode]["batch-mse-sc"] = 0
    metrics[mode]["epoch-mse-bb"] = metrics[mode]["batch-mse-bb"] = 0

    metrics[mode]["batch-history"] = []
    metrics[mode]["batch-time"] = time.time()
    metrics[mode]["speed-history"] = []
    metrics["n_batches"] = 0
    return metrics