Skip to content

Conversation

pvanmulbregt
Copy link
Contributor

Reference issue

Closes gh-11416

What does this implement/fix?

  • In _lib._util.get_argspec_no_self():
    • return POSITIONAL_ONLY arguments in the args element of the ArgSpec tuple.
    • raise ValueError if the method has keyword-only arguments (matches behaviour
      of Python's inspect.getargspec).
  • Add _util.getfullargspec_no_self to match inspect.getfullargspec.
  • Use _util.getfullargspec_no_self in stats.rv_generic.__init__ when checking
    for the presence of the 'moment' keyword in the distribution's ._stats method.
  • Added tests of get_argspec_no_self and getfullargspec_no_self to _lib/tests/test__util.py

If get_argspec_no_self would return incomplete information it will raise an
Exception instead. This should solve the backwards compatibility issue, in
that older code using it will still work if it can, and break if it would fail.

In _lib._util.get_argspec_no_self():
 * return POSITIONAL_ONLY arguments in the args element of the ArgSpec tuple.
 * raise ValueError if the method has keyword-only arguments (matches behaviour
   of Python's inspect.getargspec).
Add _util.getfullargspec_no_self to match inspect.getfullargspec.
Use _util.getfullargspec_no_self in stats.rv_generic.__init__ when checking
  for the presence of the 'moment' keyword in the distribution's ._stats method.
Added tests of get_argspec_no_self and getfullargspec_no_self to
  _lib/tests/test__util.py

If get_argspec_no_self would return incomplete information it will raise an
Exception instead.  This should solve the backwards compatibility issue, in
that older code using it will still work if it can, and break if it would fail.
@pvanmulbregt pvanmulbregt added scipy.stats maintenance Items related to regular maintenance tasks labels Jan 25, 2020
@ev-br
Copy link
Member

ev-br commented Jan 27, 2020

Maybe just ditch getargspec_no_self and replace its uses by the new getfullargspec_no_self?

It's only used in a handful of places in the codebase, and it's an internal function (from _lib), so there's no need to worry about backcompat.

perimosocordiae and others added 23 commits February 1, 2020 17:30
This now accepts row-vector 2d arrays in addition to 1d arrays.

Fixes scipygh-11255
This updates the pypocketfft version to include pypocketfft!31 which fixes the
`thread` name collisions on AIX and hopefully all future collisions by removing
uses of `using namespace std;` from Martin's code.

Also fixes vectorization on clang and correct detection of AppleClang.
Fix comparison between pydata sparse arrays and sparse matrices.
* add optional argment, nyquist, for freqz

* fixed codes based on reviews.

* add docstring based on review

* fix docstring based on review
MAINT: check minimize duplicate evaluations
* add a plan argument to FFT functions in scipy.fft

* add docstrings

* move NotImplementedError to _pocketfft

* add tests

test 1. scipy.fft does not support plan, and 2. a customized backend
can accept plan.

* add versionadded
DOC: revert gh10540, numpy intersphinx update
* the latest stable version of gcc toolchain
installed via homebrew was interfering with
the Travis CI Python 3.7 Mac OSX build when
latest version of multibuild submodule
was installed

* fix this by removing the super-new version
of gcc toolchain from brew
The inequality in the docstring should be reversed, fixes scipy#11428 .
* document/fix sequence of modes support in ndimage filters

The underlying C code does not support a sequence of modes, so only separable filters
should allow a sequence of modes.

* check mode sequence prior to _extend_mode_to_code call

* TST: append to rather than replace existing tests

* fix variable name

* use isinstance(..., Iterable) rather than hasattr(..., '__iter__')
@pvanmulbregt
Copy link
Contributor Author

Took Evgeni's advice and dumped getargspec_no_self completely and replaced all usages with getfullargspec_no_self.

@ev-br
Copy link
Member

ev-br commented Feb 1, 2020

Something went south with a rebase?

@pvanmulbregt
Copy link
Contributor Author

Something went south with a rebase?

Looks like it.

@pvanmulbregt
Copy link
Contributor Author

Closing due to rebase problem. Replace with gh-11455.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance Items related to regular maintenance tasks scipy.stats
Projects
None yet
Development

Successfully merging this pull request may close these issues.

_lib._util.getargspec_no_self is missing KEYWORD_ONLY support