From 508fefa3d0ff72d1bf67207573b3383f28b39a7f Mon Sep 17 00:00:00 2001 From: Guille Date: Tue, 9 Jun 2020 11:49:50 -0400 Subject: [PATCH] Update 'PYGUIDE.md' --- PYGUIDE.md | 53 ++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 52 insertions(+), 1 deletion(-) diff --git a/PYGUIDE.md b/PYGUIDE.md index 4fb900c2..2c7f963b 100644 --- a/PYGUIDE.md +++ b/PYGUIDE.md @@ -93,4 +93,55 @@ always access your variable throught the method and avoid to access directly. def operation(self, first_param, second_param): return self.object_attribute * 2 -``` \ No newline at end of file +``` + +Attributes with known units should be explicit in method's names + +```python + + @property + def distance_m(self): + return self._distance +``` + +### Coments + +#### code documentation + +all public classes, properties and methods must have code comments + +```python + + class MyClass + """ + MyClass class perform models class operations + """ + + def __init__(self): + + + @property + def object_attribute(self): + """ + My class object attribute + :return: int + """ + return self._object_attribute + + def operation(self, first_param, second_param): + """ + multiplies object_attribute by two + :return: int + """ + return self.object_attribute * 2 + +``` + +#### To do's + +Pending to implement operations should be indicated with ToDo comments to highlight the missing operation + +```python + # ToDo: right now extracted at city level, in the future should be extracted also at building level if exist +``` +