FEM Python coding standard

About the development of the FEM module/workbench.

Moderator: bernd

Post Reply
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Python coding standard

Post by bernd »

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
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Python coding standard

Post by Kunda1 »

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
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
PrzemoF
Veteran
Posts: 3520
Joined: Fri Jul 25, 2014 4:52 pm
Contact:

Re: Python coding standard

Post by PrzemoF »

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

Re: Python coding standard

Post by Kunda1 »

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
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
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Python coding standard

Post by bernd »

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

Re: Python coding standard

Post by bernd »

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
Veteran
Posts: 3520
Joined: Fri Jul 25, 2014 4:52 pm
Contact:

Re: Python coding standard

Post by PrzemoF »

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
Veteran
Posts: 2511
Joined: Thu Mar 03, 2016 9:52 pm
Location: Illinois

Re: Python coding standard

Post by kkremitzki »

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.
Like my FreeCAD work? I'd appreciate any level of support via Patreon, Liberapay, or PayPal! Read more about what I do at my blog.
User avatar
kkremitzki
Veteran
Posts: 2511
Joined: Thu Mar 03, 2016 9:52 pm
Location: Illinois

Re: Python coding standard

Post by kkremitzki »

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.
Like my FreeCAD work? I'd appreciate any level of support via Patreon, Liberapay, or PayPal! Read more about what I do at my blog.
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Python coding standard

Post by Kunda1 »

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
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
Post Reply