pydata / pydata/sparse

Allow uint32 dtype for coords

Open
#249 4 comments 2 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

Hey awesome library! I'm really having a blast with it.

One question / comment:

For my purposes, I need the COO array with the largest dtype for coords of uint32.

When I create an array, the COO constructor seems to convert all coord arrays to intp or int64 in my case.
https://github.com/pydata/sparse/blob/master/sparse/coo/core.py#L234

Any thoughts on skipping that astype if coords is already an array?

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 in sparse/coo/core.py at the COO constructor around line 234, where coordinate arrays are converted to intp or int64. Check how an existing uint32 coordinate array is handled and verify that its dtype is preserved without changing behavior for other coordinate inputs. Done means COO accepts uint32 coords without the unwanted conversion.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.