GSoC 2023 Project Idea 22.2 Improved parser for Brian model descriptions (175h)


Computational research in biology commonly consists of describing a model system and its parameters, simulating the system with specialized software, and then analyzing the results. Model descriptions often make use of a domain-specific language that is parsed and interpreted by the simulation software. Such languages have the advantage that they are more accessible to researchers than code written in a general-purpose programming language; they also make it easier to discuss and share models with other researchers.

Parsing such languages is mostly straightforward with standard techniques, but these techniques regularly have at least two shortcomings:

  1. For syntactically incorrect descriptions, e.g. a missing parenthesis, error messages are typically not very helpful and of the form “unexpected symbol at position x”, and
  2. annotations via comments are usually simply ignored, instead of being used to enrich a model description.

Both of these shortcomings are currently present in the Brian simulator, an open-source simulator for biological spiking neural networks written in Python, developed in our research group and used by researchers world-wide. The Brian simulator describes models with a domain-specific language that uses mathematical notation with additional annotations, e.g. to assure the consistency of physical dimensions.

The goal of this internship is to rewrite the Brian simulator’s parsing code to give clear and helpful error messages for incorrect model descriptions, as well as treating comments in the model descriptions as annotations that are stored for future usage.

Skill level: intermediate

Required skills: Python programming, parser/compiler techniques.

Time commitment: Short (175 h)

Lead mentor: Marcel Stimberg (@mstimberg on neurostars), Dan Goodman (@d.goodman on neurostars)

Hey I’d love to work on this project if there isn’t someone working already. And if that’s the case It will be very helpful if I could get some resources for the project. Looking forward to work on this amazing project

Dear @mstimberg @d.goodman,
I am a programmer and Bachelor’s level student in software development at École 42 Nice in the South of France. I am looking for a project where I can contribute among the ideas of your open source project because I have a deep curiosity in the domains of neuroscience and neuroinformatics. I think that my competence and experiences could be a great fit to this project. I have solid skills in python programming and in the past I have worked on a number of projects dealing with parsing, specially while constructing a simple version of bash interpreter and while reimplementing a simple version of HTTP server, both in C and C++.
I got specially interested into this idea of project because you mentioned that the contributor might have to deal with the domain specific language. I’d appreciate your opinion and also know more about the project since I’d love to take this opportunity not only as a programmer but also as learner who wants to deepen my knowledge about the domain.
Thank you and looking forward to hearing from you !

Hi @manisht, hi @mgkgng. Thank you for your interest in the project!
As a first step, I’d suggest getting familiar with the way Brian, and in particular its equation syntax, works.
Here’s the general website of the Brian simulator:

For this specific project, the most important thing is the equation syntax , and I’d suggest having a look at the examples to get an idea of how these equation strings look in practice.

For a more high-level overview of the ideas behind it, you might want to have a look at our papers (no need to go through them completely/in detail):

Thank you for your reply! I started to have a look on the reference that you mentioned. The equation syntax seems quite familiar to me as I already tried to parse polynomials. I’ll come back soon for further questions after reading the papers. Thank you again!

Hi everyone :wave:
I just published a general document about GsoC applications for Brian projects, please have a look!

I will be back on Monday with more details for this specific project, but of course feel free to ask any questions that might come up in the meantime.

1 Like

Thank you for that @mstimberg , it’s really helpful

Hi again, here’s some more guidance on the application for this specific project:
Please include in the application a detailed description of the current equation parsing mechanism. The project goals mention error messages: please come up with a number of “realistic” errors a user could make when writing equations, and document the error messages the Brian simulator gives in these situations. Ideally, what kind of error message would the user prefer? In more general terms, what kind of parsing techniques do you know and what are their respective advantages/disadvantages? Finally: an another approach to better error messages might be to support something like the friendly-traceback project – in what way would this be different/complementary?

Dear @mstimberg @d.goodman,

My name is Tejaswini and I am a 3yr computer science student at Manipal Institute of Technology, India. Upon reviewing the references provided, I would like to express my interest in working on this project over the summer.

I am currently working on my proposal and once completed, I look forward to hearing from you about any feedback you may have to improve it.

I am a beginner contributor to the open-source community and would love to learn/hone my skills through active participation in this real-world project.

I am eager to apply and hope to have a chance to be mentored by you and contribute code for the benefit of all.
Thank you for your time!

Hi @Tejaswini, thank you for your interest in the project! When you have a version of the proposal that you’d like to have feedback on, please send me a direct message here on neurostars, or via email to marcel (dot) stimberg (at) inserm (dot) fr .