Skip to content
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

matplotlib: Pylance does'nt show autocomplete of modules in matplotlib #73

Closed
Trid-collab opened this issue Jul 8, 2020 · 7 comments
Closed
Assignees
Labels
fixed in next version (main) A fix has been implemented and will appear in an upcoming version typestub Issue relating to our bundled type stubs

Comments

@Trid-collab
Copy link

Issue Type: Bug

import matplotlib.pyplot as plt
plt.style.use("seaborn-darkgrid") <----- when we plt. --- the style option does not show up in the autocomplete option.

import pandas as pd
pd.set_option <----- the set_option does not show up when type pd. in autocomplete

Extension version: 2020.6.1
VS Code version: Code 1.46.1 (cd9ea6488829f560dc949a8b2fb789f3cdc05f5d, 2020-06-17T21:13:20.174Z)
OS version: Windows_NT x64 10.0.17134

System Info
Item Value
CPUs Intel(R) Core(TM) i5-5300U CPU @ 2.30GHz (4 x 2295)
GPU Status 2d_canvas: enabled
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: disabled_off
protected_video_decode: unavailable_off
rasterization: enabled
skia_renderer: disabled_off_ok
video_decode: enabled
viz_display_compositor: enabled_on
viz_hit_test_surface_layer: disabled_off_ok
webgl: enabled
webgl2: enabled
Load (avg) undefined
Memory (System) 7.88GB (0.96GB free)
Process Argv .
Screen Reader no
VM 0%
@gramster
Copy link
Member

gramster commented Jul 8, 2020

Thanks; we are missing the option APIs; will add them in next release.

@jakebailey
Copy link
Member

As for pyplot, the documentation does not list pyplot.style: https://matplotlib.org/api/pyplot_api.html

This might be exported by way of it importing something else and a variable existing, but I'm not sure that it's actually a part of pyplot's declared API (which is why I didn't add it to the stub). I think we'll have to check other projects to see if this is a common usage.

@judej judej added the needs decision Do we want this enhancement? label Jul 9, 2020
@CatNofishing
Copy link

It is good to add api about pandas and matplotlib ,This can enhance the programming experience of data science.

@Trid-collab
Copy link
Author

Trid-collab commented Sep 5, 2020

An update- found now that the below option works in the Jupyter Notebook Option when I first run the notebook in VS Code , but does not show in when writing .py file. It would be good to have it in the normal py editor option as well

import matplotlib.pyplot as plt
plt.style.use("seaborn-darkgrid") <----- when we plt. --- the style option does not show up in the autocomplete option.

@jakebailey jakebailey added bug Something isn't working and removed needs decision Do we want this enhancement? labels Sep 14, 2020
@jakebailey
Copy link
Member

jakebailey commented Sep 14, 2020

Correct; the notebook is working with the live code, but these stubs haven't been updated/fixed yet to include these methods (and that's what's used in non-live code, i.e. statically analyzed files).

I'm still not super convinced that this undocumented value should be exposed, in any case, but the stubs need to be updated in general.

@jakebailey jakebailey self-assigned this Sep 14, 2020
@jakebailey jakebailey added typestub Issue relating to our bundled type stubs and removed bug Something isn't working labels Sep 21, 2020
@gramster gramster changed the title Pylance does'nt show autocomplete of modules in matplotlib and pandas Pylance does'nt show autocomplete of modules in matplotlib Dec 18, 2020
@gramster gramster changed the title Pylance does'nt show autocomplete of modules in matplotlib matplotlib: Pylance does'nt show autocomplete of modules in matplotlib Dec 18, 2020
@ain-soph
Copy link

ain-soph commented Dec 31, 2020

Add one thing. matplotlib.cm.get_cmap is not well declared in stubs cm.pyi. There won't be any linting for from matplotlib.cm import get_cmap. So it is for matplotlib.colors.Colormap.
Actually it seems to be a quite short file and I guess a lot of things are missing? I think they are files for accelerating linting, and everything seems to work after I delete cm.pyi and colors.pyi. So maybe just don't add them if they are incomplete.

@jakebailey jakebailey added the fixed in next version (main) A fix has been implemented and will appear in an upcoming version label Mar 3, 2021
@jakebailey
Copy link
Member

This issue has been fixed in version 2021.3.0, which we've just released. You can find the changelog here: https://github.com/microsoft/pylance-release/blob/main/CHANGELOG.md#202130-3-march-2021

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fixed in next version (main) A fix has been implemented and will appear in an upcoming version typestub Issue relating to our bundled type stubs
Projects
None yet
Development

No branches or pull requests

6 participants