BCF Support GSoC Proposal

Contributions from the participants, questions and answers to their projects.
Discussions of proposals for upcoming events.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
pPodest
Posts: 71
Joined: Sat Feb 16, 2019 3:18 pm

Re: BCF Support GSoC Proposal

Post by pPodest »

saso wrote: Sun Jun 09, 2019 8:13 am Few bcf sample files are in this project ... https://github.com/openBIMstandards/Dat ... pendomlaan
Hey thank you for the link! :)
yorik wrote: Sun Jun 09, 2019 5:51 pm Browsing through your code now, looks like everything coming along very well, and the code is specially nicely formatted and very readable and understandable by other people. Excellent! Keep that way!
Thank you very much! I never thought my code would be that readable. Wait till you see the writing module, it still needs a bit of cleaning up work.
yorik wrote: Sun Jun 09, 2019 5:51 pm I'm also learning a thing or two in python from your code...
If you encounter a block like:

Code: Select all

try:
	...
except ...:
	...
else:
	...
... that (apart from other things) I learned from you :D, especially the else part. Although I still don't have the intuition for the else part, I know what it does, but only after a bit of thinking.
User avatar
yorik
Founder
Posts: 13640
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: BCF Support GSoC Proposal

Post by yorik »

Looked at you devlog and code again today, I'm really very happy with the direction and impressed by your dedication and professionalism, Patrick. Well done so far!

Could you, at some point, start a kind of very simple "example script" that illustrates how to manipulate your module from python? We can find that in the test suite of course, but let's say a very quick-n-dirty resumed version to get a person started with using your module. I know things are not quite ready yet, no need to do that now, but when you see it appropriate, that would be a cool thing to have I think.
User avatar
pPodest
Posts: 71
Joined: Sat Feb 16, 2019 3:18 pm

Re: BCF Support GSoC Proposal

Post by pPodest »

I am happy that you like my work, Yorik :)

That is a good idea, I will certainly do that! The functional modules that are currently available (reader and writer) as well as the classes comprising the data model should not be used directly. I intend to write a separate interface/module that handles all modifications to the data model and will be available in the nonGUI mode of the plugin. This interfacing module should then also, to some extent, check the data that shall be added, modified or deleted to/in/from the data model. For this I will create a tutorial like doc to get you started quickly.
For the stuff that is currently inside the src/bcf/ directory I would rather like to write a documentation that gives a clear understanding of the structure and the probably not so obvious stuff I did (like adding member functions to an object to let it seem like it is fully implementing a certain interface). In that sense this doc will become more like a protocol or wiki page rather than a tutorial.

I have a question regarding the loading of a plugin into FreeCAD: What happens if the plugin uses some python module that had to be installed via pip? Is there a possibility to install it during loading time or does it have to be added to the list of dependencies of the plugin? Specifically I am talking about dateutil, which I use for parsing ISO 8601 formatted datetime strings.
User avatar
hardeeprai
Posts: 177
Joined: Sun May 23, 2010 2:41 pm
Location: Ludhiana, Punjab, India
Contact:

Re: BCF Support GSoC Proposal

Post by hardeeprai »

pPodest wrote: Fri Jun 14, 2019 1:01 pm I am happy that you like my work, Yorik :)
Good code will be liked and appreciated by all Coders :-)

pPodest wrote: Fri Jun 14, 2019 1:01 pmThat is a good idea, I will certainly do that! The functional modules that are currently available (reader and writer) as well as the classes comprising the data model should not be used directly. I intend to write a separate interface/module that handles all modifications to the data model and will be available in the nonGUI mode of the plugin. This interfacing module should then also, to some extent, check the data that shall be added, modified or deleted to/in/from the data model. For this I will create a tutorial like doc to get you started quickly.
For the stuff that is currently inside the src/bcf/ directory I would rather like to write a documentation that gives a clear understanding of the structure and the probably not so obvious stuff I did (like adding member functions to an object to let it seem like it is fully implementing a certain interface). In that sense this doc will become more like a protocol or wiki page rather than a tutorial.
Promising!
--
H.S.Rai
User avatar
yorik
Founder
Posts: 13640
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: BCF Support GSoC Proposal

Post by yorik »

pPodest wrote: Fri Jun 14, 2019 1:01 pm The functional modules that are currently available (reader and writer) as well as the classes comprising the data model should not be used directly. I intend to write a separate interface/module that handles all modifications to the data model and will be available in the nonGUI mode of the plugin.
Perfect!
pPodest wrote: Fri Jun 14, 2019 1:01 pm I have a question regarding the loading of a plugin into FreeCAD: What happens if the plugin uses some python module that had to be installed via pip? Is there a possibility to install it during loading time or does it have to be added to the list of dependencies of the plugin? Specifically I am talking about dateutil, which I use for parsing ISO 8601 formatted datetime strings.
This is a rather philosophical question, you'll find a lot of discussion about that on the forum. Some argue that we should allow for ex. the addonmanager to use pip to download stuff on the fly. I personally don't like that much, I prefer to let my distro package manager do that when possible, and also believe we should let users choose themselves to install something or not, etc. Many different opinions.

