numpy / numpy/numpy

ENH: Add infrastructure to simplify unicode/StringDType promoters

Open
#27,671 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
32.8k
Forks
12.8k
Avg merge
1d 7h
Merged PRs (30d)
197

Description

Originally from a comment by @seberg: https://github.com/numpy/numpy/pull/27636#pullrequestreview-2404871051

The one story that I could potentially see is to make something like an abstract (doesn't need to be an actual thing could just be a tuple as in isinstance, but conceptually):

class StringOrUnicodeDType:

so that we could just add one promoter, but the promoter would be need to programmatically decide whether the result should be unicode or string. (Similar to the "this dtype must occur", style of logic. But these ufuncs that include ints show that just a list of dtypes is not super helpful a such)

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

No files or tests are named. Start by locating the existing unicode/StringDType promoters and the ufunc promotion logic, including cases involving integers. Done means establishing infrastructure for a single promoter to choose between string and unicode results, with coverage for the relevant cases.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.