human
I am working on the file "AtomAndElement.ipynb".
The first task is:
Now let's do some caching. For this I am relying on numpy.savez and numpy.savez_compressed. I have yet to find a faster way of storing a billion values. Here is the documentation:
http://docs.scipy.org/doc/numpy/reference/generated/numpy.savez.html
I use it in Atom.load and Atom.persist:
I splay columns into individual npz files:
lbrenner@josie:~/buckysoap$ ls cache/sample
one.npz  range.npz  zero.npz

Each Atom's npz file contains data, mask and neccessary bincounts.
 Filemode      Length  Date         Time      File
- ----------  --------  -----------  --------  --------
  -rw-------       160   4-Jun-2015  12:23:08  data.npy
  -rw-------        90   4-Jun-2015  12:23:08  mask.npy
- ----------  --------  -----------  --------  --------
               250                         2 files
Can you write Python code for it?
 ... What is a Python code to find a faster way of storing a billion values?
assistant
#Here is Python code to find a faster way of storing a billion values.

def cache_sample():
    def factory():
        print "Running Factory"
        return bs.Element(name='Sample')(
            range = bs.arange(10),
            zero = bs.zeros(10, int),
            one = bs.ones(10, int))
    return bs.Element(
        name='sample',
        cnames='range,zero,one',
        cachedir='cache/sample',
        factory=factory)

#We are just deleting directory for the sake of demonstration
import os
if os.path.exists('cache/sample'):
    print "Deleting cache/sample"
    import shutil
    shutil.rmtree('cache/sample')
cache_sample().display()
cache_sample().display()