numo-narray-alt 0.11.3 → 0.12.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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b7fe2db61f420e9d120e010bd9e34bc9f5922c7fc49df6be8a2aca032889c483
|
|
4
|
+
data.tar.gz: 6a8db228589e11376512981a8da2eed248155cc558058c625f6cc90439ad053a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b8dd3b2c04fa09b87357a75a626ed2a10f7d53da4c2a39bc93358745edae562c397acbaa8e503b5bd9483ee47f569c1452734b18c3eb3f35e46bb0d655c4bede
|
|
7
|
+
data.tar.gz: 38089735d3d863a211b4a2fa8dc29c162763a607bafa0cfdd463a4276e31b4278420559257b9fb4b18f95367875ad306950e0963e9a271ae3d3a2c9f9e9f85e7
|
data/ext/numo/narray/narray.c
CHANGED
|
@@ -1262,6 +1262,9 @@ static VALUE nary_s_from_binary(int argc, VALUE* argv, VALUE type) {
|
|
|
1262
1262
|
VALUE vstr, vshape, vna;
|
|
1263
1263
|
VALUE velmsz;
|
|
1264
1264
|
|
|
1265
|
+
if (RTEST(rb_class_inherited_p(type, numo_cRObject))) {
|
|
1266
|
+
rb_raise(rb_eTypeError, "cannot restore %s from binary data", rb_class2name(type));
|
|
1267
|
+
}
|
|
1265
1268
|
narg = rb_scan_args(argc, argv, "11", &vstr, &vshape);
|
|
1266
1269
|
Check_Type(vstr, T_STRING);
|
|
1267
1270
|
str_len = RSTRING_LEN(vstr);
|
|
@@ -1341,6 +1344,9 @@ static VALUE nary_store_binary(int argc, VALUE* argv, VALUE self) {
|
|
|
1341
1344
|
VALUE velmsz;
|
|
1342
1345
|
narray_t* na;
|
|
1343
1346
|
|
|
1347
|
+
if (RTEST(rb_obj_is_kind_of(self, numo_cRObject))) {
|
|
1348
|
+
rb_raise(rb_eTypeError, "cannot store binary data to %s", rb_obj_classname(self));
|
|
1349
|
+
}
|
|
1344
1350
|
narg = rb_scan_args(argc, argv, "11", &vstr, &voffset);
|
|
1345
1351
|
Check_Type(vstr, T_STRING);
|
|
1346
1352
|
str_len = RSTRING_LEN(vstr);
|
|
@@ -1415,6 +1421,9 @@ static VALUE nary_to_binary(VALUE self) {
|
|
|
1415
1421
|
narray_t* na;
|
|
1416
1422
|
int offset_in_bits;
|
|
1417
1423
|
|
|
1424
|
+
if (RTEST(rb_obj_is_kind_of(self, numo_cRObject))) {
|
|
1425
|
+
rb_raise(rb_eTypeError, "cannot convert %s into binary data", rb_obj_classname(self));
|
|
1426
|
+
}
|
|
1418
1427
|
GetNArray(self, na);
|
|
1419
1428
|
if (na->type == NARRAY_VIEW_T) {
|
|
1420
1429
|
offset_in_bits = RTEST(rb_obj_is_kind_of(self, numo_cBit)) && NA_VIEW_OFFSET(na) != 0;
|
|
@@ -1443,7 +1452,7 @@ static VALUE nary_marshal_dump(VALUE self) {
|
|
|
1443
1452
|
rb_ary_push(a, INT2FIX(1)); // version
|
|
1444
1453
|
rb_ary_push(a, na_shape(self));
|
|
1445
1454
|
rb_ary_push(a, INT2FIX(NA_FLAG0(self)));
|
|
1446
|
-
if (
|
|
1455
|
+
if (RTEST(rb_obj_is_kind_of(self, numo_cRObject))) {
|
|
1447
1456
|
narray_t* na;
|
|
1448
1457
|
VALUE* ptr;
|
|
1449
1458
|
size_t offset = 0;
|
|
@@ -1497,7 +1506,7 @@ static VALUE nary_marshal_load(VALUE self, VALUE a) {
|
|
|
1497
1506
|
na_initialize(self, RARRAY_AREF(a, 1));
|
|
1498
1507
|
NA_FL0_SET(self, FIX2INT(RARRAY_AREF(a, 2)));
|
|
1499
1508
|
v = RARRAY_AREF(a, 3);
|
|
1500
|
-
if (
|
|
1509
|
+
if (RTEST(rb_obj_is_kind_of(self, numo_cRObject))) {
|
|
1501
1510
|
narray_t* na;
|
|
1502
1511
|
char* ptr;
|
|
1503
1512
|
if (TYPE(v) != T_ARRAY) {
|
|
@@ -13,10 +13,10 @@ extern "C" {
|
|
|
13
13
|
#endif
|
|
14
14
|
#endif
|
|
15
15
|
|
|
16
|
-
#define NARRAY_VERSION "0.
|
|
16
|
+
#define NARRAY_VERSION "0.12.0"
|
|
17
17
|
#define NARRAY_VERSION_MAJOR 0
|
|
18
|
-
#define NARRAY_VERSION_MINOR
|
|
19
|
-
#define NARRAY_VERSION_PATCH
|
|
18
|
+
#define NARRAY_VERSION_MINOR 12
|
|
19
|
+
#define NARRAY_VERSION_PATCH 0
|
|
20
20
|
#define NARRAY_VERSION_CODE \
|
|
21
21
|
(NARRAY_VERSION_MAJOR * 10000 + NARRAY_VERSION_MINOR * 100 + NARRAY_VERSION_PATCH)
|
|
22
22
|
|
|
@@ -405,7 +405,10 @@ void Init_numo_robject(void) {
|
|
|
405
405
|
/* Stride size of contiguous RObject array. */
|
|
406
406
|
rb_define_const(cT, "CONTIGUOUS_STRIDE", INT2FIX(sizeof(dtype)));
|
|
407
407
|
rb_undef_method(rb_singleton_class(cT), "from_binary");
|
|
408
|
+
rb_undef_method(rb_singleton_class(cT), "from_string");
|
|
409
|
+
rb_undef_method(cT, "store_binary");
|
|
408
410
|
rb_undef_method(cT, "to_binary");
|
|
411
|
+
rb_undef_method(cT, "to_string");
|
|
409
412
|
rb_undef_method(cT, "swap_byte");
|
|
410
413
|
rb_undef_method(cT, "to_network");
|
|
411
414
|
rb_undef_method(cT, "to_vacs");
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: numo-narray-alt
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.12.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- yoshoku
|
|
@@ -214,7 +214,7 @@ licenses:
|
|
|
214
214
|
metadata:
|
|
215
215
|
homepage_uri: https://github.com/yoshoku/numo-narray-alt
|
|
216
216
|
changelog_uri: https://github.com/yoshoku/numo-narray-alt/blob/main/CHANGELOG.md
|
|
217
|
-
documentation_uri: https://gemdocs.org/gems/numo-narray-alt/0.
|
|
217
|
+
documentation_uri: https://gemdocs.org/gems/numo-narray-alt/0.12.0/
|
|
218
218
|
rubygems_mfa_required: 'true'
|
|
219
219
|
post_install_message: |
|
|
220
220
|
===
|