Code Review

Code Review - 2022

Updated: Dec 12, 2021

We want to start a new initiative to do more code peer reviews in our lab. For that, we are suggesting the new guideline for students to follow:


Undergrad students


New undergrad students are required to do two code reviews with their graduate mentor:

  • One at the beginning of the project, to assure the student is following proper coding guidelines;

  • At the end of the project, to clarify the code, add comments and make sure the code delivered is functional.


Graduate students


Graduate students will be asked to request a code review 1 month before their conference deadline. We understand that simulations and experiments might still be in progress by then. Still, an initial revision is already possible and beneficial with the code in progress. Later, after the code is finalized, it is up to the author to request another review.


Who will review my code?


We will order (randomly) current graduate students with knowledge of Python as reviewers. After each review, the later reviewer goes to the bottom of the list. Lab-mates that are co-authors have priority to review.


Review deadline


One week. The reviewer will have one week to review the code.

Code-Review-2022

After receiving their first review, new graduate students (Master or PhD) will be added to the list as reviewers. (Note: not valid for current grad students because everyone will be learning how to do it for the first time). Undergrad students will not be acting as reviewers.


How do I request a review?


Our first attempt is to adopt a Slack channel to request reviews. Check who is the next reviewer, add on the slack the request “Please, X can you review my code?”, so we can all see and update the current priority review list.

How to prepare the code for revision and how to review:

See the tutorial below.

Code review

References and supportive material

Andy suggestions:

  • Python code quality checking tool: mypy / pylint / pytest / black (link)

Raquel suggestions:

Questions? You can reach Raphaella on Slack.