<commit_before>require 'byebug'
require 'twitter'
require 'active_support/time'


class Forecast

    @temp = nil
    @wind = nil
    @pcpType = nil
    @pop     = nil
    @dateTime = nil
    @zone = nil

    def initialize(line)
        @zone = ActiveSupport::TimeZone.new("Eastern Time (US & Canada)")
    # From the 7th line (current), record the temperature (14th column T) and precipiration (5th column)
    # See http://dd.weather.gc.ca/nowcasting/doc/README_nowcasting_prevision-immediate.txt
        parts = line.split('|')
        @temp = parts[12].strip.to_i
        @pcpType = parts[3].strip
        @wind = parts[15].strip.to_i

        dateTimeStr = parts[0].strip
        @dateTime = DateTime.strptime("#{dateTimeStr} +0000", "%Y%m%d %H%M %z")

        @pcpType = 'none' if @pcpType.nil? or @pcpType.empty?


        ## Lets find the maximum POP of all 3 POP types
        @pop = [
            parts[4].strip.to_i,
            parts[6].strip.to_i,
            parts[8].strip.to_i,
            parts[9].strip.to_i,
        ].max

        #debugger
        #nil
    end


    def windChill()
        # See https://en.wikipedia.org/wiki/Wind_chill#North_American_and_United_Kingdom_wind_chill_index
        if (@temp <= 10 and @wind > 4.8)
            return [(13.12 + 0.6215*@temp - 11.37*@wind**0.16 + 0.3965*@temp*@wind**0.16).round, @temp].min
        else
            return @temp<commit_msg>replaced pop with column 9 only<commit_after>require 'byebug'
require 'twitter'
require 'active_support/time'


class Forecast

    @temp = nil
    @wind = nil
    @pcpType = nil
    @pop     = nil
    @dateTime = nil
    @zone = nil

    def initialize(line)
        @zone = ActiveSupport::TimeZone.new("Eastern Time (US & Canada)")
    # From the 7th line (current), record the temperature (14th column T) and precipiration (5th column)
    # See http://dd.weather.gc.ca/nowcasting/doc/README_nowcasting_prevision-immediate.txt
        parts = line.split('|')
        @temp = parts[12].strip.to_i
        @pcpType = parts[3].strip
        @wind = parts[15].strip.to_i

        dateTimeStr = parts[0].strip
        @dateTime = DateTime.strptime("#{dateTimeStr} +0000", "%Y%m%d %H%M %z")

        @pcpType = 'none' if @pcpType.nil? or @pcpType.empty?


        ## Lets find the maximum POP of all 3 POP types
        @pop = [
            #parts[4].strip.to_i,
            #parts[6].strip.to_i,
            #parts[8].strip.to_i,
            parts[9].strip.to_i,
        ].max

        #debugger
        #nil
    end


    def windChill()
        # See https://en.wikipedia.org/wiki/Wind_chill#North_American_and_United_Kingdom_wind_chill_index
        if (@temp <= 10 and @wind > 4.8)
            return [(13.12 + 0.6215*@temp - 11.37*@wind**0.16 + 0.3965*@temp*@wind**0.16).round, @temp].min
        else
            return @temp
{'fraction_non_alphanumeric': 0.13641170250264364, 'fraction_numerical': 0.03348607684173423, 'mean_word_length': 2.23972602739726, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 2, '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': '3334346', 'n_tokens_mistral': 1056, 'n_tokens_neox': 969, 'n_words': 212}