Stream¶
-
class
asdf.Stream(shape, dtype, strides=None)[source]¶ Bases:
asdf.tags.core.ndarray.NDArrayTypeUsed to put a streamed array into the tree.
Examples
Save a double-precision array with 1024 columns, one row at a time:
>>> from asdf import AsdfFile, Stream >>> import numpy as np >>> ff = AsdfFile() >>> ff.tree['streamed'] = Stream([1024], np.float64) >>> with open('test.asdf', 'wb') as fd: ... ff.write_to(fd) ... for i in range(200): ... nbytes = fd.write( ... np.array([i] * 1024, np.float64).tostring())
Attributes Summary
has_required_modulesnamesupported_versionstypesMethods Summary
from_tree(data, ctx)reserve_blocks(data, ctx)to_tree(data, ctx)Attributes Documentation
-
has_required_modules= True¶
-
name= None¶
-
supported_versions= []¶
-
types= []¶
Methods Documentation
-