numpy / numpy/numpy

What should be the calling convention for ufunc inner loop signatures?

Open
#12,518 34 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

01 - Enhancement 23 - Wish List component: numpy.dtype component: numpy.ufunc
Dominant language
Python
Stars
32.8k
Forks
12.8k
Avg merge
1d 7h
Merged PRs (30d)
197

Description

Mentioned in a bunch of places, but would be valuable to have a single place to track this.

To be able to reuse an inner loop across multiple dtypes (ie across variable-length strings, structured arrays, etc), we need access to the dtype object within the inner loop.

Perhaps we can achieve this by adding a new npy_bool innerloop_takes_dtype flag to ufuncs, which when set indicates that the inner loop signature now also takes a PyArray_Descr **dtypes argument.

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 file or test is named. Start by locating the existing ufunc inner-loop signatures and the places where this calling convention is discussed. Done would be a documented, agreed convention for accessing dtype objects, including whether a flag and an additional dtypes argument are required.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, python
Domain
backend-api-design
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.