Any way to prevent modifications to content of a ndarray subclass?
Looks like the answer is:
np.ndarray.setflags(write=False)
I am creating various classes for computational geometry that all subclass numpy.ndarray.  The DataCloud class, which is typical of these classes, has Python properties (for example, convex_hull, delaunay_trangulation) that would be time consuming and wasteful to calculate more than once. I want to do calculations once and only once.  Also, just in time, because for a given instance, I might not need a given property at all.  It is easy enough to set this up by setting self.__convex_hull = None in the constructor and, if/when the convex_hull property is called, doing the required calculation, setting self.__convex_hull, and returning the calculated value.
The problem is that once any of those complicated properties is invoked, any changes to the contents made, external to my subclass, by the various numpy (as opposed to DataCloud subclass) methods will invalidate all the calculated properties, and I won't know about it.  For example, suppose external code simply does this to the instance: datacloud[3,8] = 5.  So is there any way to either (1) make the ndarray base class read-only once any of those properties is calculated or (2) have ndarray set some indicator that there has been a change to its contents (which for my purposes makes it dirty), so that then invoking any of the complex properties will require recalculation?