Replace Coder with Spyder?

119 views
Skip to first unread message

Jonas Lindeløv

unread,
Nov 4, 2012, 5:34:12 PM11/4/12
to psycho...@googlegroups.com
I'd like to hear your oppinions on replacing Coder with Spyder (= Scientific Python Editor)? Spyder has some very neat features that makes coding a breeze. Me and several of my collegues are using Spyder for psychopy scripting now.
See http://code.google.com/p/spyderlib/


Essential features:
  • Object documentation (lower left in screenshot for TextStim). Saves a huge amount of time browsing the API on psychopy.org.
  • Autocompletion - also on instances of objects ("stim" which is a TextStim in screenshot). Also saves a lot of time.
  • Syntax warnings and errors in UI (see line 8 in screenshot: "core imported but unused")
Other nice features:
  • Tabbed outputs - one for every open script
  • Uses system font as default
  • Flexible layout (I grouped history, dir, variables and docs to the lower left, as you can see)
  • Variable explorer
  • Command history
  • Script profiling, interactive debugging etc.
What's missing in Spyder: Spyder does not have links to Monitor Center, Demos or Color Picker. This might be incorporated in the Spyder version shipped with PsychoPy. But a simpler approach would be to consider Builder the ONLY user interface of psychopy. Of these missing features, accessing demos is the only of these I consider a real disadvantage to replacing Coder with Spyder. However, I expect that the slope of the learning curve for beginners is reduced more by the in-window documentation, autocompletion and errors/warnings than the menu with links to demos.

What do you think?

(Note: Simon's recent post in psychopy-users on Spyder was fixed by reinstalling psychopy. Spyder now imports psychopy)

Jonathan Peirce

unread,
Nov 5, 2012, 4:15:24 AM11/5/12
to psycho...@googlegroups.com
Hi Jonas,

I agree that Spyder is way more capable than Coder - I use it a fair bit myself.

Concerns;
    - time spent packaging/integrating this (specifically, I don't have it ;-) )
    - will it be too much for a beginner? For a less-advanced programmer the simplicity of Coder is kinda nice, although code inspection using rope be useful and doesn't introduce complexity. More competent programmers can probably download Spyder themselves?
    - when a script is run, does spyder increase overhead, potentially making performance worse? ie can we turn off things like the code inspection while running?
   
I feel like it's handy to have a basic editor built-in and we just point out to people that Spyder is a useful more-advanced editor that can run alongside PsychoPy. We could add notes to this effect in the Coder documentation, and in the tips window. There are commercial packages, like WingIDE and PyCharm that are even more powerful than Spyder. I personally sitll use Coder itself for simple tasks, checking a script etc, and then switch to Spyder or PyCharm if I'm doing some hard grind.

Jon


On 04/11/2012 22:34, Jonas Lindeløv wrote:
I'd like to hear your oppinions on replacing Coder with Spyder (= Scientific Python Editor)? Spyder has some very neat features that makes coding a breeze. Me and several of my collegues are using Spyder for psychopy scripting now.
Essential features:
  • Object documentation (lower left in screenshot for TextStim). Saves a huge amount of time browsing the API on psychopy.org.
  • Autocompletion - also on instances of objects ("stim" which is a TextStim in screenshot). Also saves a lot of time.
  • Syntax warnings and errors in UI (see line 8 in screenshot: "core imported but unused")
Other nice features:
  • Tabbed outputs - one for every open script
  • Uses system font as default
  • Flexible layout (I grouped history, dir, variables and docs to the lower left, as you can see)
  • Variable explorer
  • Command history
  • Script profiling, interactive debugging etc.
What's missing in Spyder: Spyder does not have links to Monitor Center, Demos or Color Picker. This might be incorporated in the Spyder version shipped with PsychoPy. But a simpler approach would be to consider Builder the ONLY user interface of psychopy. Of these missing features, accessing demos is the only of these I consider a real disadvantage to replacing Coder with Spyder. However, I expect that the slope of the learning curve for beginners is reduced more by the in-window documentation, autocompletion and errors/warnings than the menu with links to demos.

What do you think?

(Note: Simon's recent post in psychopy-users on Spyder was fixed by reinstalling psychopy. Spyder now imports psychopy)

-- 
Jonathan Peirce
Nottingham Visual Neuroscience

http://www.peirce.org.uk/

Jonas Lindeløv

unread,
Nov 5, 2012, 9:54:53 AM11/5/12
to psycho...@googlegroups.com
Hi Jon

Comments below :-)


On Monday, November 5, 2012 10:15:27 AM UTC+1, Jon wrote:
Hi Jonas,

I agree that Spyder is way more capable than Coder - I use it a fair bit myself.

Concerns;
    - time spent packaging/integrating this (specifically, I don't have it ;-) )

Damn! ;-) Yes, you've done your fair share of packaging. Spyder is in Debian/Ubuntu repositories so simply marking it as a dependency would do the trick. But I don't know about windows/mac. I guess we're just discussing whether it's on the wish list when a happy-to-package developer comes by.

I originally thought it would save some time in the long run since Coder wouldn't have to be maintained and we could get the goodies from the active Spyder development.
 
    - will it be too much for a beginner? For a less-advanced programmer the simplicity of Coder is kinda nice, although code inspection using rope be useful and doesn't introduce complexity. More competent programmers can probably download Spyder themselves?

I see your point but my guess is that the beginner coding experience would actually be simpler using Spyder. I've seen two people choosing Presentation over Psychopy because Presentation had code completion and hence felt much less like "guessing" (as you probably know, programming is a big black box for newcomers and code completion keeps you in touch with the objects your manipulating). Also, in-window documentation reduces complexity for the beginner because they don't have to switch back and forth between coder and browser.
 
    - when a script is run, does spyder increase overhead, potentially making performance worse? ie can we turn off things like the code inspection while running?

Good point, I expect that Spyder won't be as resource efficient as Coder. Spyder does feel heavier in terms of boot speed and working with big files (visual.py, need I say more?). I'll be happy to speak to some Spyder internals about how much you can load off while running the script. 
 
   
I feel like it's handy to have a basic editor built-in and we just point out to people that Spyder is a useful more-advanced editor that can run alongside PsychoPy. We could add notes to this effect in the Coder documentation, and in the tips window. There are commercial packages, like WingIDE and PyCharm that are even more powerful than Spyder. I personally sitll use Coder itself for simple tasks, checking a script etc, and then switch to Spyder or PyCharm if I'm doing some hard grind.

Adding notes and recommendations is definitely a way forward. I'd be happy to do it if this discussion lands on  Spyder not being packaged with psychopy.
Reply all
Reply to author
Forward
0 new messages