Shape-typing and narrower dtypes for `{lin,log,geom}space`
Open
Nobody has claimed this yet.
stubs: Enhancement
topic: shape-typing
- Dominant language
- Python
- Stars
- 79
- Forks
- 8
- PR merge metrics
- No merged PRs in 30d
Description
Currently,np.linspace(0, 1) is inferred as npt.NDArray[np.floating]. This should be narrowed to np.ndarray[tuple[int], np.dtype[np.float64]].
These three functions live in numpy._core.function_base
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in numpy._core.function_base and inspect the typing for linspace, logspace, and geomspace. Update their inferred return types to use the requested one-dimensional shape and narrower dtype, then verify that the example np.linspace(0, 1) is inferred as np.ndarray[tuple[int], np.dtype[np.float64]].
Written by the indexing model from the issue text.
Assessment
- Tech stack
- numpy, python
- Domain
- developer-experience
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100