<commit_before>require 'dm-core'

module DataMapper
  class Property
    class DecimalArray < Object
      accept_options :precision, :scale, :min, :max
      attr_reader :precision, :scale, :min, :max

      def initialize(model, name, options = {})
        super
        @precision = @options.fetch(:precision)
        @scale     = @options.fetch(:scale)

        unless @precision > 0
          raise ArgumentError, "precision must be greater than 0, but was #{@precision.inspect}"
        end
      end


      def load(value)
        value.gsub(/[{}]/,'').split(",").map(&:to_f) if value
      end

      def dump(value)
        "{#{value.join(",")}}" if value
      end
    end # class DecimalArray<commit_msg>small change to decimal array<commit_after>require 'dm-core'

module DataMapper
  class Property
    class DecimalArray < Object
      accept_options :precision, :scale, :min, :max
      attr_reader :precision, :scale, :min, :max

      def initialize(model, name, options = {})
        super
        @precision = @options[:precision] || 10
        @scale     = @options[:scale]     || 0

        unless @precision > 0
          raise ArgumentError, "precision must be greater than 0, but was #{@precision.inspect}"
        end
      end


      def load(value)
        value.gsub(/[{}]/,'').split(",").map(&:to_f) if value
      end

      def dump(value)
        "{#{value.join(",")}}" if value
      end
    end # class DecimalArray
{'fraction_non_alphanumeric': 0.13094417643004824, 'fraction_numerical': 0.004824259131633356, 'mean_word_length': 2.3846153846153846, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '950085', 'n_tokens_mistral': 445, 'n_tokens_neox': 421, 'n_words': 123}