daru_lite 0.3.4 → 0.3.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (142) hide show
  1. checksums.yaml +4 -4
  2. data/History.md +60 -0
  3. data/README.md +1 -1
  4. data/lib/daru_lite/category.rb +1 -1
  5. data/lib/daru_lite/date_time/index.rb +2 -2
  6. data/lib/daru_lite/maths/statistics/vector.rb +1 -1
  7. data/lib/daru_lite/version.rb +1 -1
  8. data/lib/daru_lite.rb +1 -0
  9. metadata +54 -284
  10. data/.github/ISSUE_TEMPLATE/bug_report.md +0 -38
  11. data/.github/ISSUE_TEMPLATE/feature_request.md +0 -20
  12. data/.github/dependabot.yml +0 -11
  13. data/.github/workflows/ci.yml +0 -33
  14. data/.gitignore +0 -10
  15. data/.rspec +0 -2
  16. data/.rubocop.yml +0 -27
  17. data/.rubocop_todo.yml +0 -139
  18. data/CONTRIBUTING.md +0 -47
  19. data/Gemfile +0 -2
  20. data/Rakefile +0 -69
  21. data/ReleasePolicy.md +0 -20
  22. data/benchmarks/TradeoffData.csv +0 -65
  23. data/benchmarks/csv_reading.rb +0 -22
  24. data/benchmarks/dataframe_creation.rb +0 -39
  25. data/benchmarks/db_loading.rb +0 -33
  26. data/benchmarks/duplicating.rb +0 -45
  27. data/benchmarks/group_by.rb +0 -32
  28. data/benchmarks/joining.rb +0 -52
  29. data/benchmarks/row_access.rb +0 -41
  30. data/benchmarks/row_assign.rb +0 -36
  31. data/benchmarks/sorting.rb +0 -51
  32. data/benchmarks/statistics.rb +0 -28
  33. data/benchmarks/vector_access.rb +0 -31
  34. data/benchmarks/vector_assign.rb +0 -42
  35. data/benchmarks/where_clause.rb +0 -48
  36. data/benchmarks/where_vs_filter.rb +0 -28
  37. data/daru_lite.gemspec +0 -54
  38. data/daru_lite_test-shm +0 -0
  39. data/daru_lite_test-wal +0 -0
  40. data/images/README.md +0 -5
  41. data/images/con0.png +0 -0
  42. data/images/con1.png +0 -0
  43. data/images/init0.png +0 -0
  44. data/images/init1.png +0 -0
  45. data/images/man0.png +0 -0
  46. data/images/man1.png +0 -0
  47. data/images/man2.png +0 -0
  48. data/images/man3.png +0 -0
  49. data/images/man4.png +0 -0
  50. data/images/man5.png +0 -0
  51. data/images/man6.png +0 -0
  52. data/profile/_base.rb +0 -23
  53. data/profile/df_to_a.rb +0 -10
  54. data/profile/filter.rb +0 -13
  55. data/profile/joining.rb +0 -13
  56. data/profile/sorting.rb +0 -12
  57. data/profile/vector_each_with_index.rb +0 -9
  58. data/profile/vector_new.rb +0 -9
  59. data/spec/accessors/array_wrapper_spec.rb +0 -3
  60. data/spec/category_spec.rb +0 -1767
  61. data/spec/core/group_by_spec.rb +0 -655
  62. data/spec/core/merge_spec.rb +0 -179
  63. data/spec/core/query_spec.rb +0 -347
  64. data/spec/daru_lite_spec.rb +0 -22
  65. data/spec/data_frame/aggregatable_example.rb +0 -65
  66. data/spec/data_frame/buildable_example.rb +0 -109
  67. data/spec/data_frame/calculatable_example.rb +0 -135
  68. data/spec/data_frame/convertible_example.rb +0 -180
  69. data/spec/data_frame/duplicatable_example.rb +0 -134
  70. data/spec/data_frame/fetchable_example.rb +0 -510
  71. data/spec/data_frame/filterable_example.rb +0 -456
  72. data/spec/data_frame/indexable_example.rb +0 -221
  73. data/spec/data_frame/iterable_example.rb +0 -481
  74. data/spec/data_frame/joinable_example.rb +0 -131
  75. data/spec/data_frame/missable_example.rb +0 -47
  76. data/spec/data_frame/pivotable_example.rb +0 -297
  77. data/spec/data_frame/queryable_example.rb +0 -92
  78. data/spec/data_frame/setable_example.rb +0 -513
  79. data/spec/data_frame/sortable_example.rb +0 -368
  80. data/spec/dataframe_spec.rb +0 -1342
  81. data/spec/date_time/data_spec.rb +0 -197
  82. data/spec/date_time/date_time_index_helper_spec.rb +0 -72
  83. data/spec/date_time/index_spec.rb +0 -588
  84. data/spec/date_time/offsets_spec.rb +0 -465
  85. data/spec/extensions/which_dsl_spec.rb +0 -38
  86. data/spec/fixtures/bank2.dat +0 -200
  87. data/spec/fixtures/boolean_converter_test.csv +0 -5
  88. data/spec/fixtures/countries.json +0 -7794
  89. data/spec/fixtures/duplicates.csv +0 -32
  90. data/spec/fixtures/eciresults.html +0 -394
  91. data/spec/fixtures/empties.dat +0 -2
  92. data/spec/fixtures/empty_rows_test.csv +0 -17
  93. data/spec/fixtures/macau.html +0 -3691
  94. data/spec/fixtures/macd_data.csv +0 -150
  95. data/spec/fixtures/matrix_test.csv +0 -100
  96. data/spec/fixtures/moneycontrol.html +0 -6812
  97. data/spec/fixtures/music_data.tsv +0 -2501
  98. data/spec/fixtures/repeated_fields.csv +0 -7
  99. data/spec/fixtures/sales-funnel.csv +0 -18
  100. data/spec/fixtures/scientific_notation.csv +0 -4
  101. data/spec/fixtures/string_converter_test.csv +0 -5
  102. data/spec/fixtures/strings.dat +0 -2
  103. data/spec/fixtures/test_xls.xls +0 -0
  104. data/spec/fixtures/test_xls_2.xls +0 -0
  105. data/spec/fixtures/url_test.txt~ +0 -0
  106. data/spec/fixtures/valid_markup.html +0 -62
  107. data/spec/fixtures/wiki_climate.html +0 -1243
  108. data/spec/fixtures/wiki_table_info.html +0 -631
  109. data/spec/formatters/table_formatter_spec.rb +0 -137
  110. data/spec/helpers_spec.rb +0 -8
  111. data/spec/index/categorical_index_spec.rb +0 -289
  112. data/spec/index/index_spec.rb +0 -438
  113. data/spec/index/multi_index_spec.rb +0 -752
  114. data/spec/io/io_spec.rb +0 -357
  115. data/spec/io/sql_data_source_spec.rb +0 -48
  116. data/spec/iruby/dataframe_spec.rb +0 -170
  117. data/spec/iruby/helpers_spec.rb +0 -49
  118. data/spec/iruby/multi_index_spec.rb +0 -37
  119. data/spec/iruby/vector_spec.rb +0 -105
  120. data/spec/maths/arithmetic/dataframe_spec.rb +0 -148
  121. data/spec/maths/arithmetic/vector_spec.rb +0 -165
  122. data/spec/maths/statistics/dataframe_spec.rb +0 -191
  123. data/spec/maths/statistics/vector_spec.rb +0 -756
  124. data/spec/monkeys_spec.rb +0 -42
  125. data/spec/shared/vector_display_spec.rb +0 -213
  126. data/spec/spec_helper.rb +0 -87
  127. data/spec/support/database_helper.rb +0 -29
  128. data/spec/support/matchers.rb +0 -5
  129. data/spec/vector/aggregatable_example.rb +0 -27
  130. data/spec/vector/calculatable_example.rb +0 -82
  131. data/spec/vector/convertible_example.rb +0 -126
  132. data/spec/vector/duplicatable_example.rb +0 -48
  133. data/spec/vector/fetchable_example.rb +0 -463
  134. data/spec/vector/filterable_example.rb +0 -165
  135. data/spec/vector/indexable_example.rb +0 -201
  136. data/spec/vector/iterable_example.rb +0 -111
  137. data/spec/vector/joinable_example.rb +0 -25
  138. data/spec/vector/missable_example.rb +0 -88
  139. data/spec/vector/queryable_example.rb +0 -91
  140. data/spec/vector/setable_example.rb +0 -300
  141. data/spec/vector/sortable_example.rb +0 -242
  142. data/spec/vector_spec.rb +0 -599
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f09114a32c50e38bfbf8d224919b444a820db2998e46443aa89a999fa856f8f5
4
- data.tar.gz: 0c27255f631de63d92d01b576cf42e3880e7453e8d20edfcda3969cea6f32ce3
3
+ metadata.gz: de64da6dbfe4a00b302051ee625c0d093a622e96df55b4199481d19c75c2f552
4
+ data.tar.gz: 908e11700ff1e8c2df635ea99747edbd2f8550d82962e6bc9fa79223d21e6462
5
5
  SHA512:
