Module: DaruLite

Extended by:
Configuration
Defined in:
lib/daru_lite.rb,
lib/daru_lite/io/io.rb,
lib/daru_lite/vector.rb,
lib/daru_lite/version.rb,
lib/daru_lite/category.rb,
lib/daru_lite/dataframe.rb,
lib/daru_lite/core/merge.rb,
lib/daru_lite/core/query.rb,
lib/daru_lite/index/index.rb,
lib/daru_lite/configuration.rb,
lib/daru_lite/core/group_by.rb,
lib/daru_lite/helpers/array.rb,
lib/daru_lite/iruby/helpers.rb,
lib/daru_lite/date_time/index.rb,
lib/daru_lite/formatters/table.rb,
lib/daru_lite/date_time/offsets.rb,
lib/daru_lite/index/multi_index.rb,
lib/daru_lite/io/csv/converters.rb,
lib/daru_lite/io/sql_data_source.rb,
lib/daru_lite/extensions/which_dsl.rb,
lib/daru_lite/accessors/array_wrapper.rb,
lib/daru_lite/index/categorical_index.rb,
lib/daru_lite/maths/arithmetic/vector.rb,
lib/daru_lite/maths/statistics/vector.rb,
lib/daru_lite/accessors/mdarray_wrapper.rb,
lib/daru_lite/accessors/dataframe_by_row.rb,
lib/daru_lite/maths/arithmetic/dataframe.rb,
lib/daru_lite/maths/statistics/dataframe.rb

Overview

Support for a simple query DSL for accessing where(), inspired by gem “squeel”

Defined Under Namespace

Modules: Accessors, ArrayHelper, Category, Configuration, Core, DateTimeIndexHelper, Formatters, IO, IOHelpers, IRuby, Maths, Offsets Classes: CategoricalIndex, DataFrame, DateOffset, DateTimeIndex, Index, MultiIndex, NegativeDateOffset, Vector, WhichQuery

Constant Summary collapse

DAYS_OF_WEEK =
{
  'SUN' => 0,
  'MON' => 1,
  'TUE' => 2,
  'WED' => 3,
  'THU' => 4,
  'FRI' => 5,
  'SAT' => 6
}.freeze
MONTH_DAYS =
{
  1 => 31,
  2 => 28,
  3 => 31,
  4 => 30,
  5 => 31,
  6 => 30,
  7 => 31,
  8 => 31,
  9 => 30,
  10 => 31,
  11 => 30,
  12 => 31
}.freeze
MISSING_VALUES =
[nil, Float::NAN].freeze
SPLIT_TOKEN =
','.freeze
VERSION =
'0.1.1'.freeze

Constants included from Configuration

Configuration::DEFAULT_MAX_ROWS, Configuration::DEFAULT_SPACING, Configuration::INSPECT_OPTIONS_KEYS

Class Attribute Summary collapse

Class Method Summary collapse

Methods included from Configuration

configure, extended, reset_options

Class Attribute Details

.error_streamObject

A variable which will set whether Vector metadata is updated immediately or lazily. Call the #update method every time a values are set or removed in order to update metadata like positions of missing values.



45
46
47
# File 'lib/daru_lite.rb', line 45

def error_stream
  @error_stream
end

.lazy_updateObject

A variable which will set whether Vector metadata is updated immediately or lazily. Call the #update method every time a values are set or removed in order to update metadata like positions of missing values.



45
46
47
# File 'lib/daru_lite.rb', line 45

def lazy_update
  @lazy_update
end

Class Method Details

.create_has_library(library) ⇒ Object



47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# File 'lib/daru_lite.rb', line 47

def create_has_library(library)
  lib_underscore = library.to_s.tr('-', '_')
  define_singleton_method(:"has_#{lib_underscore}?") do
    cv = "@@#{lib_underscore}"
    unless class_variable_defined? cv
      begin
        require library.to_s
        class_variable_set(cv, true)
      rescue LoadError
        # :nocov:
        class_variable_set(cv, false)
        # :nocov:
      end
    end
    class_variable_get(cv)
  end
end

.error(msg) ⇒ Object



65
66
67
# File 'lib/daru_lite.rb', line 65

def error(msg)
  error_stream&.puts msg
end