<commit_before>require "decoplan/algorithm"
require "decoplan/dive_profile"

module Decoplan
  class Algorithm
    class Buhlmann < Algorithm
      attr_accessor :lo
      attr_accessor :hi

      attr_accessor :compartments

      N2HALF = [ 4.0, 5.0, 8.0, 12.5, 18.5, 27.0, 38.3, 54.3, 77.0, 109.0, 146.0, 187.0, 239.0, 305.0, 390.0, 498.0, 635.0 ]

      name :buhlmann, :zhl16b

      def initialize(_profile, lo: 100, hi: 100)
        @lo = lo
        @hi = hi
      end

      def compute
        reset_compartments!
        deco_profile = DiveProfile.new
        apply_profile(deco_profile)
        compute_deco(deco_profile)
        deco_profile
      end

      def reset_compartments!
        @compartments = (0..15).map { 0.79 }
      end

      private

      def apply_profile(deco_profile)
        profile.levels.each do |level|
          deco_profile.level level
        end
      end

      def compute_deco(_deco_profile)
      end
<commit_msg>need to call the superclass<commit_after>require "decoplan/algorithm"
require "decoplan/dive_profile"

module Decoplan
  class Algorithm
    class Buhlmann < Algorithm
      attr_accessor :lo
      attr_accessor :hi

      attr_accessor :compartments

      N2HALF = [ 4.0, 5.0, 8.0, 12.5, 18.5, 27.0, 38.3, 54.3, 77.0, 109.0, 146.0, 187.0, 239.0, 305.0, 390.0, 498.0, 635.0 ]

      name :buhlmann, :zhl16b

      def initialize(profile, lo: 100, hi: 100)
        super
        @lo = lo
        @hi = hi
      end

      def compute
        reset_compartments!
        deco_profile = DiveProfile.new
        apply_profile(deco_profile)
        compute_deco(deco_profile)
        deco_profile
      end

      def reset_compartments!
        @compartments = (0..15).map { 0.79 }
      end

      private

      def apply_profile(deco_profile)
        profile.levels.each do |level|
          deco_profile.level level
        end
      end

      def compute_deco(_deco_profile)
      end

{'fraction_non_alphanumeric': 0.09132888660851719, 'fraction_numerical': 0.0728578758337609, 'mean_word_length': 2.018575851393189, 'pattern_counts': {'":': 0, '<': 5, '<?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': '4719720', 'n_tokens_mistral': 801, 'n_tokens_neox': 678, 'n_words': 159}