<class '_rdf_utils.numpy.array'> cannot be pickled using shelve. This is unusual as other ROOT types, e.g., TH1F, can be. If possible, it would be convenient if this feature were incorporated. Demonstration follows.
Upfront some technical details: We had to wrap the numpy array because we attach the reference to the according C++ backend to the Python object (see obj.result_ptr). If you do [np.array(val) for _, val in ar.iteritems()], you lose this connection and the underlying C++ object would go out of scope if ar goes out of scope. So in your workaround, take care of not losing ar!
Regarding the direct pickling issues: I’ll have a look at this tomorrow! I think we can simply forward the pickling feature of the underlying numpy array through the wrapper since we don’t want to pickle the reference to the C++ object anyway.
You are welcome! A possible solution is now implemented here:
The issue is actually that pickle breaks if you rename the class object in python. We renamed the class from ndarray to numpy.array to hide the wrapping as good as possible. Probably we will just remove the renaming and pickle works again. We will discuss the best solution in the linked GitHub PR.