Special Sub-classes in ACORN

Some of the special C-extension objects that are wrapped by python run into issues with decoration. The poster-child for this is numpy.ndarray. In order to have its instance and special method calls be wrapped, the object needs to be sub-classed using numpy specific method calls and syntax (such as __arraywrap__). For cases such as these, acorn allows a developer to create a special module in acorn.subclass._package, for a special package. Thus, acorn has a special numpy.ndarray subclass in acorn.subclass._numpy. Subclasses are specified in the acorn Global and Package Configuration in ACORN file so that they can be automatically incorporated by the decoration machinery.

numpy Special Sub-class

Module for implementing the difficult case of array sub-classing for numpy. This is necessary because of the C-extension nature of the numpy package and complications with array slices etc. See http://docs.scipy.org/doc/numpy/user/basics.subclassing.html.

class acorn.subclass._numpy.ndarray[source]

Sub-class of numpy.ndarray so that we can implement logging for the instance method and special method calls of array objects.