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

Spyder alternate layout exploration #60

Open
isabela-pf opened this issue Aug 6, 2021 · 24 comments
Open

Spyder alternate layout exploration #60

isabela-pf opened this issue Aug 6, 2021 · 24 comments
Labels

Comments

@isabela-pf
Copy link
Collaborator

Hi everyone! An obstacle we’ve come across in past issues and in team meetings is that Spyder’s default method for managing panes/plugins (all the things that make new sections or tabs in Spyder) is mostly

  • Editor on the left half of the screen
  • Console on the lower right quarter of the screen
  • Almost everything else in the upper right quarter of the screen

Spyder's default layout with extra panes open in the upper right area

There are exceptions to this, but I don’t think there is disagreement that this is the primary strategy for the default layout. While this has worked, the increasing number of panes/plugins being added as well as the ability to more easily add them with Spyder 5’s API migration means it might be a good time to consider if there are other layout strategies to help manage Spyder’s space in a way that better serves how people actually work with it.


This issue will be the core place for discussing potential Spyder layout changes.

User feedback is critical to this issue’s exploration. Depending on the feedback we get, this could be a big change. If this is something you want to keep track of, I’d recommend clicking the subscribe button on this issue (in the right column near the top of the issue) so you get updates. You can always unsubscribe if you get tired of the noise.

@isabela-pf
Copy link
Collaborator Author

For starters, any information about how you use Spyder and/or how you manage its panes/plugins is helpful. You can ask yourself questions like:

  • What types of projects do you do in Spyder?
  • Do you use the default layout for Spyder? What about any of the other preset layouts in the View > Window layouts menu?
  • Do you use a custom layout for Spyder? It’d be great if you could describe it or share screenshots.
  • Do you use different layouts? If so, what makes you switch out what you have open? Once again, descriptions and/or screenshots are helpful here.
  • What tasks do you do when working in Spyder? (By tasks I mean things like writing code, debugging code, presenting and/or teaching, and so on.)
  • What panes/plugins do you notice yourself using most?
  • What panes/plugins do you notice you rarely or don’t use?
  • Are there any panes/plugins you usually use together?

Or anything else about how you use Spyder that you’d like to share. Thanks in advance!

@felixchenier
Copy link

felixchenier commented Aug 18, 2021

It seems I'm the first to comment, so let's dive! I just hope I am correctly understanding the issue. If not, then at least consider it just like user feedback.

What types of projects do you do in Spyder?

  • Research scripts
  • Research library development (API)

Do you use the default layout for Spyder? What about any of the other preset layouts in the View > Window layouts menu?

  • No, I quickly found that since code is left-aligned and with the editor on the left, I always have my head pointing left and this leads to neck pain. I like to look at the middle of my screen, so I use a "flipped" layout where the editor is on the right. That way every line of code start right in the center.
  • I also need to interact with graphics (zooming, panning, ginput, etc.) so the first thing I do on a fresh install, after swapping my layout, is to disable the plot pane and have "automatic" backend for matplotlib.

Do you use a custom layout for Spyder? It’d be great if you could describe it or share screenshots.

  • Please see the attached screenshot.

Screen Shot 2021-08-18 at 11 22 46

What tasks do you do when working in Spyder? (By tasks I mean things like writing code, debugging code, presenting and/or teaching, and so on.)

  • Mainly writing and debugging code.

What panes/plugins do you notice yourself using most?

  • Editor and console (of course), Files and Outline. Sometimes I use the help pane to have nicely formatted help. Sometimes I use the variable explorer to explore some larger pandas dataframes.

What panes/plugins do you notice you rarely or don’t use?

  • Any pane that is not on the screenshot :-) But that doesn't mean they are useless, I just don't have use for those. The main toolbar is particularly useless for me, despite its name.

