microsoft / vscode-jupyter

VS Code Jupyter extension
https://marketplace.visualstudio.com/items?itemName=ms-toolsai.jupyter
MIT License
1.3k stars 293 forks source link

Spyder-Like variable explorer #1148

Open YashKarthik opened 4 years ago

YashKarthik commented 4 years ago

Feature: Variable explorer

The variable explorer in the notebooks is a important part of many data science IDEs, though vscode is not a full blown IDE I prefer it over others, its amazing. Vscode has a amazing features, just that the variable explorer doesn't feel/look so good, an explorer like in spyder or even Pycharm would be a nice feature and I'm sure many ppl would like that interface. Thanks

DavidKutu commented 4 years ago

Thanks for your feedback @YashKarthik. We'll discuss this feature in our next triage.

YashKarthik commented 4 years ago

👍🏻👍🏻 @DavidKutu

YashKarthik commented 4 years ago

@greazer , the variable explorer in the vscode Jupiter notebooks cover a lot of vertical space, whereas it'll be more convenient if it were on part the activity bar and have a squarish panel when opened. Also a data frame viewer like one in Jupyterlab would also be a nice feature.

jasonboh commented 4 years ago

Spyder has the very useful ability of viewing all kind of Python objects in the Variable Explorer. Currently, VS Code's Variable Explorer is very limited compared to the type of objects one can view in Spyder. For example, if I create Python class and then create a variable that stores an instance of that class, the Spyder variable explorer lets me double click on the instance variable and see all attributes. And I can keep descending into the hierarchy by double clicking. For example, if an attribute stores a list, I can double click on the attribute and view all element of the list. If the attribute is a nametuple or dict or set some other built-in Python object, I can double click on it and it open the view of that object. You can also actually edit values within a list, or dict or whatever and then interact with the edited values in the kernel. My understanding is that MATLAB behaves similarly (I don't know from personal experience). But the variable Explorer is one of the most-loved features in Spyder, so adding similar capabilities to VS Code would be great!

jontis commented 4 years ago

Yes! Though VS Code has come a long way, the variable explorer is still the reason I chose Spyder every time for Data Science tasks.

jasonboh commented 4 years ago

Me too. I find VS Code's current Variable Explorer is of super-limited use to me. However, VS Code offers so many other great features that Spyder does not. So, if VS Code could just close this one huge gap, it would be fantastic.

bibinvargheset commented 4 years ago

Me too. I find VS Code's current Variable Explorer is of super-limited use to me. However, VS Code offers so many other great features that Spyder does not. So, if VS Code could just close this one huge gap, it would be fantastic.

The above comments are very relevant and the redirected issue is closed. The variable explorer is needed for both the python interactive window as well as the normal python window.

Py charm has a good variable explorer and Virtual environment set up.

Ikhwansong commented 3 years ago

I agree with them. So please improve the 'variable explorer'

NikilXYZ commented 3 years ago

I agree - this is especially useful for matrices and csv / table type data. The one reason I use spyder (if I'm using Python) or use R studio (if I'm using R) instead of VS Code for scientific computing, data science, or image processing.

johan-lorentzon commented 3 years ago

I agree, I'd love to be able to use VS Code for scientific python since it's far superior to Spyder in other aspects but a working variable explorer and data viewer is an absolute requirement for a scientific IDE. The current VS Code one has too limited capabilities and also is far too slow to be useful.

jasonboh commented 3 years ago

@DonJayamanne @DavidKutu Hi guys, just to expand upon the request.... It would be great if the focus wasn't only on "data viewing". yes, that's important, but a more general, all-purpose variable viewer would be useful, where users could see all attributes and methods of each object alive in the kernel. This is what Spyder offers. It's not just a viewer for data objects.... it's a viewer for ALL variables, not matter their type. I believe that Spyder pickles objects in order to view their attrs and methods in the Variable Explorer. You can double click on any object and keep descending into the hierarchy of the objects inside of them. And, regarding data viewing, currently complex numbers are not supported in the Data Viewer. This is a requirement for my field of engineering.

NikilXYZ commented 3 years ago

Yep I agree with this. Also make it so the viewer refreshes the values on any update to the variable. Currently in VS Code I have to keep opening a new tab every time the values change

On Sat, May 8, 2021, 9:21 AM jbiz25 @.***> wrote:

