Code indexing in gitaly is broken and leads to code not being visible to the user. We work on the issue with highest priority.

Skip to content
Snippets Groups Projects
Commit c493c516 authored by ulrich_y's avatar ulrich_y
Browse files

2: Added vegas record reader in re #17

parent 46aeac2c
No related branches found
No related tags found
No related merge requests found
import numpy as np
import matplotlib.pyplot as plt
from vegas import importvegas
import struct
def read_record(fp, typ):
l1 = struct.unpack("<I", fp.read(4))[0]
body = fp.read(l1)
l2 = struct.unpack("<I", fp.read(4))[0]
if l1 != l2:
raise KeyError("Record is not properly close %d v %d" % (l1, l2))
n = l1 / struct.calcsize(typ)
body = struct.unpack("<"+typ*n, body)
if typ == 'c':
return ''.join(body)
else:
if n == 1:
return body[0]
else:
return body
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment