Skip to content
This repository was archived by the owner on Feb 17, 2021. It is now read-only.

Acs 2 #105

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Acs 2 #105

Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion numpy-stubs/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,7 @@ class ndarray(Generic[_DType]):
self,
key: Union[
None,
range,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doesn't seem to be used anywhere

Suggested change
range,

slice,
str,
ndarray[_Int],
Expand Down Expand Up @@ -595,6 +596,9 @@ def asarray(a: ndarray, dtype: Type[str]) -> ndarray[str_]: ...
def atleast_2d(ary: _Coercable) -> ndarray: ...
@overload
def atleast_2d(ar: _Coercable, *ary: _Coercable) -> List[ndarray]: ...
def bincount(
x: _ArrayLike[_DType], weights: _ArrayLike = ..., minlength: int = ...
) -> ndarray[_DType]: ...
@overload
def ceil(a: _FloatObj) -> _FloatObj: ...
@overload
Expand Down Expand Up @@ -642,7 +646,7 @@ def isin(element: Sequence[_DType], test_element: _DType) -> ndarray[_DType]: ..
@overload
def isnan(x: float64) -> bool: ...
@overload
def isnan(x: ndarray[_DType]) -> ndarray[bool_]: ...
def isnan(x: _ArrayLike[_DType]) -> ndarray[bool_]: ...
@overload
def ix_(x: ndarray[_DType]) -> ndarray[_DType]: ...
@overload
Expand Down
16 changes: 15 additions & 1 deletion numpy-stubs/random.pyi
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
from typing import Iterable, List, Optional, Sequence, Tuple, TypeVar, Union, overload

from . import _DType, _Float, _FloatObj, _Int, _IntObj, _ShapeType, float64, int64, ndarray
from . import (
_DType,
_Float,
_FloatObj,
_Int,
_IntObj,
_ShapeType,
float64,
int64,
ndarray,
_ArrayLike,
)

_T = TypeVar("_T")
@overload
Expand Down Expand Up @@ -43,6 +54,9 @@ def exponential(scale: _FloatObj, size: Sequence[_IntObj]) -> ndarray[float64]:
def exponential(scale: Sequence[_FloatObj], size: Sequence[_IntObj]) -> ndarray[float64]: ...
def geometric(p: float, size: _IntObj) -> ndarray[float64]: ...
def get_state() -> Tuple[str, ndarray[_Int], _IntObj, _IntObj, _FloatObj]: ...
def multinomial(
n: int, pvals: _ArrayLike[float] = ..., size: Union[int, Tuple[int, ...]] = ...
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
n: int, pvals: _ArrayLike[float] = ..., size: Union[int, Tuple[int, ...]] = ...
n: int, pvals: _ArrayLike[_Float] = ..., size: Union[int, Tuple[int, ...]] = ...

this should at least get rid of the error. not sure if it's correct though

) -> ndarray[_Int]: ...
def normal(loc: float, scale: float, size: Union[int, Tuple[int, ...]]) -> ndarray[float64]: ...
@overload
def permutation(size: int) -> ndarray[int64]: ...
Expand Down