Skip to content

Commit

Permalink
bugfix: byid endian encoding fix
Browse files Browse the repository at this point in the history
  • Loading branch information
fcollman committed Feb 14, 2024
1 parent 987659e commit ca9f066
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions python/neuroglancer/write_annotations.py
Original file line number Diff line number Diff line change
Expand Up @@ -429,12 +429,13 @@ def _serialize_annotations_sharded(self, path, annotations, shard_spec):
txn = ts.Transaction()
for ann in annotations:
# convert the ann.id to a binary representation of a uint64
key = ann.id.to_bytes(8, "little")
# key = ann.id.to_bytes(8, "little")
key = np.ascontiguousarray(ann.id, dtype=">u8").tobytes()
value = ann.encoded
for related_ids in ann.relationships:
value += struct.pack("<I", len(related_ids))
for related_id in related_ids:
value += related_id.to_bytes(8, "little")
value += struct.pack("<Q", related_id)
dataset.with_transaction(txn)[key] = value
txn.commit_async().result()

Expand Down

0 comments on commit ca9f066

Please sign in to comment.