From 2249731c2f9082ce91055f76785a3df0619583d1 Mon Sep 17 00:00:00 2001 From: Lee Kamentsky Date: Tue, 31 Mar 2015 15:22:49 -0400 Subject: [PATCH] Numpy 1.9 on my Centos build chops int64s into two int32s --- pysrc/cellh5write.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pysrc/cellh5write.py b/pysrc/cellh5write.py index a0347d8..39a7536 100644 --- a/pysrc/cellh5write.py +++ b/pysrc/cellh5write.py @@ -260,9 +260,10 @@ def write(self, t, object_labels): object_labels = object_labels.astype(numpy.int32) - times = numpy.repeat(t, len(object_labels)) + times = numpy.repeat(t, len(object_labels)).astype(numpy.int32) - self.dset[self.offset:self.offset+len(object_labels)] = numpy.c_[times, object_labels].view(dtype=self.dtype).T + self.dset[self.offset:self.offset+len(object_labels)] = \ + numpy.c_[times, object_labels].view(dtype=self.dtype).T self.offset+=len(object_labels) @@ -401,8 +402,8 @@ def write(self, t, c, z): if 1 + self.offset > len(self.dset) : # resize self.dset.resize((1 + self.offset,)) - - self.dset[self.offset:self.offset+1] = numpy.array([self.offset, t,c,z]).view(dtype=self.dtype).T + src = numpy.array([[self.offset, t,c,z]], numpy.int32).view(dtype=self.dtype) + self.dset[self.offset:self.offset+1] = src self.offset+=1