numpy / numpy/numpy

MAINT: Post UFunc refactor check-list

Open
#19,544 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

A task-list of possible or necessary post UFunc refactor cleanups:

  • The ufunc cache can currently grow indefinitely, in practice it probably doesn't matter, but if someone writes a hypothesis test for a SciPy ufunc with 4 inputs, the explosion of input DType combination could become problematic.
    • Either needs a hard maximum cache size, or a smart caching scheme (or both).
  • The PR does not address weak promotion. Making this only accessible through the legacy path, and only as the old-style "value-based" promotion at this time. It would be nice to fix this, but it is probably cleaner to do so after we attempt getting rid of value-based casting in (currently a TODO: we need to special case scalars here comment in ufunc_object.c). (See also https://github.com/numpy/numpy/pull/19384#discussion_r675224885)

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 by reviewing the unchecked ufunc cache item and the value-based promotion TODO in ufunc_object.c. Trace the existing ufunc cache behavior and the post-refactor context referenced in the checklist. Done means resolving the cache-growth concern or documenting a justified decision, with the checklist updated.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, python
Domain
performance
Issue type
Refactor
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.