numpy 0.2.0 → 0.3.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3f7facf03a56ffeb9d488d44d60ad0f1ee3f6b5ee35a41b88e2753a57b667401
4
- data.tar.gz: a8d6d1f2fa1fac3b237c11c55f54a5754e922095b187eb112dce0737d97f97af
3
+ metadata.gz: '08e0b6b70b4a54e1eeff1046f3cdb8edfb59b2e10718bcfaf739660af0dd9418'
4
+ data.tar.gz: 356e3fcf60046142282b71aa11c3fe0976389155a26e65390ed6401b30af6516
5
5
  SHA512:
6
- metadata.gz: 6f04a5ed346cf3362fb55d2890119cbffd632e388629179d354f9a5481364938d023776a8b84872f9432365606c0260dfa6f3b98ae3c390670ae718dae3a7dd8
7
- data.tar.gz: 220339ccdc215061b4c682224205fa199ebbcdcec163e5b189bc0d92a429fdf6892fc2230909bd754a1de4488e865b78a02f683c9b3cbb55db4017fad1983361
6
+ metadata.gz: 603dbf1b5d7a89a649f4ac074735c4d12ad4af1a565dd7c6ce4e82fa4c927c9059e18b102aaa6e44e2c49a59918c079a894aaf9fc463b521ed4f3a1b6c239eae
7
+ data.tar.gz: 9d723c03c0012ea111569b84f8f3d9af4b4a5ebffe09c98e5eec036935d2849140b661112a876f8366a2168267a0690d09fdd00ca09a8db34e24145084240ef2
@@ -0,0 +1,100 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - master
7
+ pull_request:
8
+ types:
9
+ - opened
10
+ - synchronize
11
+ - reopened
12
+
13
+ jobs:
14
+ test:
15
+ name: ${{ matrix.os }}/${{ matrix.ruby }}/${{ matrix.python }}-${{ matrix.python_architecture }}
16
+ runs-on: ${{ matrix.os }}
17
+
18
+ strategy:
19
+ fail-fast: false
20
+ matrix:
21
+ os:
22
+ - ubuntu-20.04
23
+ - macos-latest
24
+ ruby:
25
+ - "3.0"
26
+ - 2.7
27
+ - 2.6
28
+ - 2.5
29
+ - 2.4
30
+ python:
31
+ - 3.x
32
+ - 2.x
33
+ python_architecture:
34
+ - x64
35
+ include:
36
+ - { os: ubuntu-20.04 , ruby: 2.7 , python: 3.8 }
37
+ - { os: ubuntu-20.04 , ruby: 2.7 , python: 3.7 }
38
+ - { os: ubuntu-20.04 , ruby: 2.7 , python: 3.6 }
39
+ - { os: ubuntu-18.04 , ruby: 2.7 , python: 3.8 }
40
+
41
+ steps:
42
+ - uses: actions/checkout@v2
43
+ with:
44
+ fetch-depth: 1
45
+
46
+ - uses: ruby/setup-ruby@v1
47
+ if: matrix.ruby_version != 'master-nightly'
48
+ with:
49
+ ruby-version: ${{ matrix.ruby }}
50
+
51
+ - uses: actions/setup-python@v2
52
+ with:
53
+ python-version: ${{ matrix.python }}
54
+ architecture: ${{ matrix.python_architecture }}
55
+
56
+ - run: pip install --user numpy
57
+
58
+ - run: bundle install
59
+
60
+ - run: bundle exec rake
61
+ env:
62
+ PYTHON: python
63
+
64
+ conda:
65
+ name: conda:${{ matrix.os }}/${{ matrix. ruby }}/${{ matrix.python }}
66
+ runs-on: ${{ matrix.os }}
67
+
68
+ strategy:
69
+ fail-fast: false
70
+ matrix:
71
+ os:
72
+ - ubuntu-20.04
73
+ - macos-latest
74
+ ruby:
75
+ - "3.0"
76
+ python:
77
+ - 3.8
78
+
79
+ steps:
80
+ - uses: actions/checkout@v2
81
+ with:
82
+ fetch-depth: 1
83
+
84
+ - uses: ruby/setup-ruby@v1
85
+ if: matrix.ruby_version != 'master-nightly'
86
+ with:
87
+ ruby-version: ${{ matrix.ruby }}
88
+
89
+ - uses: s-weigand/setup-conda@v1
90
+ with:
91
+ python-version: ${{ matrix.python }}
92
+
93
+ - run: conda install numpy
94
+
95
+ - run: bundle install
96
+
97
+ - run: bundle exec rake
98
+ env:
99
+ PYTHON: python
100
+
data/CHANGES.md CHANGED
@@ -1,3 +1,7 @@
1
+ # 0.3.0
2
+
3
+ * Add `Numpy::NDArray#to_a`
4
+
1
5
  # 0.2.0
