jorgenschaefer / elpy

Emacs Python Development Environment
GNU General Public License v3.0
1.9k stars 262 forks source link

Elpy auto-completion of numpy missing classes/funcs in newer numpy versions #1991

Open hossfard opened 2 years ago

hossfard commented 2 years ago

Summary

Elpy auto-completion does not list many of the functions/classes in latest numpy versions. This issue seems to stem from numpy itself, but I am wondering if there is something in the implementation detail or configuration of elpy that can be adjusted to work around the internal changes in numpy.

Steps to reproduce

  1. Install the latest version of numpy (1.23.0 as of this writing)

    pip install numpy==1.23.0
  2. Open a new file and try to auto complete numpy's array

import numpy as np
np.arr

provided completions are abs, all, any, ... (See screenshot below)

image

(Note: array is not listed, but it does actually still exist in numpy 1.23.0)

Downgrading numpy to version 1.21.4 works as expected:

image

My configuration

Result of (elpy-config)

Emacs.............: 28.1
Elpy..............: 1.35.0
Virtualenv........: None
Interactive Python: python3 3.10.5 (/home/username/projects/elpy/_venv/bin/python3)
RPC virtualenv....: rpc-venv (/home/username/.emacs.d/elpy/rpc-venv)
 Python...........: python3 3.10.5 (/home/username/.emacs.d/elpy/rpc-venv/bin/python3)
 Jedi.............: 0.18.1
 Autopep8.........: 1.6.0
 Yapf.............: 0.32.0
 Black............: 22.3.0 (22.6.0 available)
Syntax checker....: Not found (flake8)

Elpy configuration in my init.el

(defun hf/python-mode-hook ()
  (require 'pyvenv)
  (elpy-enable)
  (setq elpy-rpc-python-command "python3")
  )
(setq elpy-rpc-maximum-buffer-age 60)

(add-hook 'python-mode-hook 'hf/python-mode-hook)
rn2208 commented 2 years ago

I have exactly the same problem.