<commit_before>require 'date'
require 'virtus'

class VectorEphemerisTable
  include Enumerable

  def initialize(rows)
    @rows = rows
  end

  def self.new_with_table(rows)
    new(rows.map(&Row.method(:new)))
  end

  def each(&block)
    @rows.each(&block)
  end

  class Row
    include Virtus
    attribute :jdct, Date
    attribute :x, Float
    attribute :y, Float
    attribute :z, Float
    attribute :vx, Float
    attribute :vy, Float
    attribute :vz, Float
    attribute :lt, Float
    attribute :rg, Float
    attribute :rr, Float

    def jdct=(julian)
      super Date.jd(julian.to_f)
    end
  end
end
<commit_msg>Change jdct attribute to DateTime type on EphemerisTable::Row<commit_after>require 'date'
require 'virtus'

class VectorEphemerisTable
  include Enumerable

  def initialize(rows)
    @rows = rows
  end

  def self.new_with_table(rows)
    new(rows.map(&Row.method(:new)))
  end

  def each(&block)
    @rows.each(&block)
  end

  class Row
    include Virtus
    attribute :jdct, DateTime
    attribute :x, Float
    attribute :y, Float
    attribute :z, Float
    attribute :vx, Float
    attribute :vy, Float
    attribute :vz, Float
    attribute :lt, Float
    attribute :rg, Float
    attribute :rr, Float

    def jdct=(julian)
      super Date.jd(julian.to_f)
    end
  end
end

{'fraction_non_alphanumeric': 0.09090909090909091, 'fraction_numerical': 0.0, 'mean_word_length': 2.9550898203592815, 'pattern_counts': {'":': 0, '<': 3, '<?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': '5883167', 'n_tokens_mistral': 460, 'n_tokens_neox': 440, 'n_words': 131}