Closed bvadorno closed 11 months ago
Hi @bvadorno,
I created the README file as you asked. Some examples are not mentioned yet because I'm still working on them. I'll keep updating it with every new example finished. Do you think I need to add any other information?
Here is an example when using the -h
option with one of the scripts:
Hi @anachristinaac,
This is sufficient because the tutorial looks pretty comprehensive. Please follow Python's style guide. Most notably, classes and objects are written in camel case (e.g., CamelCaseClass
and objectFromCamelCaseClass
), whereas methods use lowercase with words separated by underscores (e.g., my_nice_method()
).
PyCharm has nice refactoring functionalities that you can use to refactor your code with the new style.
Best wishes, Bruno
Hi @bvadorno,
I'll check the scripts for the things I named. However, if you asked it because of the methods mentioned in the help message of the image I attached before (e.g., the method positionInterpolations()
), they are from the library to work with NAO, which does not follow this convention. I'll make sure that everything I name follows the Python's style guide.
Thanks for the tip about PyCharm! I didn't know that.
Kind regards, Ana
Hi @bvadorno,
You mentioned using CamelCase to name objects, but the style guide says that variables should use lowercase_with_undescore, including instance variables. "Instance variables" are objects, right? Which naming convention should I use?
Thanks!
Hi @anachristinaac,
Instance variables are not objects. See the explanation here.
Nonetheless, PEP8 is unclear about how to name objects. Please see what PyCharm has to say about it. If you create a new project and use the wrong naming convention for objects, it'll warn you.
Kind regards, Bruno
Just for information, it seems that both mixedCaseName
and lowercaseName
are acceptable in PEP8. So, it suffices to be consistent in your code.
Hi @anachristinaac,
Please add a
README.md
file in the examples folder succinctly describing each example, how to use them, etc. If the Python files contain such an explanation through a--help
directive, thus removing the necessity of further explanations within the README file, please say so within it.Thanks, Bruno