pydata / pydata/sparse

Support for Fortran order in COO.flatten()

Open
#603 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Python
Stars
668
Forks
141
Avg merge
2d 8h
Merged PRs (30d)
4

Description

Is your feature request related to a problem? Please describe.
I am currently doing a GSoC project for cvxpy and we need to use 3d sparse matrices.
The way we process matrices in the backend (using variables on one axis and constraints on another), it is more intuitive to store the data in column-major format as it makes the problem readable. Hence, we made a design decision to use fortran order for all matrix operations. Currently, we are trying to move from scipy.sparse to using your sparse library and this missing API flag is the main obstacle in doing so.

Describe the solution you'd like
I would like to have flatten in fortran (column major order) for increased compatibility with NumPy.
Another API that is missing and could be nice to have is expand_dims or also atleast_2d.

I would be happy to make a PR for this, if someone could guide me on how to get started.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at COO.flatten() and compare its current behavior with NumPy's flatten order options and the scipy.sparse use case described in the issue. Add coverage for Fortran or column-major ordering, and consider the requested expand_dims and atleast_2d APIs only if their scope is confirmed; done means the flatten behavior matches the requested NumPy-compatible order.

Written by the indexing model from the issue text.

Assessment

Tech stack
numpy, python
Domain
data
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.