6
- metadata.gz: f9afdb5835447f5de2af1e7dba83592a8fb5dc4c6981f388609b3408386d03de69ad7a3382e53830d0636d522c462a2b43e988dd38336b67531d8a3ac2e4041a
7
- data.tar.gz: a47dfc18efa0b88bd6eaf1179b0cb9d6edf9e054124ee6606f857885862af7c2324c06d23dff4e8b585ff9084c394c8e5d1fb9c29a5f3a3e7b73374888ecac8a
6
+ metadata.gz: eff5b0aac5a75ae43482fc40c046f43e95fb58704dad16795dd878e29b0667d4f2918db835c7934199c89460d8196e12ad781aa679d0d74e61558c24a2fa23fc
7
+ data.tar.gz: 860fcdb0a648c535b21a963d06453bc4ce761886ad5fa505587f3e17eae9639dfcc2043be1f3231708daeb86b5b256443541c904225c3d119c1340dac5774334
data/History.md CHANGED
@@ -1,3 +1,63 @@
1
+ # 0.3.5
2
+ * Declared `csv` and `matrix` as runtime dependencies
3
+ * Fixed `Vector#standardize`, `Vector#to_json` and `DataFrame#to_json` raising `NoMethodError` when ActiveSupport is not loaded
4
+ * Required Ruby 3.4 or later
5
+ * Stopped packaging specs, fixtures, benchmarks and images in the gem
6
+ * CI now runs on Ruby 3.4 and 4.0
7
+
8
+ # 0.3.4 (2026-07-20)
9
+ * Fixed latently-broken `CategoricalIndex` methods relying on `@relation_hash`
10
+ * Fixed DataFrame operations on a `MultiIndex` with duplicate tuples
11
+
12
+ # 0.3.3 (2026-07-01)
13
+ * Fixed `keep_vector_if` `TypeError` on a `MultiIndex` with duplicate tuples, preserving the vectors' index type
14
+
15
+ # 0.3.2 (2026-06-12)
16
+ * Fixed `NoMethodError` on single-key lookup with a `CategoricalIndex`
17
+
18
+ # 0.3.1 (2026-04-17)
19
+ * Raise `IndexError` on duplicate (row, column) pairs when using `crosstab_by_assignation`
20
+
21
+ # 0.3.0 (2026-04-14)
22
+ * Preserve `nil` rows when using `crosstab_by_assignation`
23
+
24
+ # 0.2.4 (2026-04-10)
25
+ * Updated rubocop and fixed offenses
26
+
27
+ # 0.2.3 (2026-03-27)
28
+ * Fixed regression when accessing a `MultiIndex` vector with an array among the arguments
29
+
30
+ # 0.2.2 (2026-03-27)
31
+ * Fixed regression when accessing a `MultiIndex` with an array among the arguments
32
+
33
+ # 0.2.1 (2026-03-26)
34
+ * Fixed `DataFrame#union` and row subsets via `#[]` when using a `MultiIndex`
35
+ * Dropped Code Climate
36
+
37
+ # 0.2.0 (2025-04-21)
38
+ * Updated dependencies
39
+ * [Breaking change] Dropped DBI
40
+ * [Security] Fixed polynomial ReDoS
41
+
42
+ # 0.1.3 (2024-09-09)
43
+ * Fixed `DataFrame#keep_row_if`, `Index#to_a` and `MultiIndex#delete_at`
44
+
45
+ # 0.1.2 (2024-09-05)
46
+ * Split the `DataFrame` and `Vector` classes into modules
47
+ * Fixed `rotate_vectors` with vectors of mixed classes
48
+ * Fixed `keep_row_if` for categorical indexes
49
+
50
+ # 0.1.1 (2024-02-26)
51
+ * First version of the daru Lite readme
52
+ * Fixed `inspect` when vector names are integers
53
+ * Fixed `order=` when vectors are of different classes
54
+
55
+ # 0.1.0 (2024-02-16)
56
+ * Renamed the gem to daru_lite
57
+ * Dropped gruff
58
+ * Added `DataFrame#rotate_vectors!` and `DataFrame#add_level_to_vectors`
59
+ * Added column to categorical index conversion
60
+
1
61
  # 0.0.1
