Skip to content

Commit b483d36

Browse files
authored
remove jumbled from format, fix broken version string, cast iso to in… (#22)
* remove jumbled from format, fix broken version string, cast iso to int header. * remove jumbled from format... * oops, left busted is_jumbled read.
1 parent 3db168a commit b483d36

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

suitesparse_graphblas/io/binary.py

+4-7
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ def readinto_new_buffer(f, typ, size, allocator=stdlib.malloc):
4141
size: {size}
4242
type: {type}
4343
iso: {iso}
44-
jumbled: {jumbled}
4544
{comments}
4645
"""
4746

@@ -239,8 +238,8 @@ def binwrite(A, filename, comments=None, opener=Path.open):
239238

240239
suitesparse_version = (
241240
f"v{lib.GxB_IMPLEMENTATION_MAJOR}."
242-
"{lib.GxB_IMPLEMENTATION_MINOR}."
243-
"{lib.GxB_IMPLEMENTATION_SUB}"
241+
f"{lib.GxB_IMPLEMENTATION_MINOR}."
242+
f"{lib.GxB_IMPLEMENTATION_SUB}"
244243
)
245244

246245
vars = dict(
@@ -253,8 +252,7 @@ def binwrite(A, filename, comments=None, opener=Path.open):
253252
format=fmt_string,
254253
size=typesize[0],
255254
type=_ss_typenames[matrix_type[0]],
256-
iso=is_iso[0],
257-
jumbled=is_jumbled[0],
255+
iso=int(is_iso[0]),
258256
comments=comments,
259257
)
260258
header_content = header_template.format(**vars)
@@ -276,7 +274,6 @@ def binwrite(A, filename, comments=None, opener=Path.open):
276274
fwrite(buff(typecode, sizeof("int32_t")))
277275
fwrite(buff(typesize, sizeof("size_t")))
278276
fwrite(buff(is_iso, sizeof("bool")))
279-
fwrite(buff(is_jumbled, sizeof("bool")))
280277

281278
if is_hyper:
282279
Ap_size[0] = (nvec[0] + 1) * Isize
@@ -406,7 +403,7 @@ def binread(filename, opener=Path.open):
406403
typecode = frombuff("int32_t*", fread(sizeof("int32_t")))
407404
typesize = frombuff("size_t*", fread(sizeof("size_t")))
408405
is_iso = frombuff("bool*", fread(sizeof("bool")))
409-
is_jumbled = frombuff("bool*", fread(sizeof("bool")))
406+
is_jumbled = ffi.new("bool*", 0)
410407

411408
by_row = format[0] == lib.GxB_BY_ROW
412409
by_col = format[0] == lib.GxB_BY_COL

0 commit comments

Comments
 (0)