<commit_before>require 'lims-core/resource'
require 'lims-laboratory-app/laboratory/tube'
require 'lims-laboratory-app/laboratory/container'

module Lims::LaboratoryApp
  module Laboratory
    class TubeRack
      include Lims::Core::Resource

      is_matrix_of Tube do |p,t|
        Array.new(p.number_of_rows * p.number_of_columns)
      end

      class RackPositionNotEmpty < StandardError
      end

      # Overwrite []= method to add tube in the rack.
      # The value nil needs to be set sometimes, for
      # example when we move physically a tube between
      # racks, the source rack position is then empty.
      # @param [Symbol, String] position in the rack<commit_msg>Add new exception<commit_after>require 'lims-core/resource'
require 'lims-laboratory-app/laboratory/tube'
require 'lims-laboratory-app/laboratory/container'

module Lims::LaboratoryApp
  module Laboratory
    class TubeRack
      include Lims::Core::Resource

      is_matrix_of Tube do |p,t|
        Array.new(p.number_of_rows * p.number_of_columns)
      end

      RackPositionNotEmpty = Class.new(StandardError)
      TubeInAnotherTubeRack = Class.new(StandardError)

      # Overwrite []= method to add tube in the rack.
      # The value nil needs to be set sometimes, for
      # example when we move physically a tube between
      # racks, the source rack position is then empty.
      # @param [Symbol, String] position in the rack
{'fraction_non_alphanumeric': 0.07633053221288516, 'fraction_numerical': 0.0, 'mean_word_length': 3.2529761904761907, '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': '5928702', 'n_tokens_mistral': 440, 'n_tokens_neox': 425, 'n_words': 131}