Skip to content

Commit 4aa099d

Browse files
committed
Drop support for NMatrix
Because it's not maintained.
1 parent 3a24923 commit 4aa099d

File tree

10 files changed

+3
-190
lines changed

10 files changed

+3
-190
lines changed

Diff for: .github/workflows/nmatrix.yml

-71
This file was deleted.

Diff for: README.md

+1-7
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ end
240240
bar.render("sample_images/bar_pyplot.png")
241241
```
242242

243-
Charty also supports Daru::DataFrame, Numo::NArray, NMatrix and ActiveRecord as Data Abstraction Layer.
243+
Charty also supports Daru::DataFrame, Numo::NArray and ActiveRecord as Data Abstraction Layer.
244244
For example.
245245

246246
```ruby
@@ -260,12 +260,6 @@ narray = Numo::DFloat.new(3,5).seq
260260
charty.table = narray
261261

262262

263-
### when NMatrix
264-
require "nmatrix"
265-
nmatrix = NMatrix.new([3, 4], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11], dtype: :int64)
266-
charty.table = nmatrix
267-
268-
269263
### when ActiveRecord
270264
require "active_record"
271265
ActiveRecord::Base.establish_connection(adapter: "sqlite3", database: ":memory:")

Diff for: lib/charty/backends/plotly_helpers/plotly_renderer.rb

-3
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,6 @@ def render(figure)
4242
when ->(x) { defined?(Numo::NArray) && obj.is_a?(Numo::NArray) }
4343
visit_array(obj.to_a)
4444

45-
when ->(x) { defined?(NMatrix) && obj.is_a?(NMatrix) }
46-
visit_array(obj.to_a)
47-
4845
when ->(x) { defined?(Numpy::NDArray) && obj.is_a?(Numpy::NDArray) }
4946
visit_array(obj.to_a)
5047

Diff for: lib/charty/backends/pyplot.rb

+1
Original file line numberDiff line numberDiff line change
@@ -504,6 +504,7 @@ def line(x, y, variables, color:, color_mapper:, size:, size_mapper:, style:, st
504504

505505
x = x.to_a
506506
y = y.to_a
507+
x = x.collect(&:to_s) if x[0].is_a?(Time)
507508
lines = ax.plot(x, y, **kws)
508509

509510
lines.each do |line|

Diff for: lib/charty/table.rb

-2
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,6 @@ def to_a(x=nil, y=nil, z=nil)
9393
table.map(&:to_a)
9494
when defined?(Numo::NArray) && table.kind_of?(Numo::NArray)
9595
table.to_a
96-
when defined?(NMatrix) && table.kind_of?(NMatrix)
97-
table.to_a
9896
when defined?(ActiveRecord::Relation) && table.kind_of?(ActiveRecord::Relation)
9997
if z && x && y
10098
[table.pluck(x), table.pluck(y), table.pluck(z)]

Diff for: lib/charty/table_adapters.rb

-1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,5 @@ def self.find_adapter_class(data)
2121
require_relative 'table_adapters/datasets_adapter'
2222
require_relative 'table_adapters/daru_adapter'
2323
require_relative 'table_adapters/active_record_adapter'
24-
require_relative 'table_adapters/nmatrix_adapter'
2524
require_relative 'table_adapters/pandas_adapter'
2625
require_relative 'table_adapters/arrow_adapter'

Diff for: lib/charty/table_adapters/hash_adapter.rb

+1-5
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def self.array?(data)
3030
when Charty::Vector
3131
true
3232
# TODO: Use vector adapter to detect them:
33-
when Array, method(:daru_vector?), method(:narray_vector?), method(:nmatrix_vector?),
33+
when Array, method(:daru_vector?), method(:narray_vector?),
3434
method(:numpy_vector?), method(:pandas_series?)
3535
true
3636
else
@@ -46,10 +46,6 @@ def self.narray_vector?(x)
4646
defined?(Numo::NArray) && x.is_a?(Numo::NArray) && x.ndim == 1
4747
end
4848

49-
def self.nmatrix_vector?(x)
50-
defined?(NMatrix) && x.is_a?(NMatrix) && x.dim == 1
51-
end
52-
5349
def self.numpy_vector?(x)
5450
defined?(Numpy::NDArray) && x.is_a?(Numpy::NDArray) && x.ndim == 1
5551
end

Diff for: lib/charty/table_adapters/nmatrix_adapter.rb

-67
This file was deleted.

Diff for: lib/charty/vector_adapters.rb

-1
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,6 @@ def index=(values)
205205
require_relative "vector_adapters/arrow_adapter"
206206
require_relative "vector_adapters/daru_adapter"
207207
require_relative "vector_adapters/narray_adapter"
208-
require_relative "vector_adapters/nmatrix_adapter"
209208
require_relative "vector_adapters/numpy_adapter"
210209
require_relative "vector_adapters/pandas_adapter"
211210
require_relative "vector_adapters/vector_adapter"

Diff for: lib/charty/vector_adapters/nmatrix_adapter.rb

-33
This file was deleted.

0 commit comments

Comments
 (0)