@DonJayamanne https://github.com/DonJayamanne @DavidKutu https://github.com/DavidKutu Hi guys, just to expand upon the request.... It would be great if the focus wasn't only on "data viewing". yes, that's important, but a more general, all-purpose variable viewer would be useful, where users could see all attributes and methods of each object alive in the kernel. This is what Spyder offers. It's not just a viewer for data objects.... it's a viewer for ALL variables, not matter their type. I believe that Spyder pickles objects in order to view their attrs and methods in the Variable Explorer. You can double click on any object and keep descending into the hierarchy of the objects inside of them. And, regarding data viewing, currently complex numbers are not supported in the Data Viewer. This is a requirement for my field of engineering.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/microsoft/vscode-jupyter/issues/1148#issuecomment-835382165, or unsubscribe https://github.com/notifications/unsubscribe-auth/APW66EN2SK7P7GY2OS4XEX3TMVCGNANCNFSM4TVCLQNA .

DonJayamanne commented 3 years ago

What you're after is mentioned here:https://github.com/microsoft/vscode-jupyter/issues/5532

@jbiz25, @NikilXYZ Please upvote #5532 that issue if that's what you're after

jasonboh commented 3 years ago

That's exactly it. Will upvote. Thanks @DonJayamanne

mho21 commented 3 years ago

Thank you for picking up! as this drawback of vscode is the only reason I still use intellij right now, upvote both issue! #5532

kickbone commented 3 years ago

Could not agree more. Looking forward to an upgraded variable explorer in VS Code!

IsaiahvH commented 2 years ago

As far as I know, the current variable explorer also does not offer a way to search for a variable by name. When there is many variables, scrolling in a small window becomes tedious and it would be great if this feature would also be considered.

Y-H-Joe commented 2 years ago

another vote here!

Aizenz commented 2 years ago

Vote for a better variable explorer too. The color indicating the size of variable is really helpful!

ldorigo commented 2 years ago

+1. Also, I'm wondering if you couldn't "just" re-use the variable viewer that is used in the debugger? I find it 10x better in terms of interactivity than the current "JUPYTER: VARIABLES" pane.

mho21 commented 2 years ago

+1. Also, I'm wondering if you couldn't "just" re-use the variable viewer that is used in the debugger? I find it 10x better in terms of interactivity than the current "JUPYTER: VARIABLES" pane.

indeed, 90% I am starting the debugger only to view variables in better UI as a workaround - debuggers viewer is perfect! less than 10% goes out to real debugging

NikilXYZ commented 2 years ago

But the variable debugger doesn't show arrays and matrices very cleanly. Compare it to Spyder's viewer where the matrix actually shows up like a grid of rectangles, and a 3D matrix has sort of a page drop down.

On Wed, Mar 2, 2022, 7:26 AM Luca Dorigo @.***> wrote:

+1. Also, I'm wondering if you couldn't "just" re-use the variable viewer that is used in the debugger? I find it 10x better in terms of interactivity than the current "JUPYTER: VARIABLES" pane.

— Reply to this email directly, view it on GitHub https://github.com/microsoft/vscode-jupyter/issues/1148#issuecomment-1056930451, or unsubscribe https://github.com/notifications/unsubscribe-auth/APW66EI2DROWEXPAKNHEWJTU55UBTANCNFSM4TVCLQNA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you were mentioned.Message ID: @.***>

Mr-TalhaIlyas commented 2 years ago

in current explorer, variable loading is quite slow and the viewing style is also inconvenient It'd be a huge improvement if they can add Spyder like explorer...!

cnw21 commented 2 years ago

