From c909c478f4a1974a573843d912c2027d034770d0 Mon Sep 17 00:00:00 2001 From: Jun Kudo Date: Thu, 1 Oct 2020 03:50:03 +0900 Subject: [PATCH 1/5] ENH: Replace the module-level `__getattr__` with explicit type annotations #17367 --- numpy/__init__.pyi | 320 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 318 insertions(+), 2 deletions(-) diff --git a/numpy/__init__.pyi b/numpy/__init__.pyi index d4eda6b3150f..7fdd1a5ece74 100644 --- a/numpy/__init__.pyi +++ b/numpy/__init__.pyi @@ -154,8 +154,324 @@ __all__ = [ "var", ] -# TODO: remove when the full numpy namespace is defined -def __getattr__(name: str) -> Any: ... +DataSource: Any +False_: Any +MachAr: Any +ScalarType: Any +True_: Any +UFUNC_PYVALS_NAME: Any +abs: Any +angle: Any +append: Any +apply_along_axis: Any +apply_over_axes: Any +arange: Any +array2string: Any +array_repr: Any +array_split: Any +array_str: Any +asanyarray: Any +asarray: Any +asarray_chkfinite: Any +ascontiguousarray: Any +asfarray: Any +asfortranarray: Any +asmatrix: Any +asscalar: Any +atleast_1d: Any +atleast_2d: Any +atleast_3d: Any +average: Any +bartlett: Any +bincount: Any +bitwise_not: Any +blackman: Any +block: Any +bmat: Any +bool8: Any +broadcast: Any +broadcast_arrays: Any +broadcast_to: Any +busday_count: Any +busday_offset: Any +busdaycalendar: Any +byte: Any +byte_bounds: Any +bytes0: Any +c_: Any +can_cast: Any +cast: Any +cdouble: Any +cfloat: Any +char: Any +chararray: Any +clongdouble: Any +clongfloat: Any +column_stack: Any +common_type: Any +compare_chararrays: Any +compat: Any +complex256: Any +complex_: Any +concatenate: Any +conj: Any +copy: Any +copyto: Any +corrcoef: Any +cov: Any +csingle: Any +ctypeslib: Any +cumproduct: Any +datetime_as_string: Any +datetime_data: Any +delete: Any +deprecate: Any +deprecate_with_doc: Any +diag: Any +diag_indices: Any +diag_indices_from: Any +diagflat: Any +diff: Any +digitize: Any +disp: Any +divide: Any +dot: Any +double: Any +dsplit: Any +dstack: Any +ediff1d: Any +einsum: Any +einsum_path: Any +emath: Any +errstate: Any +expand_dims: Any +extract: Any +eye: Any +fft: Any +fill_diagonal: Any +finfo: Any +fix: Any +flip: Any +fliplr: Any +flipud: Any +float128: Any +float_: Any +format_float_positional: Any +format_float_scientific: Any +format_parser: Any +frombuffer: Any +fromfile: Any +fromiter: Any +frompyfunc: Any +fromregex: Any +fromstring: Any +genfromtxt: Any +geomspace: Any +get_include: Any +get_printoptions: Any +getbufsize: Any +geterr: Any +geterrcall: Any +geterrobj: Any +gradient: Any +half: Any +hamming: Any +hanning: Any +histogram: Any +histogram2d: Any +histogram_bin_edges: Any +histogramdd: Any +hsplit: Any +hstack: Any +i0: Any +iinfo: Any +imag: Any +in1d: Any +index_exp: Any +info: Any +inner: Any +insert: Any +int0: Any +int_: Any +intc: Any +interp: Any +intersect1d: Any +intp: Any +is_busday: Any +iscomplex: Any +iscomplexobj: Any +isin: Any +isneginf: Any +isposinf: Any +isreal: Any +isrealobj: Any +iterable: Any +ix_: Any +kaiser: Any +kron: Any +lexsort: Any +lib: Any +linalg: Any +linspace: Any +load: Any +loads: Any +loadtxt: Any +logspace: Any +longcomplex: Any +longdouble: Any +longfloat: Any +longlong: Any +lookfor: Any +ma: Any +mafromtxt: Any +mask_indices: Any +mat: Any +math: Any +matrix: Any +matrixlib: Any +max: Any +may_share_memory: Any +median: Any +memmap: Any +meshgrid: Any +mgrid: Any +min: Any +min_scalar_type: Any +mintypecode: Any +mod: Any +msort: Any +nan_to_num: Any +nanargmax: Any +nanargmin: Any +nancumprod: Any +nancumsum: Any +nanmax: Any +nanmean: Any +nanmedian: Any +nanmin: Any +nanpercentile: Any +nanprod: Any +nanquantile: Any +nanstd: Any +nansum: Any +nanvar: Any +nbytes: Any +ndenumerate: Any +ndfromtxt: Any +ndindex: Any +nditer: Any +nested_iters: Any +newaxis: Any +numarray: Any +object0: Any +ogrid: Any +packbits: Any +pad: Any +percentile: Any +piecewise: Any +place: Any +poly: Any +poly1d: Any +polyadd: Any +polyder: Any +polydiv: Any +polyfit: Any +polyint: Any +polymul: Any +polynomial: Any +polysub: Any +polyval: Any +printoptions: Any +product: Any +promote_types: Any +put_along_axis: Any +putmask: Any +quantile: Any +r_: Any +random: Any +ravel_multi_index: Any +real: Any +real_if_close: Any +rec: Any +recarray: Any +recfromcsv: Any +recfromtxt: Any +record: Any +require: Any +result_type: Any +roots: Any +rot90: Any +round: Any +round_: Any +row_stack: Any +s_: Any +save: Any +savetxt: Any +savez: Any +savez_compressed: Any +sctypeDict: Any +sctypeNA: Any +sctypes: Any +select: Any +set_printoptions: Any +set_string_function: Any +setbufsize: Any +setdiff1d: Any +seterr: Any +seterrcall: Any +seterrobj: Any +setxor1d: Any +shares_memory: Any +short: Any +show_config: Any +sinc: Any +single: Any +singlecomplex: Any +sort_complex: Any +source: Any +split: Any +stack: Any +str0: Any +string_: Any +sys: Any +take_along_axis: Any +testing: Any +tile: Any +trapz: Any +tri: Any +tril: Any +tril_indices: Any +tril_indices_from: Any +trim_zeros: Any +triu: Any +triu_indices: Any +triu_indices_from: Any +typeDict: Any +typeNA: Any +typecodes: Any +typename: Any +ubyte: Any +uint: Any +uint0: Any +uintc: Any +uintp: Any +ulonglong: Any +unicode_: Any +union1d: Any +unique: Any +unpackbits: Any +unravel_index: Any +unwrap: Any +ushort: Any +vander: Any +vdot: Any +vectorize: Any +version: Any +void0: Any +vsplit: Any +vstack: Any +where: Any +who: Any _NdArraySubClass = TypeVar("_NdArraySubClass", bound=ndarray) _ByteOrder = Literal["S", "<", ">", "=", "|", "L", "B", "N", "I"] From 8528a10d0e0b436f2238039e9c46012395a2958e Mon Sep 17 00:00:00 2001 From: Jun Kudo Date: Thu, 1 Oct 2020 04:44:22 +0900 Subject: [PATCH 2/5] ENH: remove unnecessary annotations in __init__.pyi. --- numpy/__init__.pyi | 3 --- 1 file changed, 3 deletions(-) diff --git a/numpy/__init__.pyi b/numpy/__init__.pyi index 7fdd1a5ece74..6a1c5b72b58e 100644 --- a/numpy/__init__.pyi +++ b/numpy/__init__.pyi @@ -160,7 +160,6 @@ MachAr: Any ScalarType: Any True_: Any UFUNC_PYVALS_NAME: Any -abs: Any angle: Any append: Any apply_along_axis: Any @@ -410,7 +409,6 @@ savetxt: Any savez: Any savez_compressed: Any sctypeDict: Any -sctypeNA: Any sctypes: Any select: Any set_printoptions: Any @@ -447,7 +445,6 @@ triu: Any triu_indices: Any triu_indices_from: Any typeDict: Any -typeNA: Any typecodes: Any typename: Any ubyte: Any From 0996962236506342d16730580e126efe2dfbf98d Mon Sep 17 00:00:00 2001 From: Jun Kudo Date: Thu, 1 Oct 2020 05:02:13 +0900 Subject: [PATCH 3/5] TST: Add test to verify that getting a non-existent objects indeed results in an error. --- numpy/typing/tests/data/fail/modules.py | 315 ++++++++++++++++++++++++ 1 file changed, 315 insertions(+) diff --git a/numpy/typing/tests/data/fail/modules.py b/numpy/typing/tests/data/fail/modules.py index e7ffe89207f0..5b3d3ffb3075 100644 --- a/numpy/typing/tests/data/fail/modules.py +++ b/numpy/typing/tests/data/fail/modules.py @@ -1,3 +1,318 @@ import numpy as np np.testing.bob # E: Module has no attribute +np.DataSource # E: Module has no attribute +np.False_ # E: Module has no attribute +np.MachAr # E: Module has no attribute +np.ScalarType # E: Module has no attribute +np.True_ # E: Module has no attribute +np.UFUNC_PYVALS_NAME # E: Module has no attribute +np.angle # E: Module has no attribute +np.append # E: Module has no attribute +np.apply_along_axis # E: Module has no attribute +np.apply_over_axes # E: Module has no attribute +np.arange # E: Module has no attribute +np.array2string # E: Module has no attribute +np.array_repr # E: Module has no attribute +np.array_split # E: Module has no attribute +np.array_str # E: Module has no attribute +np.asanyarray # E: Module has no attribute +np.asarray # E: Module has no attribute +np.asarray_chkfinite # E: Module has no attribute +np.ascontiguousarray # E: Module has no attribute +np.asfarray # E: Module has no attribute +np.asfortranarray # E: Module has no attribute +np.asmatrix # E: Module has no attribute +np.asscalar # E: Module has no attribute +np.atleast_1d # E: Module has no attribute +np.atleast_2d # E: Module has no attribute +np.atleast_3d # E: Module has no attribute +np.average # E: Module has no attribute +np.bartlett # E: Module has no attribute +np.bincount # E: Module has no attribute +np.bitwise_not # E: Module has no attribute +np.blackman # E: Module has no attribute +np.block # E: Module has no attribute +np.bmat # E: Module has no attribute +np.bool8 # E: Module has no attribute +np.broadcast # E: Module has no attribute +np.broadcast_arrays # E: Module has no attribute +np.broadcast_to # E: Module has no attribute +np.busday_count # E: Module has no attribute +np.busday_offset # E: Module has no attribute +np.busdaycalendar # E: Module has no attribute +np.byte # E: Module has no attribute +np.byte_bounds # E: Module has no attribute +np.bytes0 # E: Module has no attribute +np.c_ # E: Module has no attribute +np.can_cast # E: Module has no attribute +np.cast # E: Module has no attribute +np.cdouble # E: Module has no attribute +np.cfloat # E: Module has no attribute +np.char # E: Module has no attribute +np.chararray # E: Module has no attribute +np.clongdouble # E: Module has no attribute +np.clongfloat # E: Module has no attribute +np.column_stack # E: Module has no attribute +np.common_type # E: Module has no attribute +np.compare_chararrays # E: Module has no attribute +np.compat # E: Module has no attribute +np.complex256 # E: Module has no attribute +np.complex_ # E: Module has no attribute +np.concatenate # E: Module has no attribute +np.conj # E: Module has no attribute +np.copy # E: Module has no attribute +np.copyto # E: Module has no attribute +np.corrcoef # E: Module has no attribute +np.cov # E: Module has no attribute +np.csingle # E: Module has no attribute +np.ctypeslib # E: Module has no attribute +np.cumproduct # E: Module has no attribute +np.datetime_as_string # E: Module has no attribute +np.datetime_data # E: Module has no attribute +np.delete # E: Module has no attribute +np.deprecate # E: Module has no attribute +np.deprecate_with_doc # E: Module has no attribute +np.diag # E: Module has no attribute +np.diag_indices # E: Module has no attribute +np.diag_indices_from # E: Module has no attribute +np.diagflat # E: Module has no attribute +np.diff # E: Module has no attribute +np.digitize # E: Module has no attribute +np.disp # E: Module has no attribute +np.divide # E: Module has no attribute +np.dot # E: Module has no attribute +np.double # E: Module has no attribute +np.dsplit # E: Module has no attribute +np.dstack # E: Module has no attribute +np.ediff1d # E: Module has no attribute +np.einsum # E: Module has no attribute +np.einsum_path # E: Module has no attribute +np.emath # E: Module has no attribute +np.errstate # E: Module has no attribute +np.expand_dims # E: Module has no attribute +np.extract # E: Module has no attribute +np.eye # E: Module has no attribute +np.fft # E: Module has no attribute +np.fill_diagonal # E: Module has no attribute +np.finfo # E: Module has no attribute +np.fix # E: Module has no attribute +np.flip # E: Module has no attribute +np.fliplr # E: Module has no attribute +np.flipud # E: Module has no attribute +np.float128 # E: Module has no attribute +np.float_ # E: Module has no attribute +np.format_float_positional # E: Module has no attribute +np.format_float_scientific # E: Module has no attribute +np.format_parser # E: Module has no attribute +np.frombuffer # E: Module has no attribute +np.fromfile # E: Module has no attribute +np.fromiter # E: Module has no attribute +np.frompyfunc # E: Module has no attribute +np.fromregex # E: Module has no attribute +np.fromstring # E: Module has no attribute +np.genfromtxt # E: Module has no attribute +np.geomspace # E: Module has no attribute +np.get_include # E: Module has no attribute +np.get_printoptions # E: Module has no attribute +np.getbufsize # E: Module has no attribute +np.geterr # E: Module has no attribute +np.geterrcall # E: Module has no attribute +np.geterrobj # E: Module has no attribute +np.gradient # E: Module has no attribute +np.half # E: Module has no attribute +np.hamming # E: Module has no attribute +np.hanning # E: Module has no attribute +np.histogram # E: Module has no attribute +np.histogram2d # E: Module has no attribute +np.histogram_bin_edges # E: Module has no attribute +np.histogramdd # E: Module has no attribute +np.hsplit # E: Module has no attribute +np.hstack # E: Module has no attribute +np.i0 # E: Module has no attribute +np.iinfo # E: Module has no attribute +np.imag # E: Module has no attribute +np.in1d # E: Module has no attribute +np.index_exp # E: Module has no attribute +np.info # E: Module has no attribute +np.inner # E: Module has no attribute +np.insert # E: Module has no attribute +np.int0 # E: Module has no attribute +np.int_ # E: Module has no attribute +np.intc # E: Module has no attribute +np.interp # E: Module has no attribute +np.intersect1d # E: Module has no attribute +np.intp # E: Module has no attribute +np.is_busday # E: Module has no attribute +np.iscomplex # E: Module has no attribute +np.iscomplexobj # E: Module has no attribute +np.isin # E: Module has no attribute +np.isneginf # E: Module has no attribute +np.isposinf # E: Module has no attribute +np.isreal # E: Module has no attribute +np.isrealobj # E: Module has no attribute +np.iterable # E: Module has no attribute +np.ix_ # E: Module has no attribute +np.kaiser # E: Module has no attribute +np.kron # E: Module has no attribute +np.lexsort # E: Module has no attribute +np.lib # E: Module has no attribute +np.linalg # E: Module has no attribute +np.linspace # E: Module has no attribute +np.load # E: Module has no attribute +np.loads # E: Module has no attribute +np.loadtxt # E: Module has no attribute +np.logspace # E: Module has no attribute +np.longcomplex # E: Module has no attribute +np.longdouble # E: Module has no attribute +np.longfloat # E: Module has no attribute +np.longlong # E: Module has no attribute +np.lookfor # E: Module has no attribute +np.ma # E: Module has no attribute +np.mafromtxt # E: Module has no attribute +np.mask_indices # E: Module has no attribute +np.mat # E: Module has no attribute +np.math # E: Module has no attribute +np.matrix # E: Module has no attribute +np.matrixlib # E: Module has no attribute +np.max # E: Module has no attribute +np.may_share_memory # E: Module has no attribute +np.median # E: Module has no attribute +np.memmap # E: Module has no attribute +np.meshgrid # E: Module has no attribute +np.mgrid # E: Module has no attribute +np.min # E: Module has no attribute +np.min_scalar_type # E: Module has no attribute +np.mintypecode # E: Module has no attribute +np.mod # E: Module has no attribute +np.msort # E: Module has no attribute +np.nan_to_num # E: Module has no attribute +np.nanargmax # E: Module has no attribute +np.nanargmin # E: Module has no attribute +np.nancumprod # E: Module has no attribute +np.nancumsum # E: Module has no attribute +np.nanmax # E: Module has no attribute +np.nanmean # E: Module has no attribute +np.nanmedian # E: Module has no attribute +np.nanmin # E: Module has no attribute +np.nanpercentile # E: Module has no attribute +np.nanprod # E: Module has no attribute +np.nanquantile # E: Module has no attribute +np.nanstd # E: Module has no attribute +np.nansum # E: Module has no attribute +np.nanvar # E: Module has no attribute +np.nbytes # E: Module has no attribute +np.ndenumerate # E: Module has no attribute +np.ndfromtxt # E: Module has no attribute +np.ndindex # E: Module has no attribute +np.nditer # E: Module has no attribute +np.nested_iters # E: Module has no attribute +np.newaxis # E: Module has no attribute +np.numarray # E: Module has no attribute +np.object0 # E: Module has no attribute +np.ogrid # E: Module has no attribute +np.packbits # E: Module has no attribute +np.pad # E: Module has no attribute +np.percentile # E: Module has no attribute +np.piecewise # E: Module has no attribute +np.place # E: Module has no attribute +np.poly # E: Module has no attribute +np.poly1d # E: Module has no attribute +np.polyadd # E: Module has no attribute +np.polyder # E: Module has no attribute +np.polydiv # E: Module has no attribute +np.polyfit # E: Module has no attribute +np.polyint # E: Module has no attribute +np.polymul # E: Module has no attribute +np.polynomial # E: Module has no attribute +np.polysub # E: Module has no attribute +np.polyval # E: Module has no attribute +np.printoptions # E: Module has no attribute +np.product # E: Module has no attribute +np.promote_types # E: Module has no attribute +np.put_along_axis # E: Module has no attribute +np.putmask # E: Module has no attribute +np.quantile # E: Module has no attribute +np.r_ # E: Module has no attribute +np.random # E: Module has no attribute +np.ravel_multi_index # E: Module has no attribute +np.real # E: Module has no attribute +np.real_if_close # E: Module has no attribute +np.rec # E: Module has no attribute +np.recarray # E: Module has no attribute +np.recfromcsv # E: Module has no attribute +np.recfromtxt # E: Module has no attribute +np.record # E: Module has no attribute +np.require # E: Module has no attribute +np.result_type # E: Module has no attribute +np.roots # E: Module has no attribute +np.rot90 # E: Module has no attribute +np.round # E: Module has no attribute +np.round_ # E: Module has no attribute +np.row_stack # E: Module has no attribute +np.s_ # E: Module has no attribute +np.save # E: Module has no attribute +np.savetxt # E: Module has no attribute +np.savez # E: Module has no attribute +np.savez_compressed # E: Module has no attribute +np.sctypeDict # E: Module has no attribute +np.sctypes # E: Module has no attribute +np.select # E: Module has no attribute +np.set_printoptions # E: Module has no attribute +np.set_string_function # E: Module has no attribute +np.setbufsize # E: Module has no attribute +np.setdiff1d # E: Module has no attribute +np.seterr # E: Module has no attribute +np.seterrcall # E: Module has no attribute +np.seterrobj # E: Module has no attribute +np.setxor1d # E: Module has no attribute +np.shares_memory # E: Module has no attribute +np.short # E: Module has no attribute +np.show_config # E: Module has no attribute +np.sinc # E: Module has no attribute +np.single # E: Module has no attribute +np.singlecomplex # E: Module has no attribute +np.sort_complex # E: Module has no attribute +np.source # E: Module has no attribute +np.split # E: Module has no attribute +np.stack # E: Module has no attribute +np.str0 # E: Module has no attribute +np.string_ # E: Module has no attribute +np.sys # E: Module has no attribute +np.take_along_axis # E: Module has no attribute +np.testing # E: Module has no attribute +np.tile # E: Module has no attribute +np.trapz # E: Module has no attribute +np.tri # E: Module has no attribute +np.tril # E: Module has no attribute +np.tril_indices # E: Module has no attribute +np.tril_indices_from # E: Module has no attribute +np.trim_zeros # E: Module has no attribute +np.triu # E: Module has no attribute +np.triu_indices # E: Module has no attribute +np.triu_indices_from # E: Module has no attribute +np.typeDict # E: Module has no attribute +np.typecodes # E: Module has no attribute +np.typename # E: Module has no attribute +np.ubyte # E: Module has no attribute +np.uint # E: Module has no attribute +np.uint0 # E: Module has no attribute +np.uintc # E: Module has no attribute +np.uintp # E: Module has no attribute +np.ulonglong # E: Module has no attribute +np.unicode_ # E: Module has no attribute +np.union1d # E: Module has no attribute +np.unique # E: Module has no attribute +np.unpackbits # E: Module has no attribute +np.unravel_index # E: Module has no attribute +np.unwrap # E: Module has no attribute +np.ushort # E: Module has no attribute +np.vander # E: Module has no attribute +np.vdot # E: Module has no attribute +np.vectorize # E: Module has no attribute +np.version # E: Module has no attribute +np.void0 # E: Module has no attribute +np.vsplit # E: Module has no attribute +np.vstack # E: Module has no attribute +np.where # E: Module has no attribute +np.who # E: Module has no attribute \ No newline at end of file From 2dd8693721f9781d4837ed14461d122bdd5c7874 Mon Sep 17 00:00:00 2001 From: Jun Kudo Date: Thu, 1 Oct 2020 11:24:21 +0900 Subject: [PATCH 4/5] Revert "TST: Add test to verify that getting a non-existent objects indeed results in an error." This reverts commit 0996962236506342d16730580e126efe2dfbf98d. --- numpy/typing/tests/data/fail/modules.py | 315 ------------------------ 1 file changed, 315 deletions(-) diff --git a/numpy/typing/tests/data/fail/modules.py b/numpy/typing/tests/data/fail/modules.py index 5b3d3ffb3075..e7ffe89207f0 100644 --- a/numpy/typing/tests/data/fail/modules.py +++ b/numpy/typing/tests/data/fail/modules.py @@ -1,318 +1,3 @@ import numpy as np np.testing.bob # E: Module has no attribute -np.DataSource # E: Module has no attribute -np.False_ # E: Module has no attribute -np.MachAr # E: Module has no attribute -np.ScalarType # E: Module has no attribute -np.True_ # E: Module has no attribute -np.UFUNC_PYVALS_NAME # E: Module has no attribute -np.angle # E: Module has no attribute -np.append # E: Module has no attribute -np.apply_along_axis # E: Module has no attribute -np.apply_over_axes # E: Module has no attribute -np.arange # E: Module has no attribute -np.array2string # E: Module has no attribute -np.array_repr # E: Module has no attribute -np.array_split # E: Module has no attribute -np.array_str # E: Module has no attribute -np.asanyarray # E: Module has no attribute -np.asarray # E: Module has no attribute -np.asarray_chkfinite # E: Module has no attribute -np.ascontiguousarray # E: Module has no attribute -np.asfarray # E: Module has no attribute -np.asfortranarray # E: Module has no attribute -np.asmatrix # E: Module has no attribute -np.asscalar # E: Module has no attribute -np.atleast_1d # E: Module has no attribute -np.atleast_2d # E: Module has no attribute -np.atleast_3d # E: Module has no attribute -np.average # E: Module has no attribute -np.bartlett # E: Module has no attribute -np.bincount # E: Module has no attribute -np.bitwise_not # E: Module has no attribute -np.blackman # E: Module has no attribute -np.block # E: Module has no attribute -np.bmat # E: Module has no attribute -np.bool8 # E: Module has no attribute -np.broadcast # E: Module has no attribute -np.broadcast_arrays # E: Module has no attribute -np.broadcast_to # E: Module has no attribute -np.busday_count # E: Module has no attribute -np.busday_offset # E: Module has no attribute -np.busdaycalendar # E: Module has no attribute -np.byte # E: Module has no attribute -np.byte_bounds # E: Module has no attribute -np.bytes0 # E: Module has no attribute -np.c_ # E: Module has no attribute -np.can_cast # E: Module has no attribute -np.cast # E: Module has no attribute -np.cdouble # E: Module has no attribute -np.cfloat # E: Module has no attribute -np.char # E: Module has no attribute -np.chararray # E: Module has no attribute -np.clongdouble # E: Module has no attribute -np.clongfloat # E: Module has no attribute -np.column_stack # E: Module has no attribute -np.common_type # E: Module has no attribute -np.compare_chararrays # E: Module has no attribute -np.compat # E: Module has no attribute -np.complex256 # E: Module has no attribute -np.complex_ # E: Module has no attribute -np.concatenate # E: Module has no attribute -np.conj # E: Module has no attribute -np.copy # E: Module has no attribute -np.copyto # E: Module has no attribute -np.corrcoef # E: Module has no attribute -np.cov # E: Module has no attribute -np.csingle # E: Module has no attribute -np.ctypeslib # E: Module has no attribute -np.cumproduct # E: Module has no attribute -np.datetime_as_string # E: Module has no attribute -np.datetime_data # E: Module has no attribute -np.delete # E: Module has no attribute -np.deprecate # E: Module has no attribute -np.deprecate_with_doc # E: Module has no attribute -np.diag # E: Module has no attribute -np.diag_indices # E: Module has no attribute -np.diag_indices_from # E: Module has no attribute -np.diagflat # E: Module has no attribute -np.diff # E: Module has no attribute -np.digitize # E: Module has no attribute -np.disp # E: Module has no attribute -np.divide # E: Module has no attribute -np.dot # E: Module has no attribute -np.double # E: Module has no attribute -np.dsplit # E: Module has no attribute -np.dstack # E: Module has no attribute -np.ediff1d # E: Module has no attribute -np.einsum # E: Module has no attribute -np.einsum_path # E: Module has no attribute -np.emath # E: Module has no attribute -np.errstate # E: Module has no attribute -np.expand_dims # E: Module has no attribute -np.extract # E: Module has no attribute -np.eye # E: Module has no attribute -np.fft # E: Module has no attribute -np.fill_diagonal # E: Module has no attribute -np.finfo # E: Module has no attribute -np.fix # E: Module has no attribute -np.flip # E: Module has no attribute -np.fliplr # E: Module has no attribute -np.flipud # E: Module has no attribute -np.float128 # E: Module has no attribute -np.float_ # E: Module has no attribute -np.format_float_positional # E: Module has no attribute -np.format_float_scientific # E: Module has no attribute -np.format_parser # E: Module has no attribute -np.frombuffer # E: Module has no attribute -np.fromfile # E: Module has no attribute -np.fromiter # E: Module has no attribute -np.frompyfunc # E: Module has no attribute -np.fromregex # E: Module has no attribute -np.fromstring # E: Module has no attribute -np.genfromtxt # E: Module has no attribute -np.geomspace # E: Module has no attribute -np.get_include # E: Module has no attribute -np.get_printoptions # E: Module has no attribute -np.getbufsize # E: Module has no attribute -np.geterr # E: Module has no attribute -np.geterrcall # E: Module has no attribute -np.geterrobj # E: Module has no attribute -np.gradient # E: Module has no attribute -np.half # E: Module has no attribute -np.hamming # E: Module has no attribute -np.hanning # E: Module has no attribute -np.histogram # E: Module has no attribute -np.histogram2d # E: Module has no attribute -np.histogram_bin_edges # E: Module has no attribute -np.histogramdd # E: Module has no attribute -np.hsplit # E: Module has no attribute -np.hstack # E: Module has no attribute -np.i0 # E: Module has no attribute -np.iinfo # E: Module has no attribute -np.imag # E: Module has no attribute -np.in1d # E: Module has no attribute -np.index_exp # E: Module has no attribute -np.info # E: Module has no attribute -np.inner # E: Module has no attribute -np.insert # E: Module has no attribute -np.int0 # E: Module has no attribute -np.int_ # E: Module has no attribute -np.intc # E: Module has no attribute -np.interp # E: Module has no attribute -np.intersect1d # E: Module has no attribute -np.intp # E: Module has no attribute -np.is_busday # E: Module has no attribute -np.iscomplex # E: Module has no attribute -np.iscomplexobj # E: Module has no attribute -np.isin # E: Module has no attribute -np.isneginf # E: Module has no attribute -np.isposinf # E: Module has no attribute -np.isreal # E: Module has no attribute -np.isrealobj # E: Module has no attribute -np.iterable # E: Module has no attribute -np.ix_ # E: Module has no attribute -np.kaiser # E: Module has no attribute -np.kron # E: Module has no attribute -np.lexsort # E: Module has no attribute -np.lib # E: Module has no attribute -np.linalg # E: Module has no attribute -np.linspace # E: Module has no attribute -np.load # E: Module has no attribute -np.loads # E: Module has no attribute -np.loadtxt # E: Module has no attribute -np.logspace # E: Module has no attribute -np.longcomplex # E: Module has no attribute -np.longdouble # E: Module has no attribute -np.longfloat # E: Module has no attribute -np.longlong # E: Module has no attribute -np.lookfor # E: Module has no attribute -np.ma # E: Module has no attribute -np.mafromtxt # E: Module has no attribute -np.mask_indices # E: Module has no attribute -np.mat # E: Module has no attribute -np.math # E: Module has no attribute -np.matrix # E: Module has no attribute -np.matrixlib # E: Module has no attribute -np.max # E: Module has no attribute -np.may_share_memory # E: Module has no attribute -np.median # E: Module has no attribute -np.memmap # E: Module has no attribute -np.meshgrid # E: Module has no attribute -np.mgrid # E: Module has no attribute -np.min # E: Module has no attribute -np.min_scalar_type # E: Module has no attribute -np.mintypecode # E: Module has no attribute -np.mod # E: Module has no attribute -np.msort # E: Module has no attribute -np.nan_to_num # E: Module has no attribute -np.nanargmax # E: Module has no attribute -np.nanargmin # E: Module has no attribute -np.nancumprod # E: Module has no attribute -np.nancumsum # E: Module has no attribute -np.nanmax # E: Module has no attribute -np.nanmean # E: Module has no attribute -np.nanmedian # E: Module has no attribute -np.nanmin # E: Module has no attribute -np.nanpercentile # E: Module has no attribute -np.nanprod # E: Module has no attribute -np.nanquantile # E: Module has no attribute -np.nanstd # E: Module has no attribute -np.nansum # E: Module has no attribute -np.nanvar # E: Module has no attribute -np.nbytes # E: Module has no attribute -np.ndenumerate # E: Module has no attribute -np.ndfromtxt # E: Module has no attribute -np.ndindex # E: Module has no attribute -np.nditer # E: Module has no attribute -np.nested_iters # E: Module has no attribute -np.newaxis # E: Module has no attribute -np.numarray # E: Module has no attribute -np.object0 # E: Module has no attribute -np.ogrid # E: Module has no attribute -np.packbits # E: Module has no attribute -np.pad # E: Module has no attribute -np.percentile # E: Module has no attribute -np.piecewise # E: Module has no attribute -np.place # E: Module has no attribute -np.poly # E: Module has no attribute -np.poly1d # E: Module has no attribute -np.polyadd # E: Module has no attribute -np.polyder # E: Module has no attribute -np.polydiv # E: Module has no attribute -np.polyfit # E: Module has no attribute -np.polyint # E: Module has no attribute -np.polymul # E: Module has no attribute -np.polynomial # E: Module has no attribute -np.polysub # E: Module has no attribute -np.polyval # E: Module has no attribute -np.printoptions # E: Module has no attribute -np.product # E: Module has no attribute -np.promote_types # E: Module has no attribute -np.put_along_axis # E: Module has no attribute -np.putmask # E: Module has no attribute -np.quantile # E: Module has no attribute -np.r_ # E: Module has no attribute -np.random # E: Module has no attribute -np.ravel_multi_index # E: Module has no attribute -np.real # E: Module has no attribute -np.real_if_close # E: Module has no attribute -np.rec # E: Module has no attribute -np.recarray # E: Module has no attribute -np.recfromcsv # E: Module has no attribute -np.recfromtxt # E: Module has no attribute -np.record # E: Module has no attribute -np.require # E: Module has no attribute -np.result_type # E: Module has no attribute -np.roots # E: Module has no attribute -np.rot90 # E: Module has no attribute -np.round # E: Module has no attribute -np.round_ # E: Module has no attribute -np.row_stack # E: Module has no attribute -np.s_ # E: Module has no attribute -np.save # E: Module has no attribute -np.savetxt # E: Module has no attribute -np.savez # E: Module has no attribute -np.savez_compressed # E: Module has no attribute -np.sctypeDict # E: Module has no attribute -np.sctypes # E: Module has no attribute -np.select # E: Module has no attribute -np.set_printoptions # E: Module has no attribute -np.set_string_function # E: Module has no attribute -np.setbufsize # E: Module has no attribute -np.setdiff1d # E: Module has no attribute -np.seterr # E: Module has no attribute -np.seterrcall # E: Module has no attribute -np.seterrobj # E: Module has no attribute -np.setxor1d # E: Module has no attribute -np.shares_memory # E: Module has no attribute -np.short # E: Module has no attribute -np.show_config # E: Module has no attribute -np.sinc # E: Module has no attribute -np.single # E: Module has no attribute -np.singlecomplex # E: Module has no attribute -np.sort_complex # E: Module has no attribute -np.source # E: Module has no attribute -np.split # E: Module has no attribute -np.stack # E: Module has no attribute -np.str0 # E: Module has no attribute -np.string_ # E: Module has no attribute -np.sys # E: Module has no attribute -np.take_along_axis # E: Module has no attribute -np.testing # E: Module has no attribute -np.tile # E: Module has no attribute -np.trapz # E: Module has no attribute -np.tri # E: Module has no attribute -np.tril # E: Module has no attribute -np.tril_indices # E: Module has no attribute -np.tril_indices_from # E: Module has no attribute -np.trim_zeros # E: Module has no attribute -np.triu # E: Module has no attribute -np.triu_indices # E: Module has no attribute -np.triu_indices_from # E: Module has no attribute -np.typeDict # E: Module has no attribute -np.typecodes # E: Module has no attribute -np.typename # E: Module has no attribute -np.ubyte # E: Module has no attribute -np.uint # E: Module has no attribute -np.uint0 # E: Module has no attribute -np.uintc # E: Module has no attribute -np.uintp # E: Module has no attribute -np.ulonglong # E: Module has no attribute -np.unicode_ # E: Module has no attribute -np.union1d # E: Module has no attribute -np.unique # E: Module has no attribute -np.unpackbits # E: Module has no attribute -np.unravel_index # E: Module has no attribute -np.unwrap # E: Module has no attribute -np.ushort # E: Module has no attribute -np.vander # E: Module has no attribute -np.vdot # E: Module has no attribute -np.vectorize # E: Module has no attribute -np.version # E: Module has no attribute -np.void0 # E: Module has no attribute -np.vsplit # E: Module has no attribute -np.vstack # E: Module has no attribute -np.where # E: Module has no attribute -np.who # E: Module has no attribute \ No newline at end of file From 72172ce9fd0fc11378cb65d7ed033407ac722ca7 Mon Sep 17 00:00:00 2001 From: Jun Kudo Date: Thu, 1 Oct 2020 14:43:40 +0900 Subject: [PATCH 5/5] TST: add test to verify that getting a non-existent objects of top-level indeed results in an error --- numpy/typing/tests/data/fail/modules.py | 1 + 1 file changed, 1 insertion(+) diff --git a/numpy/typing/tests/data/fail/modules.py b/numpy/typing/tests/data/fail/modules.py index e7ffe89207f0..be031e6e15e5 100644 --- a/numpy/typing/tests/data/fail/modules.py +++ b/numpy/typing/tests/data/fail/modules.py @@ -1,3 +1,4 @@ import numpy as np np.testing.bob # E: Module has no attribute +np.bob # E: Module has no attribute \ No newline at end of file