Syntax Highlighting and Intellisense

Hey all! :smiley:

Using SWAN so that I don’t hit my memory ceiling in Jupyter as quickly as I do on my local device. However, I’m really missing the syntax highlighting/autocomplete/intellisense from my local VSCode environment. This is really a pain during debugging and code writing stages, and this pain is compounded by the fact that you have to restart the Jupyter kernel every time you modify any module outside of the main notebook.

Has anyone been working on this type of thing?

Hi Hayden,

Jupyter notebooks are not IDEs so you can’t really compare them with VSCode in terms of functionality. That being said, they do have syntax highlighting and some level of autocompletion (by pressing tab).

Regarding notebook restarts, you can try installing packages in editable mode, then any modifications should be visible to the notebook without kernel restart.

Cheers,

Enric

Hi Enric,

Thank you for getting back to me! Yes, this I understand completely.

Using this space to brainstorm, not criticize- SWAN is really useful.

I guess that what I’m getting at is that a lot of us use SWAN because it gives us direct access to cloud-based storage (e.g. stuff that we store on EOS that we can’t access across the globe without a mounted drive). On top of that, it’s not always possible to access a device with a mounted drive (shared/public computers, etc.) and I was wondering whether it might not be possible to start some sort of remote environment on a cluster of CPUs with mounted drives (like the CPUs accessed via SWAN) which is more user-friendly than SWAN (e.g. some Windows/Linux/Unix machine with a Python distribution and a good IDE, like VSCode/VS).

Limitations I hope this will address:

  • SWAN is really not ideal for playing around with larger Python projects.
    • Any modules consisting of .py files are hard to edit; no edits will be reflected in Jupyter unless the kernel is restarted (common problem with using Jupyter everywhere,).
    • Again, the lack of syntax highlighting really means that debugging/experimental coding almost always has to be offloaded to my personal device, and then reimported to SWAN (e.g. via a github repo that I’m cloning). Which brings me to…
  • Using Git via the experimental interface is VERY hard. Almost impossible to deal with merge errors, and behavior is often unreliable (e.g. when switching or merging remote branches).
    • Happy to start to compile a list of issues that I’ve had while trying to use Git. Suffice it to say that there are a few…

If you’re looking for comparable platforms, my home institution (Uni of Oxford, UK) has several advanced research clusters, which include interactive nodes that allow code editing in IDEs :smiley:

So while I think that SWAN is great, I wonder if there isn’t motivation for a wider, more dynamic/versatile cloud-based service that would allow easier editing of .py/.json/java scripts/c/c++ etc., as a service that only allows Julia/Python/R in a Jupyter environment doesn’t adequately reflect the needs of some of us out there (consider the tiny fraction of the coder community occupied by Julia/R users compared to Python/C/C++/Java users :slight_smile: ).

Let me know what you think!

HRR

Hi Hayden,

Thanks for the feedback. Indeed, adding an IDE to SWAN is something that has been suggested and discussed in the past. For example, Visual Studio on the web, as a complement to the notebook interface, running in the same container and sharing access to EOS. This would mean evolving the service towards a platform for development, not only for exploratory analysis.

I believe that would make sense. At the same time, it is true that one can already combine an IDE and SWAN via CERNBox. You can install the CERNBox sync client on your laptop, use your IDE of choice, and automatically sync files to be used in SWAN.

Cheers,

Enric