Python coding standard

About the development of the FEM module/workbench.
User avatar
bernd
Posts: 3924
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: Python coding standard

Postby bernd » Tue Feb 07, 2017 2:14 pm

Kunda1 wrote:I listed FEM files that could use a peak at their documentation (list created from a regex) to meet the standards mentioned in the thread.
could you explain a bit more what do mean?
User avatar
Kunda1
Posts: 689
Joined: Thu Jan 05, 2017 9:03 pm

Re: Python coding standard

Postby Kunda1 » Tue Feb 07, 2017 6:20 pm

bernd wrote:
Kunda1 wrote:I listed FEM files that could use a peak at their documentation (list created from a regex) to meet the standards mentioned in the thread.
could you explain a bit more what do mean?

Not all the files in the src/Mod/FEM/ are listed in my post. There are some files that start with an underscore that I didn't include.

My intention was to illustrate that python variables mentioned previously:

Code: Select all

__Comment__ = 'Imports and scales an Airfoil in the form of a Draft Wire (DWire) or Basic Spline (BSpline)'
__Web__ = 'http://forum.freecadweb.org/viewtopic.php?f=22&t=5554'
__Wiki__ = "http://www.freecadweb.org/wiki/index.php?title=Macro_Airfoil_Import_%26_Scale'
__Icon__  = '/usr/lib/freecad/Mod/plugins/icons/airfoil.png'
__Help__ = 'Start the macro and follow the instructions'
__Author__ = 'quick61'
__Version__ = '2.1'
__Status__ = 'stable'
__Requires__ = 'freecad 0.14.3706'
__Communication__ = 'your email adress or yourgit or something else'

could be implemented. I'd be happy to help with that. And in the process it would be great if we could add some doxygen comments that would show up in the yet to be created FEM API doc: https://www.freecadweb.org/api/dc/de2/group__FEM.html
User avatar
PrzemoF
Posts: 1715
Joined: Fri Jul 25, 2014 4:52 pm
Contact:

Re: Python coding standard

Postby PrzemoF » Tue Feb 07, 2017 9:26 pm

That applies to macros only, unless I'm missing something? :? There is no need to add it to all python files.
User avatar
Kunda1
Posts: 689
Joined: Thu Jan 05, 2017 9:03 pm

Re: Python coding standard

Postby Kunda1 » Tue Feb 07, 2017 9:38 pm

PrzemoF wrote:That applies to macros only, unless I'm missing something? :? There is no need to add it to all python files.

Pardon, I misunderstood. nevertheless there are still doxygen comments that could be added in order to generate doxygen docs for FEM
User avatar
bernd
Posts: 3924
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: Python coding standard

Postby bernd » Tue Feb 07, 2017 9:45 pm

PrzemoF wrote:That applies to macros only ... :? There is no need to add it to all python files.
exactly !
User avatar
bernd
Posts: 3924
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: Python coding standard

Postby bernd » Tue Feb 07, 2017 9:46 pm

Kunda1 wrote:...nevertheless there are still doxygen comments that could be added in order to generate doxygen docs for FEM
Could you give more informations?
User avatar
PrzemoF
Posts: 1715
Joined: Fri Jul 25, 2014 4:52 pm
Contact:

Re: Python coding standard

Postby PrzemoF » Tue Feb 07, 2017 9:57 pm

More of that stuff (from FemTools.py):

Code: Select all

S>    ## Sets mesh color using selected type of results (Sabs by default)
      #  @param self The python object self
      #  @param result_type Type of FEM result, allowed are:
      #  - U1, U2, U3 - deformation
      #  - Uabs - absolute deformation
      #  - Sabs - Von Mises stress
      #  @param limit cutoff value. All values over the limit are treated as equal to the limit. Useful for filtering out hot spots.
      def show_result(self, result_type="Sabs", limit=None):


It should land here [1], but the link is broken...

[1] http://www.freecadweb.org/api/dd/db6/cl ... Tools.html

Edit: link is OK now, thanks kkremitzki!
http://www.freecadweb.org/api/dc/de2/gr ... 54b64ecdd9
User avatar
kkremitzki
Posts: 360
Joined: Thu Mar 03, 2016 9:52 pm
Location: Texas

Re: Python coding standard

Postby kkremitzki » Tue Feb 07, 2017 10:29 pm

I think that may be an issue from my recent rebuild of the API docs; I checked my build folder and that file is there, but it isn't present on the server. I'm investigating now.
User avatar
kkremitzki
Posts: 360
Joined: Thu Mar 03, 2016 9:52 pm
Location: Texas

Re: Python coding standard

Postby kkremitzki » Tue Feb 07, 2017 11:48 pm

Okay, so there were several missing folders for some reason, but I've compared my build dir and the server and everything seems to match up now. If there are any other issues with the API docs on the site feel free to PM me.
User avatar
Kunda1
Posts: 689
Joined: Thu Jan 05, 2017 9:03 pm

Re: Python coding standard

Postby Kunda1 » Fri Feb 10, 2017 12:50 am

bernd wrote:
Kunda1 wrote:...nevertheless there are still doxygen comments that could be added in order to generate doxygen docs for FEM
Could you give more informations?

Please check the doxygen tweeks i've made in https://github.com/luzpaz/FreeCAD/tree/ ... gen-tweeks