Differential equations, defined in Python strings, are at the core of Brian’s model descriptions. They use a language familiar to computational neuroscientists, and closely follow the way that languages are described in scientific articles. Defining these equations in strings has the advantage that these descriptions are very concise, and can be read as mathematical equations, and not as programming code. The fact that equations are “just strings” does have disadvantages as well, though: from the point of view of a code editor, they are simply text and do not benefit from helpful features such as syntax highlighting, autocompletion, or syntax checks.
To improve this situation, a former GSoC student implemented g a Brian-specific “Language Server extension” and syntax highlighting rules, that provides these features for Brian equations embedded in a Python script. The Language Server Protocol (LSP) has been created by Microsoft and is used to provide advanced editing features to editors such as Visual Studio Code, but it is now supported by a large number of editors.
The goal of this project is to complete the work on the existing proof-of-concept and make it production-ready. In particular:
- Make the installation progress smooth and integrate with VS Code’s existing Python support
- Implement a smart and robust detection of equation strings
- Implement semantic autocompletion
- Implement helpful error displays inside an equation string
- If time permits: add support for automatic formatting of equations
Skill level: intermediate
Required skills: JavaScript/TypeScript, JSON, asynchronous programming, basic knowledge of grammars/regular expressions.
Lead mentor: Benjamin Evans (B.D.Evans@sussex.ac.uk)
Project website: GitHub - brian-team/brian2: Brian is a free, open source simulator for spiking neural networks. · GitHub and GitHub - brian-team/brian-code-editor: GSoC 2023 project: Code editor support for Brian model equations · GitHub
Backup mentors: Marcel Stimberg (marcel.stimberg@sorbonne-universite.fr; mstimberg on NeuroStars) , Dan Goodman (d.goodman@imperial.ac.uk; d.goodman on NeuroStars)
Tech keywords: Python, Visual Studio Code, Language Server Protocol