Docstring improvements.

Have some feature requests, feedback, cool stuff to share, or want to know where FreeCAD is going? This is the place.
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
Post Reply
User avatar
onekk
Veteran
Posts: 6197
Joined: Sat Jan 17, 2015 7:48 am
Contact:

Docstring improvements.

Post by onekk »

Very often docstrings are lacking, using the autocomplete function in Python console or :

Code: Select all

print(dir(Part.Something))
Many methods don't show anything or a mere "this methods are docing this"

Without a proper docstring like:

Code: Select all

"""This method is doing this:
    Part.Something(center, point, refine)	
    ....

Parametrs:
	center  Vector      center of Something default: (0,0,0)
	point    Vector      point to compare default: None
	refine  boolean    refine the final object default: False
....

As FreeCAD is becoming more widespread and many people come here asking for helps, it will be a "very good" improvement.

It will be also a "time saving" thing as some repeated answers could simply be addressed pointing to the "documentation".

Regards

Carlo D.
GitHub page: https://github.com/onekk/freecad-doc.
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.

Blog: https://okkmkblog.wordpress.com/
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Docstring improvements.

Post by Kunda1 »

+1

edit: is there a way to make a roadmap of what has been documented and what still needs documentation?
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
User avatar
onekk
Veteran
Posts: 6197
Joined: Sat Jan 17, 2015 7:48 am
Contact:

Re: Docstring improvements.

Post by onekk »

Another problem possible quirk.

Are developer aware of the importance of a proper "docstring" from some code analisys it seems that "mileage may vary" some developers are very "prone" to document using comments but write "poor" if not non existent docstrings.
Some other write very good docstrings and maybe document very well, sometimes even with reference to the documentation from where formulas were taken, or even with url to some web pages and so on.

Regards

Carlo D.
GitHub page: https://github.com/onekk/freecad-doc.
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.

Blog: https://okkmkblog.wordpress.com/
Post Reply