sandialabs / pyttb

Python Tensor Toolbox
https://pyttb.readthedocs.io
BSD 2-Clause "Simplified" License
26 stars 13 forks source link

Remove sptensor.extract() #286

Open dmdunla opened 1 year ago

dmdunla commented 1 year ago

I proposed that we remove sptensor.extract, as the sptensor.__getitem__ functionality should support all of the use cases that we need. Although we proposed to remove sptensor.extract in #160, it is still being used.

Here are the steps that need to be addressed:

The way that the MATLAB TTB sptensor accessor analog to __getitem__ (i.e., subsref) works is to allow users to include an additional input parameter, 'extract' to extract the result as a vector. I think we should stick with the more numpy-like approach and post process the output of __getitem__ when needed.