Review summary

Table of Contents

Requirements for code and reviews

Created Merge Requests should be small in scope

To make Merge Requests as smooth as possible let’s keep one MR-s scope to one task.

If multiple tasks are combined into one MR it becomes hard to review due to the sheer scope of changes. This increases the time a review takes. Additionally, it is harder for the codes author to fix issues since systematic mistakes can be repeated more, creating more places needing fixing.

Follow PEP 8 coding conventions

Let’s follow PEP 8 coding conventions when writing code. They can be found here: https://peps.python.org/pep-0008/. This allows us to unify coding conventions and write better-to-read that can be understood faster by more people.

Use python logging instead of "print(…​)" in final code

While printing stuff to console is a simple approach to get fast results it is hard to fine tune and configure later on without changes in code. This becomes a real issue when the project grows, and it is needed to enable or disable printing for debugging purposes or gaining the few percentage points of performance you need by disabling all logging during a competition.

print("Something happened!") # BAD

logger.info("Something happened!") # GOOD

TL;DR: Logging seems like a lot of effort but it simple to set up and allows for better configurability that improves code debugging and performance when utilizing the tools correctly.

Previous code review issues index

Follow style guide for Python Code (PEP 8), if the team does that have any other preferences

Do not open serial port connection multiple times

Do not send commands to mainboard too frequently

Close opened resources (camera, serial port, files)

Use WebSockets for receiving referee signals

Do not send anything over WebSocket to robot basketball manager

Make sure that all the functionality has been implemented that is required in the task description

Use map() or list comprehension (in Python)

Create connect/open method for serial connection

Sample multiple depth pixels to find less noisy distance