Skip to content

Commit

Permalink
Still trying to fix vector datatype problem
Browse files Browse the repository at this point in the history
  • Loading branch information
markgw committed Feb 10, 2020
1 parent b30fa24 commit a0bb3d2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/python/pimlico/datatypes/corpora/floats.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,14 +195,14 @@ class VectorDocumentType(RawDocumentType):
def reader_init(self, reader):
super(VectorDocumentType, self).reader_init(reader)
# Prepare struct for reading in the whole vector
dim = self.metadata["dimensions"]
dim = reader.datatype.metadata["dimensions"]
self.struct = struct.Struct("<" + "d"*dim)
self.value_size = self.struct.size

def writer_init(self, reader):
super(VectorDocumentType, self).writer_init(reader)
def writer_init(self, writer):
super(VectorDocumentType, self).writer_init(writer)
# Prepare struct for writing out the whole vector
dim = self.metadata["dimensions"]
dim = writer.datatype.metadata["dimensions"]
self.struct = struct.Struct("<" + "d"*dim)
self.value_size = self.struct.size

Expand Down

0 comments on commit a0bb3d2

Please sign in to comment.