BerkeleyAutomation / FogROS2

An Adaptive and Extensible Platform for Cloud and Fog Robotics Using ROS 2

Home Page:https://berkeleyautomation.github.io/FogROS2

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Python style and best practices

mjd3 opened this issue · comments

  • Use python properties instead of get_x functions
    • We have a lot of functions in aws.py that use get_x (and corresponding calls to y.get_x()) for attributes that should be properties of the class. These should be changed to use the @property decorator and @x.setter (if not readonly).
  • All internal variables should be prefixed with _ (as in, self._x).
  • Abstract base classes should have separate files from their derived classes (e.g., AWS implementation of CloudInstance)
  • Replace string concatenations using + with f-strings
  • Replace print with logging where possible

Check for Python Style guide/ checker