Open
Description
I've started a rough prototype for writer support. Currently, it looks like this:
with pyxdf.writer.Writer('/tmp/foo.xdf.gz') as w:
w.add_stream(streamid=1, header='<info><streamname>XYZ</streamname>…</info>')
w.add_stream_data(streamid=1, data=np.array([[1,2],[2,3],[3,4]], ts=np.array([5.1, np.nan, 5.3]))
w.add_stream_offsets(streamid=1, offsets=np.array([[1.0, 5.0], [1.3, 5.3]]))
Goals:
- Acceptable performance in pure Python
- Optional cython-compiled parts
- Full support for the XDF 1.0 spec
Non-goals:
- accept the reader output directly as input
- type conversion (i.e. convert data to the stream's data type; write
str
objects to a string stream) - write everything in C and call a compiled library