2
6
 
3
7
  * Support scalar type conversion
data/Rakefile CHANGED
@@ -1,6 +1,15 @@
1
- require "bundler/gem_tasks"
2
- require "rspec/core/rake_task"
1
+ require "bundler/gem_helper"
3
2
 
4
- RSpec::Core::RakeTask.new(:spec)
3
+ base_dir = File.join(File.dirname(__FILE__))
5
4
 
6
- task :default => :spec
5
+ helper = Bundler::GemHelper.new(base_dir)
6
+ helper.install
7
+
8
+ desc "Run tests"
9
+ task :test do
10
+ cd(base_dir) do
11
+ ruby("test/run-test.rb")
12
+ end
13
+ end
14
+
15
+ task default: :test
data/lib/numpy/ndarray.rb CHANGED
@@ -6,5 +6,20 @@ module Numpy
6
6
  def [](*index)
7
7
  Conversion.to_ruby(super)
8
8
  end
9
+
10
+ def to_a
11
+ recursive_to_a(tolist)
12
+ end
13
+
14
+ private def recursive_to_a(list)
15
+ list.to_a.collect! {|l|
16
+ case l
17
+ when PyCall::List
18
+ recursive_to_a(l)
19
+ else
20
+ l
21
+ end
22
+ }
23
+ end
9
24
  end
10
25
  end
data/lib/numpy/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Numpy
2
- VERSION = "0.2.0"
2
+ VERSION = "0.3.0"
3
3
  end
data/numpy.gemspec CHANGED
@@ -23,7 +23,7 @@ Gem::Specification.new do |spec|
23
23
 
24
24
  spec.add_dependency "pycall", ">= 1.2.0.beta1"
25
25
 
26
- spec.add_development_dependency "bundler", ">= 1.17.2"
26
+ spec.add_development_dependency "bundler"
27
27
  spec.add_development_dependency "rake"
28
- spec.add_development_dependency "rspec"
28
+ spec.add_development_dependency "test-unit"
29
29
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: numpy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kenta Murata
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-04-25 00:00:00.000000000 Z
11
+ date: 2021-04-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pycall
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: 1.17.2
33
+ version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: 1.17.2
40
+ version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rake
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -53,7 +53,7 @@ dependencies:
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
- name: rspec
56
+ name: test-unit
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - ">="
@@ -73,6 +73,7 @@ executables: []
73
73
  extensions: []
74
74
  extra_rdoc_files: []
75
75
  files:
76
+ - ".github/workflows/ci.yml"
76
77
  - ".gitignore"
77
78
  - ".rspec"
78
79
  - ".travis.yml"
@@ -109,7 +110,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
109
110
  - !ruby/object:Gem::Version
110
111
  version: '0'
111
112
  requirements: []
112
- rubygems_version: 3.0.3
113
+ rubygems_version: 3.2.3
113
114
  signing_key:
114
115
  specification_version: 4
115
116
  summary: Numpy wrapper for Ruby