Other comments:

  • The new look is better than the old one. Congratulations, it's a great step in a better direction. I however think some sections should not be white: the toolbars for example. Currently, the main toolbar is a darkish grey, but the secondary toolbars are white, with the tabs being another darkish grey. In my opinion, white should be for text only, and the secondary toolbars should be light gray.
  • I think you changed the GUI backend on mac, or something, because now I can't navigate dialog buttons using keyboard. Usually on a Mac, when dialog control accessibility options are activated, Enter means OK, Space activates the focused button (Cancel by default), and Tab moves the focus between actionable elements. I can't see this behaviour anymore so I now have to click. For me it's not a big problem, but for people with disabilities, it could become one.
  • If you decide to adopt a "reversed-style" like the one I use, just look at my toolbar, that I had to flip also to stay coherent. I have two "Open" buttons very near one to the other. It is weird: for the same icon, one selects a folder, the other opens a file. Not a big problem, but weird enough.
  • When I programmed in Matlab, I like that I had the option to put editor tabs on the left, one stacked on top of the other.
    This completely solves the tab clutter when multiple files are open. See the attached picture to see what I mean.

Screen Shot 2021-08-18 at 11 42 13

Thanks for your nice work and congratulation for your willingness to consult the users, it's very nice of you.

@isabela-pf
Copy link
Collaborator Author

@felixchenier thank you so much for this helpful description! Great feedback makes it possible to make helpful changes. Keeping the editor on the right to minimize neck pain is really clever!

@ccordoba12
Copy link
Member

ccordoba12 commented Sep 7, 2021

@mrclary, @impact27, @jnsebgosselin, @jitseniesen, @eafpres, @Richardk2n, @ok97465, @jsh9, @ma-sadeghi, @OverLordGoldDragon, @texadactyl, @stonebig, we'd love to read your opinion about this topic. We know you're very active users/developers and have collaborated with us throughout the years to improve Spyder in several ways. So we hope you can give us a hand with this too.

One of our main goals for Spyder 6 is to revisit our current layout, in order to accommodate more plugins and add a couple more too. @isabela-pf is going to be charge of that effort and this is the first step in that direction.

If you have colleagues or friends that you think can give us valuable feedback about this, please ping them here too.

@impact27
Copy link

impact27 commented Sep 7, 2021

I use Spyder mainly to write/debug code. I use the default layout. I usually always need access to the code and the console, and the last plug-in can be whatever depending on what exactly I am doing. If I am on a large screen, I use the split editor to take 2/3 of the screen, and 1/2 on a small screen.

Maybe having an option to switch layout while debugging could be nice? But I would have to try it to know if it feels right.

I agree that the tabs can definitely be improved. One of the biggest issues I have is that after debugging for a while, I have way too many tabs open, and the current method of switching tabs doesn't really work for N > 6 tabs. Maybe having a way of automatically closing tabs that are only traversed by the debugger would help? (If a file is opened by the debugger but not interacted with, it could be close when the debugger leaves the file?)

@texadactyl
Copy link

texadactyl commented Sep 7, 2021

Q. What types of projects do you do in Spyder?
A. Primarily computational:

  • Seti Institute Breakthrough Listen program
  • Cryptography

Q. Do you use the default layout for Spyder?
A. Yes. I am a boring user of Spyder!

Q. What tasks do you do when working in Spyder?
A. Editing, Code Analysis, Execution or Debugging (Console), Variable Explorer when debugging.

