bx.binned_array module

Numeric arrays stored as individually compressed blocks on disk, allowing pseudo-random acccess.

BinnedArray is used to build such an array in memory and save it to disk. BinnedArrayWriter can instead be used when creating the array sequentially (does not require keeping all data in memory). FileBinnedArray provides read only access to an on disk binned array.

class bx.binned_array.BinnedArray(bin_size=524288, default=nan, max_size=536870912, typecode='f')

Bases: object

get(key)
get_bin_offset(index)
get_range(start, end)
init_bin(index)
set(key, value)
to_file(f, comp_type='zlib')
class bx.binned_array.BinnedArrayWriter(f, bin_size=524288, default=nan, max_size=536870912, typecode='f', comp_type='zlib')

Bases: object

finish()
flush()
skip()
write(data)
write_header()
write_index()
class bx.binned_array.FileBinnedArray(f, cache=32)

Bases: object

get(key)
get_bin_offset(index)
get_range(start, end)
load_bin(index)
bx.binned_array.bytesify(s)
bx.binned_array.read_packed(f, pattern)
bx.binned_array.write_packed(f, pattern, *vals)