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

Variable inspector / workspace view #64

Open
faroit opened this issue Jun 17, 2015 · 23 comments
Open

Variable inspector / workspace view #64

faroit opened this issue Jun 17, 2015 · 23 comments
Labels

Comments

@faroit
Copy link

faroit commented Jun 17, 2015

I love the idea of hydrogen, and I think this is good step into the right direction towards atom as a scientific dev environment! Thanks for the work so far.

One step further additionally to the "watch" mode would be to list variables of the current scope. The result would then be a variable / workspace view which automatically refreshes so users get a quick view on all their variables and their content. This view could also allow to click on the variables to show the content of arrays, images, matplotlib plots etc...

This would reflect something which is common in IDE's like Spyder or Matlab (see screenshot)
image

  • would you like to see this functionality included in hydrogen?
  • are you interested in implementing this or would you like to receive pull requests?

This has been added to the Hydrogen Wiki Plugins. If you close this issue please remove it from the Hydrogen Wiki.

@willwhitney
Copy link
Collaborator

willwhitney commented Jun 17, 2015

This is something I've thought about a lot, and it's something I'd love to
see in Hydrogen. That being said, I'm only willing to include features that
are language independent.

I'm probably going to be working with the Jupyter team to improve the
protocol to support this and other rich features. That won't have results
for a few months, though.

How are you thinking of implementing this?

@sho-87
Copy link

sho-87 commented Sep 29, 2015

I would love to see this as well.

I really want to move away from Spyder (especially given its recent problems with Windows 10) but the variable explorer keeps me using it. Hydrogen with the watch list is a huge step in the right direction, but its not quite the same thing.

@slavaGanzin

This comment has been minimized.

@onyxfish
Copy link

onyxfish commented Nov 8, 2015

I'd love to see this too. I've been tracing through Jupyter trying to figure out what would be necessary to support this sort of case globally and it seems like it could potentially be extremely complicated. The jupyter_client spec would need to implement some concept of a "variable". In the most basic case this would map to the contents of Python's globals(). However, in order to support jupyter's pubsub model you would need debugger like control over the execution environment. I'm not even sure it's feasible to do this in languages with less introspection than Python.

I'm wondering if an alternative to waiting for all this infrastructure might be to build out the watch list into a more automated UI. For instance, can we piggy-back on Atom's grammars to determine if the user's cursor is on a variable and display an "Watch this variable" button popup? Or maybe it's in the right-click menu?

@slavaGanzin
Copy link
Contributor

Jupyter is used for teaching and not highefficient programming, so maybe let's add continuous evaluator of all grammars? And display just meaningful ones. In dynamic languages only way to get the scope of selected piece of code is to launch it to this line included. And that only if code is imperative. So hidden launch of code would be best solution, but what if I modify filesystem with my code?
Another way to remember all scope iteratively, but that would be definitely a lot of overhead code for hydrogen. And as Will mentioned should be conceptually implemented in Jupyter.

@slavaGanzin
Copy link
Contributor

@onyxfish "Add watch" command was merged into master.
Parsing grammars is easy. And auto adding all variables into watches is easy too. If this would be approved I can write it fast.

But what about scopes?

@sho-87
Copy link

sho-87 commented Jan 26, 2016

@willwhitney any updates on your work with the jupyter team and whether this feature is likely to be added in the near future?

@willwhitney
Copy link
Collaborator

Don't hold your breath — this idea is on the back burner right now, as I'm finishing up a thesis and the Jupyter team is in the throes of a refactor. However, if you're interested in pitching in on the Jupyter side of things, they love PRs!

@nikitakit
Copy link
Contributor

I have a proof-of-concept that implements a basic variable inspector using the just-merged plugin API updates: https://github.com/nikitakit/hydrogen-python

screen shot 2018-02-21 at 1 33 14 pm

It should be quite doable to turn this into a fully-working plugin. That said, I'm not sure what the priority features for a variable inspector are, besides showing basic variable info. Existing environments offer a bunch of capabilities for editing/plotting/saving/loading, but I have no idea which of these features actually see non-trivial use.

@faroit
Copy link
Author

faroit commented Feb 21, 2018

Wow, this is awesome! 🍾

From my own experience, I did never used these kind of advanced features in MATLAB® etc., type and shape is pretty much all I need... so you nailed it 👍