The addon manager has a system to handle dependencies too, you need to add a metadata.txt file in your repo root, and in it a line that starts with pylibs= and a comma-separated list of python modules your plugin needs. Ex:

pylibs=dateutil,somethingelse

I would say also the main thing is to be very informative. Don't prevent your module to start, do a dependencies test early on, and present a clear view (info dialog, whatever) to the user if there is a problem, and what they should do to remedy the situation.
User avatar
pPodest
Posts: 71
Joined: Sat Feb 16, 2019 3:18 pm

Re: BCF Support GSoC Proposal

Post by pPodest »

yorik wrote: Sat Jun 15, 2019 8:31 pm This is a rather philosophical question, you'll find a lot of discussion about that on the forum. Some argue that we should allow for ex. the addonmanager to use pip to download stuff on the fly. I personally don't like that much, I prefer to let my distro package manager do that when possible, and also believe we should let users choose themselves to install something or not, etc. Many different opinions.
Oh ok :D
I have to say that I understand both sides here, but I don't want this thread to turn into a philosophical discussion too, so I am leaving it at that.
yorik wrote: Sat Jun 15, 2019 8:31 pm The addon manager has a system to handle dependencies too, you need to add a metadata.txt file in your repo root, and in it a line that starts with pylibs= and a comma-separated list of python modules your plugin needs.
Uh that is nice! I will take that into consideration :) I think as soon as I finished the writer I will start working on the programmatic interface after which I already can provide a rudimentary version of the plugin (in nonGUI mode, however).
Are these packages directly sourced from pypi.org?
yorik wrote: Sat Jun 15, 2019 8:31 pm I would say also the main thing is to be very informative. Don't prevent your module to start, do a dependencies test early on, and present a clear view (info dialog, whatever) to the user if there is a problem, and what they should do to remedy the situation.
I agree! I myself dislike software that doesn't provide informative messages if something goes wrong. Although it is quite hard to write really informative messages.
User avatar
yorik
Founder
Posts: 13640
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: BCF Support GSoC Proposal

Post by yorik »

pPodest wrote: Sun Jun 16, 2019 8:19 am Although it is quite hard to write really informative messages.
Agree 100% :D
pPodest wrote: Sun Jun 16, 2019 8:19 am Uh that is nice! I will take that into consideration :) I think as soon as I finished the writer I will start working on the programmatic interface after which I already can provide a rudimentary version of the plugin (in nonGUI mode, however).
Are these packages directly sourced from pypi.org?
Well...

Actually at the moment it just prints a message to the user informing they need to install the packages themselves :? Better than nothing... But indeed something better should be offered there.
User avatar
pPodest
Posts: 71
Joined: Sat Feb 16, 2019 3:18 pm

Re: BCF Support GSoC Proposal

Post by pPodest »

yorik wrote: Mon Jun 17, 2019 2:50 pm Actually at the moment it just prints a message to the user informing they need to install the packages themselves Better than nothing... But indeed something better should be offered there.
Ok, I see! ^^
User avatar
duncan.lithgow
Posts: 42
Joined: Sat Jan 11, 2014 6:29 pm
Location: Denmark
Contact:

Re: BCF Support GSoC Proposal

Post by duncan.lithgow »

I haven't caught up on this thread recently but though I'd share a link to an interesting development. KUBUS have released some tools for people wanting to connect with their BCF 'server'. There is sure to be interesting insights on there somewhere. I hope it's useful.

https://www.bimcollab.com/en/developers/Developer-SDK

I saw a mention that I might know something about BIM-snippets. Personally, no, but I was at a buildingSMART seminar yesterday with someone who I think knows a lot about them. So I can look into it if it's important. I think yorik might be right that it's not really used. But as I said, let me know if you want me to look into it.
User avatar
yorik
Founder
Posts: 13640
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: BCF Support GSoC Proposal

Post by yorik »

I'll be out of home for the next 4 days (going to an urban sketches meeting, but will try to have a look here anyway), but everything looks bright...

Next week is the first official GSOC partial review, I think there is not much specific to do on your side, since everything is going pretty well, but maybe we can take the opportunity to wrap things up a bit, this will do good for us too... I would concentrate on "finishing" and document what can be finished and documented, and leave the rest for the next phase. So we have a nice clean "state" now. How does that sound?
Post Reply