Sha256: cd2f08deb557c491eb16a096b52f55d8d3b6e59a4cd40135ddab6b333f2ae0fe

Contents?: true

Size: 593 Bytes

Versions: 1

Compression:

Stored size: 593 Bytes

Contents

# frozen_string_literal: true

require "matrix"

require "flex_station_data/services/compute_mean"

module FlexStationData
  class Sample
    attr_reader :label, :wells, :plate

    delegate :wells, to: :plate, prefix: true

    def initialize(label, wells, plate)
      @label = label
      @wells = wells
      @plate = plate
    end

    def values
      wells.map(&plate_wells.method(:values))
    end

    def readings
      @readings ||= wells.zip(values).map { |well, v| Readings.new(well, v) }
    end

    def mean
      @mean ||= values.transpose.map(&ComputeMean)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
flex-station-data-1.0.2 lib/flex_station_data/sample.rb