riptable icon indicating copy to clipboard operation
riptable copied to clipboard

Fix for #136

Open jack-pappas opened this issue 4 years ago • 0 comments

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 with type=None -- at least in some cases, doing so before caused an exception to be raised even for a simple FastArray.
  • The Categorical class 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 the Grouping object carried in the _grouping attribute, so if the original Categorical is deleted / cleaned up, the view's Grouping stays intact (vs. sharing the exact same object, where the view would be left with a Grouping that may not be in a usable state after being deleted).

jack-pappas avatar Apr 12 '21 20:04 jack-pappas