Path Workbench Code restructuring - heads up
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
Path Workbench Code restructuring - heads up
For a while we've been struggling with an ever growing python module incorporating all of Path in a flat structure. This makes it hard for newcomers to "get into" the code base and figure out how this is supposed to work. It also makes it quite easy to introduce cyclic dependencies in the modules which then cause problems later on. We've restructured the entire code base into sub modules and pulled all elements of the Path code into a single namespace in PR-7440.
Why would any none developer care?
Due to how FreeCAD stores its objects in the ".FCStd" file the data file is inherently tied to the implementation. If the implementation changes and FreeCAD can't find the class which was used to create an element before it got saved then FreeCAD cannot process that data. In other words, once the change is merged it will break all existing Path files.
This is also the reason why we have to make this change now, before version 1.0 is released. With version 1.0 backwards compatibility becomes a priority and a cleanup like this will become much more complicated.
ToolBit's are not affected by this change. Any created and existing ToolBit files will still work after the merge.
Mod edit: The proposed PR: issue #7440
Why would any none developer care?
Due to how FreeCAD stores its objects in the ".FCStd" file the data file is inherently tied to the implementation. If the implementation changes and FreeCAD can't find the class which was used to create an element before it got saved then FreeCAD cannot process that data. In other words, once the change is merged it will break all existing Path files.
This is also the reason why we have to make this change now, before version 1.0 is released. With version 1.0 backwards compatibility becomes a priority and a cleanup like this will become much more complicated.
ToolBit's are not affected by this change. Any created and existing ToolBit files will still work after the merge.
Mod edit: The proposed PR: issue #7440
Last edited by Kunda1 on Sun Sep 04, 2022 9:09 pm, edited 2 times in total.
Reason: tweaked title + added gh issue to OP
Reason: tweaked title + added gh issue to OP
Re: Code restructuring - heads up
My hot take: ambitious but this makes sense for a pre-1.0 release. If I may, can you consider to also put issue #6835 on your radar as well ?
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
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
- sliptonic
- Veteran
- Posts: 3459
- Joined: Tue Oct 25, 2011 10:46 pm
- Location: Columbia, Missouri
- Contact:
Re: Path Workbench Code restructuring - heads up
Yep, this is going to break a lot of stuff, make a lot of people mad, and affect both users and other developers.
Let's do it!!
Let's do it!!
onekk wrote: pinged by pinger macro
GeneFC wrote: pinged by pinger macro
and any other power users. If you're able to build from the PR, please do so and start keeping notes so we can write a migration guide or other instructions to users. Migration pain is going to affect us for a long time so we should probably get good at answering it.chrisb wrote: pinged by pinger macro
Re: Path Workbench Code restructuring - heads up
Sadly I can't build from PR, So I will wait when changes are incorporated in the "conda install" I use for "0.21.dev"
Let's see how this affects, my test code and some of my other code around.
Thanks for the information, I will eventually made or correct some code I've posted (I have to find the relevant topics, as I've not noted them down).
Best 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/
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.
Blog: https://okkmkblog.wordpress.com/
Re: Path Workbench Code restructuring - heads up
I am on Windows, so building from a PR is not trivial, but I will try.
I can say already, "Let's do it!!"
If stuff breaks for me I will fix it.
Gene
Re: Code restructuring - heads up
I had started to take those out, but then ppl have added it back in - for a developer it's really handy to change a single line and turn on/off internal debugging. I'll keep in mind though if I come across a better pattern.Kunda1 wrote: ↑Sun Sep 04, 2022 9:07 pm My hot take: ambitious but this makes sense for a pre-1.0 release. If I may, can you consider to also put issue #6835 on your radar as well ?
Re: Path Workbench Code restructuring - heads up
PR is not integrated yet in development version?
Regards
Carlo D.
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/
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.
Blog: https://okkmkblog.wordpress.com/
Re: Path Workbench Code restructuring - heads up
As pointed out above the change is rather dramatic. No sense in adding to master until it is quite thoroughly debugged at the PR level.
I have taken a first look. In general it seems to work pretty well for new Path WB jobs, but completely fails to handle existing jobs. They are not even recognized. I do not know if that can be fixed in any way or if some sort of converter might be possible, but that is why the testing period on the PR exists.
Gene
I have taken a first look. In general it seems to work pretty well for new Path WB jobs, but completely fails to handle existing jobs. They are not even recognized. I do not know if that can be fixed in any way or if some sort of converter might be possible, but that is why the testing period on the PR exists.
Gene
Re: Path Workbench Code restructuring - heads up
Ok thanks.
I don't know how to do this "test at PR level" and for now it is only an informative questions, as I can't compile FC with my limited power (Intel i3-2100) machine.
I was thinking that it will be as easy as making a git pull and a recompile, but in this case the PR has to be merged in "main branch".
Probably I'm lacking ability to make a goo use of GitHub in complex projects.
There is maybe a dedicated "branch"?
Could you kindly explain me "how to do eventually" such thing, to keep note maybe in future when I could afford a more powerful machine.?
TIA and 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/
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.
Blog: https://okkmkblog.wordpress.com/
Re: Path Workbench Code restructuring - heads up
Until now Path workbench was written in Python. Is this still so? Then I could replace the whole Mod/Path directory to get the new stuff?
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.