TRIQS / triqs

a Toolbox for Research on Interacting Quantum Systems
https://triqs.github.io
GNU General Public License v3.0
135 stars 71 forks source link

Some Python functions still rely on `inspect.getargspec()` removed in Python 3.11 #911

Closed krivenko closed 11 months ago

krivenko commented 11 months ago

A simple grep on the 3.2.x source directory gives

doc/sphinxext/numpydoc/docscrape.py:                argspec = inspect.getargspec(func)
python/triqs/sumk/sumk_discrete.py:            Sigma_Nargs = len(inspect.getargspec(Sigma)[0])
python/triqs/fit/fit.py:        assert len(ins.getargspec(self.function)[0])== len(p00) + 1, "error in number of parameters"
python/triqs/dos/hilbert_transform.py:            assert len(inspect.getargspec(Sigma)[0]) == 1, "Sigma must be a function of a single variable"

inspect.getargspec() has been deprecated since version 3.0 and is no more available in 3.11. inspect.getfullargspec() should be used instead.

Wentzell commented 11 months ago

Thank you @krivenko for pointing this out!

Wentzell commented 11 months ago

Now fixed with 7f0141618