red-arrow-pycall 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 368f8d37b4b408f129398fa4e57b135a5ed72a14
4
- data.tar.gz: 472cd44043698b07eb185048c2fd55ab3f20173b
3
+ metadata.gz: cf65599f0a91aa12e9f93971e981e01b0e83807b
4
+ data.tar.gz: 8c9c6cd4a9d052560a85f9e03334cfcc97895e35
5
5
  SHA512:
6
- metadata.gz: ff937cfea30d55e0f6dee3569a916ec84a761147bbd1b7c5a0c90f0553f0f20b550be1eb73ec28b7a63ffdde6bfa9c3b47120a9e14c908070ec39889f50837ab
7
- data.tar.gz: f66582aae7c4075d63c95c88182b97883ffd06d727a8a97bc608535e011e67b4e7da1ee2914e993d57934009386d21aab047c9193682d19b90c5ba65dda55e1c
6
+ metadata.gz: cefa69198ad06b139bf67c82459335ca2f6774f75e09d3776c404ca8c94a18700a8d1d5f82361a445e10ea0ad90f01cf15a548c0d5453b4d5484911e95059f4d
7
+ data.tar.gz: a541e339f38555aa5300cf144800e509ceca9be610bbc1fc01cf5f3bb1fb7586b363487e4c7805fdae5dc543be725975a66b1d5c29fe96d29a92283b987c8cac
data/doc/text/news.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # News
2
2
 
3
+ ## 0.0.2 - 2017-07-08
4
+
5
+ ### Fixes
6
+
7
+ * Added a missing source file.
8
+
3
9
  ## 0.0.1 - 2017-07-08
4
10
 
5
11
  Initial release!!!
