@@ -346,7 +346,7 @@ def ctypes2numpy(cptr: CNumericPtr, length: int, dtype: Type[np.number]) -> np.n
346
346
if not isinstance (cptr , ctypes .POINTER (ctype )): # type: ignore
347
347
raise RuntimeError (f"expected { ctype } pointer" )
348
348
res = np .zeros (length , dtype = dtype )
349
- if not ctypes .memmove (res .ctypes .data , cptr , length * res .strides [0 ]): # type: ignore
349
+ if not ctypes .memmove (res .ctypes .data , cptr , length * res .strides [0 ]):
350
350
raise RuntimeError ("memmove failed" )
351
351
return res
352
352
@@ -507,7 +507,7 @@ def _next_wrapper(self, this: None) -> int: # pylint: disable=unused-argument
507
507
pointer.
508
508
509
509
"""
510
- @require_pos_args (True )
510
+ @require_keyword_args (True )
511
511
def input_data (
512
512
data : Any ,
513
513
* ,
@@ -559,7 +559,7 @@ def next(self, input_data: Callable) -> int:
559
559
raise NotImplementedError ()
560
560
561
561
562
- # Notice for `require_pos_args `
562
+ # Notice for `require_keyword_args `
563
563
# Authors: Olivier Grisel
564
564
# Gael Varoquaux
565
565
# Andreas Mueller
@@ -568,7 +568,9 @@ def next(self, input_data: Callable) -> int:
568
568
# Nicolas Tresegnie
569
569
# Sylvain Marie
570
570
# License: BSD 3 clause
571
- def require_pos_args (error : bool ) -> Callable [[Callable [..., _T ]], Callable [..., _T ]]:
571
+ def require_keyword_args (
572
+ error : bool ,
573
+ ) -> Callable [[Callable [..., _T ]], Callable [..., _T ]]:
572
574
"""Decorator for methods that issues warnings for positional arguments
573
575
574
576
Using the keyword-only argument syntax in pep 3102, arguments after the
@@ -583,7 +585,7 @@ def require_pos_args(error: bool) -> Callable[[Callable[..., _T]], Callable[...,
583
585
"""
584
586
585
587
def throw_if (func : Callable [..., _T ]) -> Callable [..., _T ]:
586
- """Throw error/warning if there are positional arguments after the asterisk.
588
+ """Throw an error/warning if there are positional arguments after the asterisk.
587
589
588
590
Parameters
589
591
----------
@@ -624,7 +626,7 @@ def inner_f(*args: Any, **kwargs: Any) -> _T:
624
626
return throw_if
625
627
626
628
627
- _deprecate_positional_args = require_pos_args (False )
629
+ _deprecate_positional_args = require_keyword_args (False )
628
630
629
631
630
632
class DMatrix : # pylint: disable=too-many-instance-attributes,too-many-public-methods
0 commit comments