numpy/numpy-stubs

Name: numpy-stubs

Owner: NumPy

Description: Experimental typing stubs for NumPy

Created: 2017-11-22 20:18:31.0

Updated: 2018-05-23 12:18:26.0

Pushed: 2018-05-10 21:34:58.0

Homepage: null

Size: 21

Language: Python

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

numpy-stubs: experimental typing stubs for NumPy

Build Status

This repository exists for developing PEP 484 compatible typing annotations for NumPy.

It will be released as a separate “numpy-stubs” package on PyPI per PEP 561. This will let us iterate rapidly on experimental type annotations without coupling to NumPy's release cycle.

The plan (help wanted!):

  1. Write basic type stubs for numpy.ndarray without dtypes or shapes.
  2. Add support for dtypes in ndarray type-annotations.
  3. This might be as simple as writing np.ndarray[np.float64], but will need a decision about appropriate syntax for shape typing to ensure that this is forwards compatible with typing shapes.
  4. This will likely require minor changes to NumPy itself, e.g., to add ndarray.__class_getitem__ per PEP 560.
  5. Add support for shapes in ndarray type-annotations.
  6. This will first require defining a broader (Python wide) standard for typing array shapes, and likely entail writing a PEP.

Eventually, once development has stabilized, we expect to merge these type stubs into the main NumPy repository.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.