@@ -0,0 +1,184 @@
1
+ /*
2
+ * Copyright 2017 Kouhei Sutou <kou@clear-code.com>
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ #include <arrow-glib/arrow-glib.hpp>
18
+
19
+ #include <rbgobject.h>
20
+
21
+ #include <arrow/python/pyarrow.h>
22
+
23
+ extern "C" void Init_arrow_pycall(void);
24
+
25
+ static VALUE
26
+ rb_arrow_buffer_to_python_object_pointer(VALUE self)
27
+ {
28
+ auto buffer = GARROW_BUFFER(RVAL2GOBJ(self));
29
+ auto arrow_buffer = garrow_buffer_get_raw(buffer);
30
+ auto py_buffer = arrow::py::wrap_buffer(arrow_buffer);
31
+ return LONG2NUM((long)(py_buffer));
32
+ }
33
+
34
+ static VALUE
35
+ rb_arrow_data_type_to_python_object_pointer(VALUE self)
36
+ {
37
+ auto data_type = GARROW_DATA_TYPE(RVAL2GOBJ(self));
38
+ auto arrow_data_type = garrow_data_type_get_raw(data_type);
39
+ auto py_data_type = arrow::py::wrap_data_type(arrow_data_type);
40
+ return LONG2NUM((long)(py_data_type));
41
+ }
42
+
43
+ static VALUE
44
+ rb_arrow_field_to_python_object_pointer(VALUE self)
45
+ {
46
+ auto field = GARROW_FIELD(RVAL2GOBJ(self));
47
+ auto arrow_field = garrow_field_get_raw(field);
48
+ auto py_field = arrow::py::wrap_field(arrow_field);
49
+ return LONG2NUM((long)(py_field));
50
+ }
51
+
52
+ static VALUE
53
+ rb_arrow_schema_to_python_object_pointer(VALUE self)
54
+ {
55
+ auto schema = GARROW_SCHEMA(RVAL2GOBJ(self));
56
+ auto arrow_schema = garrow_schema_get_raw(schema);
57
+ auto py_schema = arrow::py::wrap_schema(arrow_schema);
58
+ return LONG2NUM((long)(py_schema));
59
+ }
60
+
61
+ static VALUE
62
+ rb_arrow_array_to_python_object_pointer(VALUE self)
63
+ {
64
+ auto array = GARROW_ARRAY(RVAL2GOBJ(self));
65
+ auto arrow_array = garrow_array_get_raw(array);
66
+ auto py_array = arrow::py::wrap_array(arrow_array);
67
+ return LONG2NUM((long)(py_array));
68
+ }
69
+
70
+ static VALUE
71
+ rb_arrow_tensor_to_python_object_pointer(VALUE self)
72
+ {
73
+ auto tensor = GARROW_TENSOR(RVAL2GOBJ(self));
74
+ auto arrow_tensor = garrow_tensor_get_raw(tensor);
75
+ auto py_tensor = arrow::py::wrap_tensor(arrow_tensor);
76
+ return LONG2NUM((long)(py_tensor));
77
+ }
78
+
79
+ static VALUE
80
+ rb_arrow_column_to_python_object_pointer(VALUE self)
81
+ {
82
+ auto column = GARROW_COLUMN(RVAL2GOBJ(self));
83
+ auto arrow_column = garrow_column_get_raw(column);
84
+ auto py_column = arrow::py::wrap_column(arrow_column);
85
+ return LONG2NUM((long)(py_column));
86
+ }
87
+
88
+ static VALUE
89
+ rb_arrow_table_to_python_object_pointer(VALUE self)
90
+ {
91
+ auto table = GARROW_TABLE(RVAL2GOBJ(self));
92
+ auto arrow_table = garrow_table_get_raw(table);
93
+ auto py_table = arrow::py::wrap_table(arrow_table);
94
+ return LONG2NUM((long)(py_table));
95
+ }
96
+
97
+ static VALUE
98
+ rb_arrow_record_batch_to_python_object_pointer(VALUE self)
99
+ {
100
+ auto record_batch = GARROW_RECORD_BATCH(RVAL2GOBJ(self));
101
+ auto arrow_record_batch = garrow_record_batch_get_raw(record_batch);
102
+ auto py_record_batch = arrow::py::wrap_record_batch(arrow_record_batch);
103
+ return LONG2NUM((long)(py_record_batch));
104
+ }
105
+
106
+ extern "C" void
107
+ Init_arrow_pycall(void)
108
+ {
109
+ arrow::py::import_pyarrow();
110
+
111
+ VALUE rbArrow = rb_const_get(rb_cObject, rb_intern("Arrow"));
112
+
113
+ {
114
+ VALUE rbArrowBuffer = rb_const_get(rbArrow, rb_intern("Buffer"));
115
+ rb_define_method(rbArrowBuffer,
116
+ "to_python_object_pointer",
117
+ (VALUE(*)(ANYARGS))rb_arrow_buffer_to_python_object_pointer,
118
+ 0);
119
+ }
120
+
121
+ {
122
+ VALUE rbArrowDataType = rb_const_get(rbArrow, rb_intern("DataType"));
123
+ rb_define_method(rbArrowDataType,
124
+ "to_python_object_pointer",
125
+ (VALUE(*)(ANYARGS))rb_arrow_data_type_to_python_object_pointer,
126
+ 0);
127
+ }
128
+
129
+ {
130
+ VALUE rbArrowField = rb_const_get(rbArrow, rb_intern("Field"));
131
+ rb_define_method(rbArrowField,
132
+ "to_python_object_pointer",
133
+ (VALUE(*)(ANYARGS))rb_arrow_field_to_python_object_pointer,
134
+ 0);
135
+ }
136
+
137
+ {
138
+ VALUE rbArrowSchema = rb_const_get(rbArrow, rb_intern("Schema"));
139
+ rb_define_method(rbArrowSchema,
140
+ "to_python_object_pointer",
141
+ (VALUE(*)(ANYARGS))rb_arrow_schema_to_python_object_pointer,
142
+ 0);
143
+ }
144
+
145
+ {
146
+ VALUE rbArrowArray = rb_const_get(rbArrow, rb_intern("Array"));
147
+ rb_define_method(rbArrowArray,
148
+ "to_python_object_pointer",
149
+ (VALUE(*)(ANYARGS))rb_arrow_array_to_python_object_pointer,
150
+ 0);
151
+ }
152
+
153
+ {
154
+ VALUE rbArrowTensor = rb_const_get(rbArrow, rb_intern("Tensor"));
155
+ rb_define_method(rbArrowTensor,
156
+ "to_python_object_pointer",
157
+ (VALUE(*)(ANYARGS))rb_arrow_tensor_to_python_object_pointer,
158
+ 0);
159
+ }
160
+
161
+ {
162
+ VALUE rbArrowColumn = rb_const_get(rbArrow, rb_intern("Column"));
163
+ rb_define_method(rbArrowColumn,
164
+ "to_python_object_pointer",
165
+ (VALUE(*)(ANYARGS))rb_arrow_column_to_python_object_pointer,
166
+ 0);
167
+ }
168
+
169
+ {
170
+ VALUE rbArrowTable = rb_const_get(rbArrow, rb_intern("Table"));
171
+ rb_define_method(rbArrowTable,
172
+ "to_python_object_pointer",
173
+ (VALUE(*)(ANYARGS))rb_arrow_table_to_python_object_pointer,
174
+ 0);
175
+ }
176
+
177
+ {
178
+ VALUE rbArrowRecordBatch = rb_const_get(rbArrow, rb_intern("RecordBatch"));
179
+ rb_define_method(rbArrowRecordBatch,
180
+ "to_python_object_pointer",
181
+ (VALUE(*)(ANYARGS))rb_arrow_record_batch_to_python_object_pointer,
182
+ 0);
183
+ }
184
+ }
@@ -13,5 +13,5 @@
13
13
  # limitations under the License.
14
14
 
15
15
  module ArrowPyCall
16
- VERSION = "0.0.1"
16
+ VERSION = "0.0.2"
17
17
  end
@@ -38,7 +38,7 @@ Gem::Specification.new do |spec|
38
38
  spec.files = ["README.md", "Rakefile", "Gemfile", "#{spec.name}.gemspec"]
39
39
  spec.files += [".yardopts"]
40
40
  spec.files += Dir.glob("lib/**/*.rb")
41
- spec.files += Dir.glob("ext/**/*.c")
41
+ spec.files += Dir.glob("ext/**/*.{c,cpp}")
42
42
  spec.files += Dir.glob("doc/text/*")
43
43
  spec.extensions = ["ext/arrow-pycall/extconf.rb"]
44
44
  spec.test_files += Dir.glob("test/**/*")
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: red-arrow-pycall
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kouhei Sutou
@@ -140,6 +140,7 @@ files:
140
140
  - Rakefile
141
141
  - doc/text/apache-2.0.txt
142
142
  - doc/text/news.md
143
+ - ext/arrow-pycall/arrow-pycall.cpp
143
144
  - ext/arrow-pycall/extconf.rb
144
145
  - lib/arrow-pycall.rb
145
146
  - lib/arrow-pycall/convertable.rb