I've tried to make the switch to VS Code like 20 times but every time I end up going back to Spyder. The variable explorer is amazing, and iPython being the console, being able to run any code for graphs just by highlighting a few lines of code and pressing f9, where it not only pops up in the console but stores it under plots. All great features its hard to get away from. If they could just make VS Code a little more convenient for data science in Python I'd make the jump. It's nice they added the 'interactive window' but its just a separate jupyter notebook from what you're actually working on (unless i'm misunderstanding the functionality) and it's not what I'm going for at all.

mack-raymond commented 2 years ago

@cnw21 I've just switched to VScode from Spyder for most tasks. The interactive window has almost the same functionality as the ipython console in spyder. Highlight a code snippet in the editor and "shift+ enter" it into the interactive window. Plots can be rendered inline or in a separate window

JOPEDSAN commented 2 years ago

I agree with everything that is said in the issue. The reason why I don't definitely switch from Spyder to VS Code is the variable browser. I think it is essential when creating a structure to be able to visualize it and navigate with a double-click (example: dictionary of dictionaries, etc...). I hope that this improvement in the visualization of variables will be added, as soon as it will be solved it will be the definitive tool. Thanks !!!

dkumbhani411 commented 2 years ago

I reached out to these comments through google from same but I can not get an answer. Is there any update coming regarding that?

KangOxford commented 2 years ago

Please add a variable explorer!

DonJayamanne commented 1 year ago

More suggestions from here https://github.com/microsoft/vscode-jupyter/issues/11679

Cglezf commented 1 year ago

Please add a variable browser!!!

mateuszrenno commented 1 year ago

I agree! Spyder variable explorer is the best.

jmew commented 1 year ago

Just wanted to share this extension from Microsoft that integrates with Notebooks in VS Code, to allow you to open any Pandas DataFrame in an interactive data wrangler

https://marketplace.visualstudio.com/items?itemName=ms-toolsai.datawrangler

image

image

Cglezf commented 11 months ago

That not resolve the inspector variables (Spyder-like) for object. Sometimes we need to explore the variables within the objects.

starball5 commented 7 months ago

What's the relationship between this issue ticket and the work being done with https://github.com/microsoft/vscode/issues/165445?

BENSONCHIEN commented 7 months ago

After almost 4 years, another vote here!

Because vscode github copliot and Spyder variable explorer..., I keep switching between the two IDEs.

amunger commented 7 months ago

you can try out the experimental built-in variable view with "notebook.experimental.variablesView": true - A "Notebook Variables" section should show up in the run/debug sidebar when a python kernel from the jupyter extension is running. It still needs some polish, but should be closer to what is asked for here.

wrgrant commented 4 months ago

Nice @amunger !! This is a great start and covers everything I need for script development.

NikilXYZ commented 4 months ago

Does this only work for notebook files?

*NIKIL RAGAV | CEO | *inventXYZ

alum of Wharton Business | Penn Electrical Engineering 832.910.9645 | inventXYZ.com http://www.inventxyz.com/ Integrating hands-on real-world STEM & CS experiences into every core middle & high school course

On Mon, Jul 1, 2024 at 2:43 PM William Grant @.***> wrote:

Nice @amunger https://github.com/amunger !! This is a great start and covers everything I need for script development.

— Reply to this email directly, view it on GitHub https://github.com/microsoft/vscode-jupyter/issues/1148#issuecomment-2201122296, or unsubscribe https://github.com/notifications/unsubscribe-auth/APW66EMDNEMFZD6JBOWORWLZKHEORAVCNFSM4TVCLQNKU5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TEMRQGEYTEMRSHE3A . You are receiving this because you were mentioned.Message ID: @.***>

WhiteRavenTechnology commented 3 months ago

you can try out the experimental built-in variable view with "notebook.experimental.variablesView": true - A "Notebook Variables" section should show up in the run/debug sidebar when a python kernel from the jupyter extension is running. It still needs some polish, but should be closer to what is asked for here.

Well I thought this was gonna be it. Can't view dataframes in any kind of dataviewer, and apparently when a variable becomes sufficiently complex (dictionary with nested dataframes), the "Notebook Variables" section just empties itself and stops working. Can't figure out what it is about my specific code that's causing it. The "Jupyter" variables tab is more useful than this since it at least doesn't empty itself.

Interestingly, when debugging, the normal variable viewer DOES work fine and allow me to dig into my dictionary objects and view dataframes in a data viewer from there (of course it says the dataviewer is going to be deprecated in favor of DataWrangler because why would we want something native that works instead of a bloated extension that doesn't).

I just want to be able to expand my dictionaries and view the dataframes contained on them. PyCharm does it. Spyder apparently does it. VS Code ALMOST does it perfectly when debugging.

This is nuts.

amunger commented 3 months ago

@WhiteRavenTechnology - the bug you mentioned with the dictionary object would is the kind of thing that we want to find while the feature is still experimental, so if you have a repro object, let us konw.

And DataWrangler's data viewer should be hooked up to the new variable explorer soon.

BrazilForever11 commented 1 month ago

How can I try notebook.experimental.variablesView? I pasted it into search bar, but nothing came back.

BrazilForever11 commented 1 month ago

I managed to get it work notebook.experimental.variablesView with Data Wrangler extension. I guess here is the bug tracker: https://github.com/microsoft/vscode-jupyter/pull/15141

This seems to work in notebook. Would it be possible to have it in flat python file?

ejuliaschulz commented 2 days ago

How can I try notebook.experimental.variablesView? I pasted it into search bar, but nothing came back.

Click on File --> Preferences --> Settings (Or just Ctrl + ,), in the search bar of the window that opened up you can type notebook.experimental.variablesView, this will show the respective setting.

This is a great step forward, thank you @amunger ! Would be amazing to have it for flat python files as well.

amunger commented 1 day ago

The setting ID was updated to just notebook.variablesView, since at some point it won't be experimental, but the old setting key will still work.

The new variable view is available for plain python if you use the native python REPL by setting python.REPL.sendToNativeREPL to true, or the Interactive Window from the jupyter extension if you want to work with jupyter kernels.