I will have a detailed look later and I guess it makes more sense to continue discussion in the python plugin

@lgeiger
Copy link
Member

lgeiger commented Mar 3, 2018

Great work @nikitakit!

Do you want to add a link to this package to our readme? After that I think we're good to go and make a new release so people can try it out.

@willwhitney
Copy link
Collaborator

This is great! It's one of the things I most wished I could add when I was first building Hydrogen. Awesome work @nikitakit!

@AntonisKoutounidis
Copy link

@nikitakit This is really nice.

Save and load is crucial I think. Many people use python for data science and machine learning tool. So, save and load a workspace is really useful.

@ktavabi
Copy link

ktavabi commented Apr 25, 2018

So this would be a fantastic feature especially if it were more fluidly available i.e., opening up once workspace is populated by user defined variables. Nevertheless, I managed to toggle it on and recieved...

No introspection available! 😞

@nikitakit
Copy link
Contributor

@ktavabi The command you need to run isHydrogen Python: Toggle Variable Explorer, not Hydrogen: Toggle Inspector

@johndpope
Copy link

johndpope commented Jun 21, 2018

so awesome work @nikitakit -
To be upfront - I stumbled across this library after looking at ways to integrate livepython with ipython.
@agermanidis - managed to expose a variable explorer which works well and I love it's simplicity and playback feature.
https://github.com/agermanidis/livepython/

screen shot 2018-06-21 at 10 22 34 am

I was looking at this code base - and looking to plug in the ipython capabilities to like spyder ide
/ that is I want to retrofit hydrongen into livepython. I subsequently found another sidecar project which is almost integratabtle.
nteract/sidecar#46

screenshot 2

then read that there's nteract which has plotly all out of the box with nice ui candy.

my use case is I want to launch tensorflow training python app from terminal and be able to inspect variables print graphs / dataframes like spyder ide. my goto editor is visual studio code - but they don't want anything to with a variable explorer -
microsoft/vscode#29971

@ailiyasi11
Copy link

hi, I am new to this. How do you open this feature? I am using atom with python 3 kernel, where do you run Hydrogen Python: Toggle Variable Explorer ? in script or? @nikitakit

@kylebarron
Copy link
Contributor

kylebarron commented Aug 5, 2018

Press ctrl-shift-P to bring up the command palette. That's where you run all the Atom commands. You also need to install the hydrogen-python package to get the variable explorer. You can search for that in the install menu.

@hmanuel1
Copy link

Hi, I'm new to Atom and Python...I followed the instructions on this thread, but I'm unable to get the Variable Explorer to show up. Hydrogen is working fine otherwise. Any advise. I have entered the command from the command palette (typing the command). I can't see the command to show up. I also created shortcut for this command "hydrogen:toggle-variable-explorer", but it doesn't work either. Any clue on how to troubleshoot the installation of this plugin? Thanks!

@jdrogers42
Copy link

@nikitakit I'll add my vote for this being a useful feature. As for which other features see nontrivial use, I would say priority 1 is ability to just see the variable and the size/shape of arrays is my biggest use, so you have it! Thanks

@hmanuel1 I also did not see the hydrogen command initially, but it should show up in the command palette autocomplete after you install the package hydrogen-python. You probably need to restart hydrogen after installing the package.

@wadethestealth wadethestealth added language specific Not universal in all languages enhancement 🌟 New feature ideas help wanted Help is desired and removed language specific Not universal in all languages labels Jun 4, 2019
@paul-grassl
Copy link

Is there any planning to make this really useful feature also available for R? (as described in #628 I mean)
Cheers!

@wadethestealth wadethestealth added plugin-idea 💡 and removed enhancement 🌟 New feature ideas labels Jul 4, 2019
@Mixpap
Copy link

Mixpap commented Jul 24, 2019

The variable explorer is a very useful tool, I noticed that for python pandas DataFrames doesn't resolve their size.
A nice example of this working as it should is Jupyter's notebook extension Variable Inspector, which gives you the size/shape of the DataFrame.

@SilvesterHsu
Copy link

The plug-in can only see surface data, not specific data. For example, when you create a new Pandas DataFrame, you cannot see the data in it, and it is the same with numpy array.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests