def scale_to_peak(self, df, peak, scale_time_res=True):
        # Normalize to (0, 1), then multiply by the desired maximum,
        # scaling this peak according to time_res
        if scale_time_res:
            adjustment = self.get_timeres()
        else:
            adjustment = 1
        if peak < 0:
            scale = float(df.min())
        else:
            scale = float(df.max())
        return (df / scale) * peak * adjustment
Call the ``interpformat`` binary with the given input.
dataset/ETHPy150Open calliope-project/calliope/calliope/core.py/Model.scale_to_peak--crossover with--dataset/ETHPy150Open nltk/nltk/nltk/inference/mace.py/MaceCommand._call_interpformat