Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove sptensor.extract() #286

Open
2 tasks
dmdunla opened this issue Nov 2, 2023 · 0 comments
Open
2 tasks

Remove sptensor.extract() #286

dmdunla opened this issue Nov 2, 2023 · 0 comments
Labels
capability New capability/functionality
Milestone

Comments

@dmdunla
Copy link
Collaborator

dmdunla commented Nov 2, 2023

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:

  • Replace use of sptensor.extract with use of sptensor.__getitem__. Note that the output of extract for sparse tensors with 1 nonzero returns numpy.ndarray, whereas __getitem__ was recently changed to return a scalar in this case.
  • Replace use of sptensor.extract in sptensor.__getitem__.

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.

@dmdunla dmdunla added the capability New capability/functionality label Nov 2, 2023
@dmdunla dmdunla added this to the v2.0 milestone Nov 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
capability New capability/functionality
Projects
None yet
Development

No branches or pull requests

1 participant