2
62
  * Forked from Daru
3
63
  * Fixed incompatibilities with Ruby 3.1
data/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Simple, straightforward DataFrames for Ruby
4
4
 
5
- [![Build Status](https://github.com/pollandroll/daru_lite/actions/workflows/build.yml/badge.svg)](https://github.com/pollandroll/daru_lite/actions)
5
+ [![Build Status](https://github.com/pollandroll/daru_lite/actions/workflows/ci.yml/badge.svg)](https://github.com/pollandroll/daru_lite/actions)
6
6
  [![Gem Version](https://img.shields.io/gem/v/daru_lite.svg)](https://rubygems.org/gems/daru_lite)
7
7
 
8
8
  ## Introduction
@@ -766,7 +766,7 @@ module DaruLite
766
766
  return if ordered?
767
767
 
768
768
  raise ArgumentError, "Can not apply #{operation} when vector is unordered. " \
769
- 'To make the categorical data ordered, use #ordered = true' \
769
+ 'To make the categorical data ordered, use #ordered = true'
770
770
  end
771
771
 
772
772
  def dummy_coding(full)
@@ -260,8 +260,8 @@ module DaruLite
260
260
  @offset =
261
261
  case opts[:freq]
262
262
  when :infer then Helper.infer_offset(data)
263
- when nil then nil
264
- else Helper.offset_from_frequency(opts[:freq])
263
+ when nil then nil
264
+ else Helper.offset_from_frequency(opts[:freq])
265
265
  end
266
266
 
267
267
  @frequency = @offset&.freq_string
@@ -554,7 +554,7 @@ module DaruLite
554
554
  def standardize(use_population = false)
555
555
  m ||= mean
556
556
  sd = use_population ? sdp : sds
557
- return DaruLite::Vector.new([nil] * size) if m.nil? || sd.to_d == BigDecimal('0.0')
557
+ return DaruLite::Vector.new([nil] * size) if m.nil? || sd.nil? || sd.zero?
558
558
 
559
559
  vector_standardized_compute m, sd
560
560
  end
@@ -1,3 +1,3 @@
1
1
  module DaruLite
2
- VERSION = '0.3.4'.freeze
2
+ VERSION = '0.3.5'.freeze
3
3
  end
data/lib/daru_lite.rb CHANGED
@@ -73,6 +73,7 @@ require 'matrix'
73
73
  require 'forwardable'
74
74
  require 'erb'
75
75
  require 'date'
76
+ require 'json'
76
77
 
77
78
  require 'daru_lite/version'
78
79