My current usability issues (minor):

  1. Code Analysis: For some imports, there are variables that are actually there but cannot be found. For example, in astropy.constants, the following constant reference always generates an E1101 error: astropy.constants.c.value.
  2. Editing: Sometimes the editor anticipates too much and covers up the source code in an annoying fashion. I am trying to find a happy medium.
  3. Still waiting for Spyder to catch up to the latest Qt! (-: Then, I can get rid of miniconda. My issue with miniconda is that my partners do not build conda packages (they're scientists who have been conditioned to pypi). Ironically, conda is superior to pypi in managing packages, IMO. However, mixing conda and pypi is like petrol and water - even with the use of conda environments. I have been burned and my scientist colleagues get in worse trouble.

Big Ticket Item Wish list!

I use vsc for Julia, Go, and C/C++. Ugh! That is one of the most confusing IDEs that I have ever used. Save me! (-:

I also use vsc for Python over an ssh/rsa connection. For example, the UC Berkeley data centre is remote from me. I find it helpful to develop and debug in addition to execute on data centre compute nodes. The remoteness is transparent. But, I'd much rather use Spyder. Hint, hint.

@eafpres
Copy link

eafpres commented Sep 7, 2021

What types of projects do you do in Spyder?

My work is mainly Data Science. Projects can comprise several source files. A few hundred lines is a long file, but some can be longer.

Do you use the default layout for Spyder? What about any of the other preset layouts in the View > Window layouts menu?

Way back when, I used the Rstudio layout as a starting point. I have evolved some from there.

Do you use a custom layout for Spyder? It’d be great if you could describe it or share screenshots.

Here is my preferred layout:
image

Do you use different layouts? If so, what makes you switch out what you have open? Once again, descriptions and/or screenshots are helpful here.

I don't generally change layouts. I often make the plots window bigger on a temporary basis.

What tasks do you do when working in Spyder? (By tasks I mean things like writing code, debugging code, presenting and/or teaching, and so on.)

Writing code
generating plots for presentation
some code analysis
some debugging

What panes/plugins do you notice yourself using most?

code
outline
console
variable explorer
plots
files
history

roughly in that order of use

What panes/plugins do you notice you rarely or don’t use?

Project (although I keep it open)
Help

Are there any panes/plugins you usually use together?

Code, outline, console, variable explorer are usually visible. Plots if I'm plotting.

@OverLordGoldDragon
Copy link

OverLordGoldDragon commented Sep 8, 2021

I still use Spyder 4 - my sole reason is 5's bulkier layout. Multiline editing would be more important but so far 5 doesn't seem to offer anything to make it a net-positive.

I use Spyder for all Python coding, make extensive use of cells, debugger, plots pane, "previous command" via arrow up, Ctrl + P, and collapsing. My view is always split 50/50, editor on left, and all else on right; no 3+ windows.

I don't use Kite, or suggestions/tips in Editor as they overlay code; I would prefer having a hotkey to temporaily enable all of these. I'd also consider a transparency option so code isn't blocked entirely - and I must be able to click through the overlay, on code, as if the overlay wasn't there.

Such details aren't the greatest selling points so I appreciate the dev team's efforts on feedback.

@ok97465
Copy link

ok97465 commented Sep 8, 2021

What types of projects do you do in Spyder?

  • Image processing, SIgnal processing

Do you use a custom layout for Spyder? It’d be great if you could describe it or share screenshots.

spyder

  • I'm using the layout as above, but the upper right panes are inconvenient because they're short.

What tasks do you do when working in Spyder? (By tasks I mean things like writing code, debugging code, presenting and/or teaching, and so on.)

  • writing code, debugging code,

What panes/plugins do you notice yourself using most?

  • plots/ variable explorer / help / outline/ ipython console / editor

What panes/plugins do you notice you rarely or don’t use?

  • Files / break point / code analysis

@Richardk2n
Copy link

Q: What types of projects do you do in Spyder?
A: Application development and research (evaluation and plotting of data) mostly. (Also a tiny bit of small scripts to automate simple tasks)
Q: Do you use the default layout for Spyder? What about any of the other preset layouts in the View > Window layouts menu?
A: No non of those where quite what I am looking for and as making my own was very easy, I opted for that instead.
Q: Do you use a custom layout for Spyder? It’d be great if you could describe it or share screenshots.
A: Yes
grafik
Q: Do you use different layouts? If so, what makes you switch out what you have open? Once again, descriptions and/or screenshots are helpful here.
A: No
Q: What tasks do you do when working in Spyder? (By tasks I mean things like writing code, debugging code, presenting and/or teaching, and so on.)
A: Almost exclusively writing code.
Q: What panes/plugins do you notice yourself using most?
A: code; console; project view; outline
Q: What panes/plugins do you notice you rarely or don’t use?
A: The plots. I would like to use it, but it is to small to use effectively. If i could klick on it and bring it to the foreground somehow (like make it temporarly bigger, so that i can look at the image in detail also with zoom and stuff like that) that would be really nice. Also other panes could profit from that.
Q: Are there any panes/plugins you usually use together?
A: The ones I use the most.

Also I would like to add some more points.
For the most parts I am very happy with the interface. There are just some smaller issues, that i have with it. I am not sure if here is the perfect spot to state them, but I might as well.
I would really like the plot window to have some more functionality. (Klicking on plots to make them big and beeing able to zoom into them).
Also the help pane renders the doc string nicely, could we have that for the mousover as well?
Some panes seem to have a minmal size beyond that they cannot be made smaller (for example the Help/Variable/Plots pane) sometimes it would be nice to be temporarly able to just make it really small to look at the stuff in an adjacent pane a little better.
A search for the project view and outline would be nice.
Also please fix spyder#14546 it probably annoys me more than it should an it is no big deal, but it would improve ux

@ok97465
Copy link

ok97465 commented Sep 8, 2021

My comment may be off-topic. However, I'd like to briefly introduce Vim's UX, which I often use when writing simple Python programs.

In Vim, a pop-up window can function as some pane of the spyder.

The pop-up window plays a different role as follows by simple commands or shortcuts.

Finds Code Analysis Projects
Find analysis projects_pane
Recent Project commits History
recent_project git_commits command_history

It is convenient because it performs multiple functions in a unified GUI.
And the pop-up windows do not always occupy the screen like pane, so more space can be allocated for Editor or Plot pane.

Thank you for reading through.
I hope you understood my English.

@Richardk2n
Copy link

I was just reminded of another thing that might be interesting:
spyder clearly has some sort of git integration, it would be nice to be able to expand that to enable the usual operations (push, pull commit) via gui.

@ma-sadeghi
Copy link

What types of projects do you do in Spyder?

I use Spyder for development and debugging of scientific computing projects.

Do you use the default layout for Spyder? What about any of the other preset layouts in the View > Window layouts menu?

Yes, I use Spyder's default layout:

image

Do you use a custom layout for Spyder? It’d be great if you could describe it or share screenshots.

NA.

Do you use different layouts? If so, what makes you switch out what you have open? Once again, descriptions and/or screenshots are helpful here.

NA.

What tasks do you do when working in Spyder? (By tasks I mean things like writing code, debugging code, presenting and/or teaching, and so on.)

I use Spyder mainly for writing code and debugging.

What panes/plugins do you notice yourself using most?

In the order of decreasing priority: Editor > Console > Plots > Find >= Help >= Project

What panes/plugins do you notice you rarely or don’t use?

In the order of decreasing priority: Files (I guess because I use Project pane) > Variable Explorer (I use the console for this purpose as inspecting large arrays is easier in the console, also more smooth and less laggy) > Profiler > Outline

Are there any panes/plugins you usually use together?

Editor + Console + Plots all the time!

Here are some more comments:

  • It'd be great if there was a shortcut to show/hide panes, for instance the Project pane is useful for navigation every now and then, but most of the time I want it hidden. Currently, the assigned shortcut: ctrl + shift + p only shows the pane if it's hidden, but not the other way around.
  • When debugging, it seems that Spyder has some reserved keywords that sometimes clash with actual variable names, for instance IIRC, if you have a variable p and want to access it in the debugger, it terminates the debugging session, so you'd have to do print(p) which is rather verbose. Not a big deal, but it would be nice to somehow fix it.
  • The quality of the figures in the Plots pane is an issue. I think you already have an open issue to address it, but it seems that it's being pushed back every time. I understand though that you're time-strapped, just saying.
  • Variable explorer is sluggish, or at least for my projects where I tend to have many large arrays, it seems very unresponsive.

Overall, I'm pretty happy with Spyder.

@jsh9
Copy link

jsh9 commented Sep 9, 2021

What types of projects do you do in Spyder?

Scientific computing (a.k.a., number crunching). To be more specific: I write and run scripts in Spyder, run/debug them, and view results in Spyder's IPython console.

Btw, when writing code for Python libraries, I use PyCharm instead of Spyder. This is because PyCharm's code navigation is better than Spyder (at least as of Spyder 4 -- I haven't tried Spyder 5 for Python library development yet).

Do you use the default layout for Spyder? What about any of the other preset layouts in the View > Window layouts menu?

No. My layout is modified from Spyder's "Matlab layout".

Do you use a custom layout for Spyder? It’d be great if you could describe it or share screenshots.

Here is the layout that I am using:

image

Do you use different layouts? If so, what makes you switch out what you have open? Once again, descriptions and/or screenshots are helpful here.

No, I only use the layout shown above.

What tasks do you do when working in Spyder? (By tasks I mean things like writing code, debugging code, presenting and/or teaching, and so on.)

  • Write code
  • Debug code
  • Run code

What panes/plugins do you notice yourself using most?

From most frequent to least frequent:

  • Editor
  • IPython console
  • Variable explorer
  • Files
  • Help
  • Profiler (I'm not sure it counts as a pane -- it only shows up when I use the profiler)
  • Outline
  • History

(If a pane is not mentioned above, it means that I never use it.)

What panes/plugins do you notice you rarely or don’t use?

  • Plots
  • History

(If I don't mention a pane/plugin, it means that I don't even know that it exists.)

Are there any panes/plugins you usually use together?

  • I use Editor, IPython console, Variable explorer when debugging
  • I use Editor, IPython console, and Help when writing code

@mrclary
Copy link

mrclary commented Sep 10, 2021

Screen Shot 2021-09-08 at 6 42 23 AM

  • What types of projects do you do in Spyder?
    • Data analysis for a science research company
    • Code development for a science research company
    • Code development for Spyder :-)
  • Do you use the default layout for Spyder? What about any of the other preset layouts in the View > Window layouts menu?
    • Pretty much the default layout. The exception is that I use the Project pane frequently, but place it with the Help, Variable Explorer, and Find widgets.
  • What tasks do you do when working in Spyder? (By tasks I mean things like writing code, debugging code, presenting and/or teaching, and so on.)
    • Writing code
    • Debugging code
    • Searching within source code
    • Plotting
  • What panes/plugins do you notice yourself using most?
    • Editor. Sometimes in split view.
    • IPython Console
    • Project
    • Help
    • Find
  • What panes/plugins do you notice you rarely or don’t use?
    • Files
    • Outline. I like the idea of the Outline pane, but it takes up too much space for me, so I prefer to use the class/function selector in the Editor. It achieves the same objective: provides a visual outline of what's in the file and an easy way to navigate to a location. Although I'd prefer the dropdown selector window to be larger than 9 lines :-)

@jtskowronek
Copy link

jtskowronek commented Apr 7, 2022

  1. How Spyder handles figures: I've been using -- and I direct plenty of physics and engineering students to use -- Spyder in hopes that it will function like MATLAB
  • Interactive runtime session
  • Convenient figure creation and interaction
  • Powerful step-through debugging integrated with the terminal, etc.,
  1. --> (this is 1. cont'd) ... except with a powerful OOP language for doing a lot more MLOps sorts of things with. But we have so far been unable to get Spyder to display and handle matplotlib figures in an acceptable or consistent way. The Spyder plot panel doesn't seem to allow modifications to or interactivity with figures, despite having an active figure handle in the script. And there seems to be no way to selectively, either programmatically or manually, close figures in the pane to avoid visual overload with too many things going on at once.

  2. When opting to bypass the plots pane in favor of pop-out figures, various backends function inconsistently, and we're unable to reliably get figures to display what and when we need them to.

  3. The way Spyder handles figures is also inconsistent between OS platforms, so I'm constantly having to waste hours experimenting with different options whenever I switch OS's (I prefer Mac, but often I'm forced to have my Windows machine with me for certain tasks). You have left it up to your users to be experts in how matplotlib, etc., function, but I have yet to find any good references that don't complicate the matter even further.

  4. Duplicate tabs: I tend to have many files open at once, and it's a major inconvenience having duplicate tabs when I'm using the multiple-editors layout. See attached pic of my Windows layout. I use the same layout on my Macbook, minus one of the editor columns.

  5. I love the option to undock panels, but with all of the debugging I do (step through, step in, etc.), it's not feasible to keep the panels undocked because the control focus shifts from the editor to the undocked panel, which is inconsistent with how this functions when the panels are docked. I need to be able to make debugging steps seamlessly.

  6. Jupyter notebooks, which so many ML people seem to prefer, isn't a good option because it has been a huge nightmare to implement any sort of streamlined debugging workflow.

  7. Once I have more time to focus on building my coding skills, I imagine I'll switch to using an IDE that functions more like VIM, for the same reasons @ok97465 mentioned already.

image

@ccordoba12
Copy link
Member

ccordoba12 commented Apr 10, 2022

Hey @jtskowronek, thanks for your feedback. About your points:

The Spyder plot panel doesn't seem to allow modifications to or interactivity with figures, despite having an active figure handle in the script

That's correct. The pane is designed to display static figures only. However, we plan to support the Maplotlib web backend in the future to overcome this limitation.

And there seems to be no way to selectively, either programmatically or manually, close figures in the pane to avoid visual overload with too many things going on at once

I guess this means that you would like to select certain figures from the thumbnails bar on the right and remove them with a single click, right? Please confirm if that's the functionality you'd like to see.

When opting to bypass the plots pane in favor of pop-out figures, various backends function inconsistently, and we're unable to reliably get figures to display what and when we need them to.

This should work much better in Spyder 5.3.0, released a couple of weeks ago. We removed old backends and made the others work more reliably. Please update with our Windows/Mac installer or Conda-forge (since that version is still not available in Anaconda) and let us know how it works for you.

The way Spyder handles figures is also inconsistent between OS platforms

Please expand on what you mean by this because I don't understand it. Spyder is only in charge of handling some options to display figures, but it's Matplotlib at the end which creates them.

Duplicate tabs

I see. We'll take that into account for Spyder 6 to see if we can avoid that.

I love the option to undock panels, but with all of the debugging I do (step through, step in, etc.), it's not feasible to keep the panels undocked because the control focus shifts from the editor to the undocked panel

Thanks for mentioning that this is a serious usability issue while debugging (I was not aware it was so annoying). Just to confirm: are you using our debugging toolbar (i.e. the blue buttons on top) to step through, step in, etc? If that's the case, it can be fixed easily and we could have it on time for our next version (5.3.1).

Once I have more time to focus on building my coding skills, I imagine I'll switch to using an IDE that functions more like VIM

Then you'll loose our variable explorer and debugger.

@CAM-Gerlach
Copy link
Member

Once I have more time to focus on building my coding skills, I imagine I'll switch to using an IDE that functions more like VIM

We also have a plugin to make Spyder work more like Vim (though unfortunately, it still needs to be updated to the new Spyder 5 plugin API).

@jtskowronek
Copy link

@ccordoba12 sorry for the delay, and apologies for the forthcoming incomplete reply... I'll give a proper reply once things settle down a bit around here. But in the meantime, I can give you a few quick answers:

And there seems to be no way to selectively, either programmatically or manually, close figures in the pane to avoid visual overload with too many things going on at once

I guess this means that you would like to select certain figures from the thumbnails bar on the right and remove them with a single click, right? Please confirm if that's the functionality you'd like to see.

Yes, if I'm going to have >20 figures floating around, I'd like to quickly select the irrelevant ones and close them with one click. It would be even more helpful to be able to also do this programmatically within a script. We're using the script + figures as an interactive GUI of sorts -- with "input" statements, etc., determining the program flow. I know this is getting into GUI functionality that would be better implemented in a more specialized way, but I don't have to make this sort of GUI development leap when I'm using MATLAB.

When opting to bypass the plots pane in favor of pop-out figures, various backends function inconsistently, and we're unable to reliably get figures to display what and when we need them to.

This should work much better in Spyder 5.3.0, released a couple of weeks ago. We removed old backends and made the others work more reliably. Please update with our Windows/Mac installer or Conda-forge (since that version is still not available in Anaconda) and let us know how it works for you.

We haven't had a chance to test this on Spyder 5.3.0 yet, but not for lack of want (see sidenote that follows).

(Sidenote: I use the standalone installers on both Windows and Mac, and so far every time I've upgraded Spyder I've had to create a new environment in order to install spyder-kernels. They won't install to an existing environment, even after I've removed the existing spyder-kernel version. So I avoid upgrading for as long as possible.)

The way Spyder handles figures is also inconsistent between OS platforms

Please expand on what you mean by this because I don't understand it. Spyder is only in charge of handling some options to display figures, but it's Matplotlib at the end which creates them.

If this is still a problem after your latest upgrade, I'll make a video to show you what's happening here.

I love the option to undock panels, but with all of the debugging I do (step through, step in, etc.), it's not feasible to keep the panels undocked because the control focus shifts from the editor to the undocked panel

Thanks for mentioning that this is a serious usability issue while debugging (I was not aware it was so annoying). Just to confirm: are you using our debugging toolbar (i.e. the blue buttons on top) to step through, step in, etc? If that's the case, it can be fixed easily and we could have it on time for our next version (5.3.1).

I use my mouse as little as possible. So when you ask if it's the debugging toolbar buttons I'm referring to, the literal answer is no; but I assume using hotkeys is programmatically equivalent to using the buttons -- so effectively my answer is probably yes.

Once I have more time to focus on building my coding skills, I imagine I'll switch to using an IDE that functions more like VIM

Then you'll loose our variable explorer and debugger.

VS Code has a pretty good VIM extension that seems to integrate well with the normal editor functionality (or whatever extensions are required to make it normal), and it includes variable explorer and debugger. I just haven't completely adopted VS Code yet because of what I assume to be matplotlib event handlers closing out figures after the main script returns. Once I figure out what's going on with this, I'm not sure there will be any more reasons to not adopt VS Code entirely.

But I'll continue trying to make Spyder work, at least for now.

@jtskowronek
Copy link

Once I have more time to focus on building my coding skills, I imagine I'll switch to using an IDE that functions more like VIM

We also have a plugin to make Spyder work more like Vim (though unfortunately, it still needs to be updated to the new Spyder 5 plugin API).

@CAM-Gerlach thanks for the link, I'll checky.

@t-elston
Copy link

t-elston commented May 11, 2022

Hi there - I'm a neuroscientist and a recent python convert from Matlab. Broadly, I think Spyder is great and I am very happy to see that development towards version 6 is continuing. I really appreciate the customizability of most of the editor components.

  • What types of projects do you do in Spyder?

Mainly analysis of neurophysiological data - so, lots of data wrangling and modelling.

  • Do you use the default layout for Spyder? What about any of the other preset layouts in the View > Window layouts menu?

I use a variant of the default layout - see screenshot below
spyder layout

  • Do you use a custom layout for Spyder? It’d be great if you could describe it or share screenshots.

For the most part, I use the standard spyder layout but have the Outline pane to the left of the editor.

  • Do you use different layouts? If so, what makes you switch out what you have open? Once again, descriptions and/or screenshots are helpful here.

I generally don't change layouts.

  • What tasks do you do when working in Spyder? (By tasks I mean things like writing code, debugging code, presenting and/or teaching, and so on.)

I figured out how to interactively debug functions within modules called from the main.py file in a way similar to matlab's debugging experience. Honestly, this is the real reason I fully committed to Spyder because I could not find another IDE that allows that. For anyone interested, it works like this:

# a dummy module -  my_module.py
import pdb

# a function inside of my_module.py
def test_func1(some_data, debug_):
        if debug_:
            pdb.set_trace()

Now, if you call my_module.test_func1(some_data, debug_=True) from a main.py script, Spyder will recognize (and stop) and the breakpoints inside of the individual functions within the module. Some people don't really use the debugger but I generally write my code in debug mode so that I can directly and iteratively develop production-ready code.

If there were a way to do this kind of debugging in a slightly less hacky way, it would be greatly appreciated (but this works without issue).

  • What panes/plugins do you notice yourself using most?

In order:

  1. editor
  2. variable explorer
  3. console
  4. plots
  5. code outline
  • What panes/plugins do you notice you rarely or don’t use?

I basically never use the help, files, and find panes.

  • Are there any panes/plugins you usually use together?

editor + outline + variable explorer most critically

As a last UX request, could we get functionality to change the pane colors beyond the "Background" and "Side Areas" of just the editor and console? E.g. could we start to change the color of the toolbar along the top and other panes? At the moment, those colors are locked in by the Light/Dark theme and can make other-wise cool background/side area color-schemes rather jarring.

Again, I'm glad to see Spyder is heading towards version 6 and keep up the good work!

@CAM-Gerlach
Copy link
Member

For anyone interested, it works like this:

FYI, in any (upstream) supported version of Python, you can just use the breakpoint() builtin, which allows simplifying your code a bit, like this:

# a dummy module -  my_module.py

# a function inside of my_module.py
def test_func1(some_data, debug_):
        if debug_:
            breakpoint()

If there were a way to do this kind of debugging in a slightly less hacky way, it would be greatly appreciated (but this works without issue).

See the documentation for some possibilities; you could use Spyder's built-in breakpoints, which are remembered across sessions, can be displayed and managed in the Breakpoints pane, and most importantly support conditional breakpoints, where the breakpoint only triggers if a condition evaluates true, which can be arbitrary Python code.

So, to replace the above, you can have a function

def test_func1(some_data, debug_):
       ...  # Your function code here  <--- Conditional Breakpoint Here

And then set a breakpoint on the first line, with condition debug_, so whenever debug_ is truthy, the breakpoint triggers. Only difference with that is that you need to use "Debug file" instead of "Run file" for it to work.

@ccordoba12
Copy link
Member

Hey @t-elston, thanks a lot for feedback! About your comments:

I figured out how to interactively debug functions within modules called from the main.py file in a way similar to matlab's debugging experience. Honestly, this is the real reason I fully committed to Spyder because I could not find another IDE that allows that.

For me that's perhaps the best thing after sliced bread! I mean, debugging in the way Spyder allows right now is so useful to see the inner working of your code and catch errors early in your development process.

As @CAM-Gerlach said, you just need to use breakpoint() wherever you want to enter the debugger instead of pdb.set_trace(), which is fine too, but it's a bit more cumbersome.

As a last UX request, could we get functionality to change the pane colors beyond the "Background" and "Side Areas" of just the editor and console? E.g. could we start to change the color of the toolbar along the top and other panes? At the moment, those colors are locked in by the Light/Dark theme and can make other-wise cool background/side area color-schemes rather jarring.

We can't allow users to change that because it's tied to the css we use to style Spyder. But would you like to see the main toolbar and similar areas of Spyder to inherit the same color of the syntax highlighting theme used for editor? That's the best we could do.

@t-elston
Copy link

Cheers + thanks for the responses and tips @CAM-Gerlach and @ccordoba12. I've started to use breakpoint().

But would you like to see the main toolbar and similar areas of Spyder to inherit the same color of the syntax highlighting theme used for editor?

Broadly, yes - that sounds good. If this would essentially mean that the rest of the pane background colors can be matched to either the editor background color or side area color, then this would be nice.

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