riptable
riptable copied to clipboard
Fix for #136
This change fixes issue #136 by utilizing the FastArray._view_internal() method to create the view on FastArray (and derived types) arrays rather than calling the inherited ndarray.view() method which doesn't copy over the additional data needed by some array types.
This PR also includes a couple of related / prerequisite fixes:
- The
FastArray._view_internal()method better handles the case where it's called withtype=None-- at least in some cases, doing so before caused an exception to be raised even for a simpleFastArray. - The
Categoricalclass now implements an override of the_view_internal()method, which allows it to make use of it's own.copy()method to make a shallow copy. This is effectively making a view but importantly it also shallow-copies theGroupingobject carried in the_groupingattribute, so if the originalCategoricalis deleted / cleaned up, the view'sGroupingstays intact (vs. sharing the exact same object, where the view would be left with aGroupingthat may not be in a usable state after being deleted).