Skip to content

python linter on open3d package is not working as expected. #3802

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ghost opened this issue Dec 25, 2018 · 9 comments
Closed

python linter on open3d package is not working as expected. #3802

ghost opened this issue Dec 25, 2018 · 9 comments

Comments

@ghost
Copy link

ghost commented Dec 25, 2018

Describe the bug
A clear and concise description of what the bug is.

I don't know if this is a bug but I m trying to understand why the vscode python intelisense can't autocomplete with this package, I have seen the same exactly behavior when I m using the OpenCV with VsCode put I solved by adding this setting, inside the vscode settings.json

"python.linting.pylintArgs": [
    "--extension-pkg-whitelist=cv2"
],

with this, the vscode intelisense work as expected and I can navigate through the opencv api.
but I canot do the same with the Open3D, what is the difference from other puthon packages that open3D have been build.

Can someone check this?
I think the majority of the developers in this days use VsCode as the main code editor and is gonna be very helpful for the developers if they can navigate the open3d methods.

Thank you.

To Reproduce
Steps to reproduce the behavior:

  1. pip install open3d-python
  2. then make a file rgbd_redwood.py
  3. put this content
from open3d import (
    read_image, create_rgbd_image_from_color_and_depth, create_point_cloud_from_rgbd_image,
    PinholeCameraIntrinsic, PinholeCameraIntrinsicParameters, draw_geometries)
import matplotlib.pyplot as plt

    # openImgWithCV('../TestData/RGBD/color/00000.jpg')
if __name__ == "__main__":

    print("Read Redwood dataset")

    color_raw = read_image("../TestData/RGBD/color/00000.jpg")
    depth_raw = read_image("../TestData/RGBD/depth/00000.png")
    rgbd_image = create_rgbd_image_from_color_and_depth(color_raw, depth_raw);
    print(rgbd_image)

    # plt.subplot(1, 2, 1)
    # plt.title('Redwood grayscale image')
    # plt.imshow(rgbd_image.color)

    # plt.subplot(1, 2, 2)
    # plt.title('Redwood depth image')
    # plt.imshow(rgbd_image.depth)
    # plt.show()

    pcd = create_point_cloud_from_rgbd_image(rgbd_image, PinholeCameraIntrinsic(PinholeCameraIntrinsicParameters.PrimeSenseDefault))
    # Flip it, otherwise the pointcloud will be upside down
    pcd.transform([[1, 0, 0, 0], [0, -1, 0, 0], [0, 0, -1, 0], [0, 0, 0, 1]])
    draw_geometries([pcd])
    # print(draw_geometries([]))
    print(pcd)
  1. press **CTRL + click in some function from the open3d module
  2. this must navigate to the source code of the open3D, so you can understand what this function is doing.

Expected behavior
I expected to navigate to the open3D code after I clicl in some function so I can read the documentation as a result I will understand better my code.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: Windows 10
  • Python 3.6.7 64-bit
  • vsCode
    • Version: 1.30.1 (user setup)
    • Commit: dea8705087adb1b5e5ae1d9123278e178656186a
    • Date: 2018-12-18T18:12:07.165Z
    • Electron: 2.0.12
    • Chrome: 61.0.3163.100
    • Node.js: 8.9.3
    • V8: 6.1.534.41
    • OS: Windows_NT x64 10.0.17134

Additional context
Add any other context about the problem here.

@ghost ghost added the triage-needed Needs assignment to the proper sub-team label Dec 25, 2018
@d3r3kk d3r3kk added the triage label Dec 27, 2018
@ghost ghost removed the triage-needed Needs assignment to the proper sub-team label Dec 27, 2018
@karrtikr
Copy link

karrtikr commented Dec 31, 2018

Hi @George35mk ,
Can I know the exact setting file you used for open3d

"python.linting.pylintArgs": [
    "--extension-pkg-whitelist=???"
],

@ghost
Copy link
Author

ghost commented Dec 31, 2018

@karrtikr

Hi karrtikr thanks for looking on this.

.vscode/settings.json

{
    "python.pythonPath": "C:\\Users\\george\\AppData\\Local\\Programs\\Python\\Python36\\python.exe",
    "python.linting.pylintEnabled": true,
    "python.linting.pylintArgs": [
        "--extension-pkg-whitelist=cv2"
    ]
}

.pylintrc

[MASTER]

# A comma-separated list of package or module names from where C extensions may
# be loaded. Extensions are loading into the active Python interpreter and may
# run arbitrary code.
# extension-pkg-whitelist=
extension-pkg-whitelist=cv2 <=============

+++ 560 lines more the new stuff is with arrow

@ghost
Copy link
Author

ghost commented Dec 31, 2018

Also I have created an issue on Open3D repository.

isl-org/Open3D#751

@karrtikr
Copy link

Shouldn't you use extension-pkg-whitelist=open3d for open3d?

@ghost
Copy link
Author

ghost commented Dec 31, 2018

I have try this but for some reason is not working also I was trying to add an array to accept both **openCV and open3D but is not working

For example like this extension-pkg-whitelist=[cv2, open3d]

if I do this the openCV is not working I get error on the editor

@ghost
Copy link
Author

ghost commented Dec 31, 2018

I implemented the last extension-pkg-whitelist=[cv2, open3d] inside the settings.json

and if I hover on cv2 methods the intelisense show me a pop, that is ok seems to work. but

the open3d methods do not give me any useful popup messages like the cv2 does

@ghost
Copy link
Author

ghost commented Dec 31, 2018

26

@karrtikr
Copy link

karrtikr commented Dec 31, 2018

If you're doing the same thing with open3d and cv2, and it's not working for the former, it seems like either pylint doesn't support extension-pkg-whitelist=open3d as argument (meaning something is wrong with linting open3d), or something is up with open3d module.

In either case, it does not seem to be the issue of the python extension. I would recommend you to open this issue in pylint.

@ghost
Copy link
Author

ghost commented Dec 31, 2018

I think the same @karrtikr.

I will wait for the open3D developers since I open the same issue there, and they told me that they are working to fix this problem.

I m not sure if this issue must be closed but you are free to close this if is needed.

@ghost ghost removed the triage label Dec 31, 2018
@karrtikr karrtikr removed their assignment Dec 31, 2018
@lock lock bot locked as resolved and limited conversation to collaborators Jan 30, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants