Pickle

CTables and CArrays with rootdirs pickle themselves by their rootdir.


### Example

```Python
In [1]: import bcolz

In [2]: b = bcolz.ctable([[1, 2, 3], [1, 2, 3]], names=['a', 'b'], rootdir='myfile.bcolz')

In [3]: import pickle

In [4]: s = pickle.dumps(b)

In [5]: s
Out[5]: "ccopy_reg\n_reconstructor\np0\n(cbcolz.ctable\nctable\np1\nc__builtin__\nobject\np2\nNtp3\nRp4\n(dp5\nS'_cparams'\np6\ng0\n(cbcolz.toplevel\ncparams\np7\ng2\nNtp8\nRp9\n(dp10\nS'_shuffle'\np11\nI01\nsS'_cname'\np12\nS'blosclz'\np13\nsS'_clevel'\np14\nI5\nsbsS'cols'\np15\ng0\n(cbcolz.ctable\ncols\np16\ng2\nNtp17\nRp18\n(dp19\nS'rootdir'\np20\nS'myfile.bcolz'\np21\nsS'_cols'\np22\n(dp23\nS'a'\np24\ncbcolz.pickle_support\nbuild_carray\np25\n(S'myfile.bcolz/a'\np26\ntp27\nRp28\nsS'b'\np29\ng25\n(S'myfile.bcolz/b'\np30\ntp31\nRp32\nssS'mode'\np33\nS'w'\np34\nsS'names'\np35\n(lp36\ng24\nag29\nasbsS'len'\np37\nI3\nsg20\ng21\nsS'_arr1'\np38\ncnumpy.core.multiarray\n_reconstruct\np39\n(cnumpy\nndarray\np40\n(I0\ntp41\ng29\ntp42\nRp43\n(I1\n(I1\ntp44\ncnumpy\ndtype\np45\n(S'V16'\np46\nI0\nI1\ntp47\nRp48\n(I3\nS'|'\np49\nN(g24\ng29\ntp50\n(dp51\ng24\n(g45\n(S'i8'\np52\nI0\nI1\ntp53\nRp54\n(I3\nS'<'\np55\nNNNI-1\nI-1\nI0\ntp56\nbI0\ntp57\nsg29\n(g54\nI8\ntp58\nsI16\nI1\nI16\ntp59\nbI00\nS'\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x80\\xff\\x7f\\x00\\x00\\x97\\x7f\\x00\\x00'\np60\ntp61\nbsS'attrs'\np62\ng0\n(cbcolz.attrs\nattrs\np63\ng2\nNtp64\nRp65\n(dp66\ng20\ng21\nsS'attrsfile'\np67\nS'myfile.bcolz/__attrs__'\np68\nsg33\ng34\nsg62\n(dp69\nsbsg33\ng34\nsb."

In [6]: b2 = pickle.loads(s)

In [7]: b2
Out[7]: 
ctable((3,), [('a', '<i8'), ('b', '<i8')])
  nbytes: 48; cbytes: 32.00 KB; ratio: 0.00
  cparams := cparams(clevel=5, shuffle=True, cname='blosclz')
  rootdir := 'myfile.bcolz'
[(1, 1) (2, 2) (3, 3)]
```

A couple of development notes

1.  I couldn't get the `MayBeTest` to work for me so I reinvented some things.  Happy to change things if we can figure out what I was doing wrong.
2.  Using `__reduce__` for serialization I had to create a function that was outside of the `.pyx` file, hence the tiny `pickle_support.py` file.  Not sure how you feel about this.

Work done with @hhuuggoo
If these functions could be renamed to `pickle_carray` and `pickle_ctable` I think these could go in utils.py.