<commit_before>export class RelativeConverter {
  convert(input: number[]): number[] {
    const copy: number[] = input.slice(0);

    let previousValue = copy.shift();

    return copy.map(function (value) {
      let result;

      if (previousValue != null && value != null) {
        result = value - previousValue;
      } else {
        result = 0;
      }

      previousValue = value;

      return result;
    });
  }
}<commit_msg>Add workaround for the move to a new house.<commit_after>export class RelativeConverter {
    convert(input: number[]): number[] {
        const copy: number[] = [...input];

        let previousValue = copy.shift();

        return copy.map(function (value) {
            let result;

            if (previousValue != null && value != null) {
                const diff = value - previousValue;

                // This is a bad workaround for moving house:
                // The meter return absolute values, so there's a big difference
                // between the old and new meter.
                // (only visible in the year view, since that's the only
                // view that has old and new measurements in the same view)
                //
                // A downside is that this hides one month of data.
                if (diff < -4400) {
                    result = 0;
                } else {
                    result = diff;
                }
            } else {
                result = 0;
            }

            previousValue = value;

            return result;
        });
    }
}
{'fraction_non_alphanumeric': 0.0975609756097561, 'fraction_numerical': 0.005134788189987163, 'mean_word_length': 1.420807453416149, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5607572', 'n_tokens_mistral': 407, 'n_tokens_neox': 368, 'n_words': 138}