bimtester, improvements as well as standalone GUI and FreeCAD module

edited December 2020 in General

something to show has been finished ...

bimtester FreeCAD module :

  • https://github.com/berndhahnebach/bimtester
  • ATM bimtester code is copied here for sake of simplicity, long term aim would be to install bimtester like ifcopenshell by make install
  • I reoganised the bimtester.py module (see later on)
  • A Taskpanel was added which runs stand alone too.
  • I am still changeing and reorganizing my added code in environment module and step files. Do not look to much on this code. Expect still a lot of changes to come here.

bimtester improvements:

cheers bernd

Tagged:
bitacovirstephen_lpaullee

Comments

  • Fantastic! I think this code will break the current BlenderBIM Add-on connection, but it should be trivial to fix. I haven't tested any of it yet but at a glance it looks like its helping BIMTester mature which is good.

  • @bernd I think you're right. The option I'd choose is for all other code to go one level down into src/ifcbimtester/bimtester, and to keep the CLI at src/ifcbimtester/. Perhaps the same with the Qt GUI?

    bernd
  • edited November 2020

    @Moult said:
    I think you're right. The option I'd choose is for all other code to go one level down into src/ifcbimtester/bimtester, and to keep the CLI at src/ifcbimtester/. ...

    Totally agree with this one. How about your time range? Do you go for the move or should I?

    @Moult said:
    I think you're right. ... Perhaps the same with the Qt GUI?

    Do you mean the calls to start the stand alone bimtester gui? I already did this in the FreeCAD bimtester. See https://github.com/berndhahnebach/bimtester/blob/d76bbba0fed982fca2be65362bc7d253660df3fc/guistartbimtester.py This code should be in CLI bimtester.py

  • @bernd go for it :) I'm happy to merge PRs as soon as I see them for any bimtester code. You're doing great work! No need to ask for permission, bimtester is very simple after all.

    As for the Qt GUI, shouldn't https://github.com/berndhahnebach/bimtester/blob/d76bbba0fed982fca2be65362bc7d253660df3fc/code_bimtester/guiwidget.py be moved up too? Since it's just an interface, not necessarily part of the core Python module?

  • edited November 2020

    @Moult said:
    @bernd go for it :) I'm happy to merge PRs as soon as I see them for any bimtester code. You're doing great work! No need to ask for permission, bimtester is very simple after all.

    :-) I will go for it.

    @Moult said:
    As for the Qt GUI, shouldn't https://github.com/berndhahnebach/bimtester/blob/d76bbba0fed982fca2be65362bc7d253660df3fc/code_bimtester/guiwidget.py be moved up too? Since it's just an interface, not necessarily part of the core Python module?

    Ahh ok splitting core code and gui code is a good idea. But I would move the gui in a directory too.

    directory src/ifcbimtester:

    • bimtester (directory, inside will be all bimtester core code)
    • guibimtester (directory, inside will be the guiwidget module)
    • bimtester.py (CLI to run bimtester in console mode or with gui)

    How does that sounds?

    bernd

  • @bernd go for it :)

  • edited November 2020

    https://github.com/IfcOpenShell/IfcOpenShell/pull/1130
    The Gui is not yet in a separate directory. If a separate directory is used again import problems arise on relative imports. But since the code is copied ATM to BlenderBIM and FreeCAD and may be some where I would like to keep the relative ones.

  • edited November 2020

    We have two ways (two run methods) of run the tests, but in the arguments and help of the startscript this is not mentioned at all. We should may be rework the startscript args. But first it may makes sense to decide if we keep both and which one is the standard one, if we keep both? Should the Gui be able to run with both if we keep both? ...

    At the moment the Gui uses new run method and console the standard run method. This will end up in confusion.

    May be we wait with this until you have fixed BlenderBIM Bimtester?

    Bernd

  • @bernd honestly I haven't actually looked at the code in detail, I'm trusting that the PRs are a step in the right direction. I do need to review it and see how it integrates into Blender and ensure it doesn't break any useful workflows.

    Just go ahead with what you think is right :) I'll catch up when I get the time!

  • edited November 2020

    OK.
    BTW: Neither old code has been removed nor big changes have been made. Mostly new code added and code moved as discussed here. Thus just calls have to be adapted on BlenderBIMs side.

  • edited February 2021

    I've found the time to return to BIMTester and I've done a bunch of breaking changes (sorry!). BIMTester to me is a very simple, but very delicate utility that needs a lot of consideration before we go too far down a particular path. I've tried to outline the logic I've followed whilst making these breaking changes, and hopefully we can agree that these are good principles to follow.

    • BIMTester should be simple. The whole point of BIMTester is that exchange requirement checking should take cues from the BDD testing procedures that the software world have used, without reinventing a lot of the wheel, or adding a lot of new stuff on top. As much as possible, I want it to be a lightweight wrapper around Behave, with zero magic. People should read the code and see exactly how it works without needing time to understand it. A lot of magic was introduced, which I have aggressively deleted (but hopefully without damaging functionality). For example, the two runners (run vs run_all), and the copyintemprun were things that I find are complications that should not exist.
    • BIMTester should answer the question "does this IFC file comply with these requirements?", and it should be obvious in its usage that that is what it is answering. For this reason, I've changed the CLI functions to reflect the usage - the user now specifies an IFC, as well as a single feature file (not a feature directory) by default. Later on, we can introduce supplementary functionality like feature dirs, multiple IFC files, or even zero IFC files. But it should be supplementary, not the default.
    • BIMTester should work here, there, everywhere. The previous BIMTester relied a lot upon absolute or relative paths in terms of where features were located or where IFCs were located. This is bad. People should just be able to run bimtester and it should Just Work (TM). I think your solution of running in a temp dir is great. Let's keep this strategy!
    • Tests should read as contractual requirements. A test that reads "There are no {ifc_class} elements" is not good. We should rename it to something like "The {ifc_class} IFC class must not be used for any elements". Similarly, filenames should reflect logical contractual requirement groupings. E.g. "project_setup" is good, but "attributes_eleclasses" is bad.
    • Groups of tests should be carefully considered before we publish them as part of BIMTester. We should consider the usecase, document the 3-line BDD purpose statement. If we want people to take BIMTester seriously, the tests should seem carefully audited, instead of being the kitchen sink.
    • It should be easy for users to add their own requirements. In the past, this required patching the steps dir and doing some voodoo. Not good. It should be super, super easy.
    • BIMTester should be decoupled. BIMTester should simply be a library first and foremost. Interfaces, like a CLI, GUI, or other modules, such as smart view generation, should be decoupled. I've made a start on this.

    Will continue to hack on it... but I realise these changes do break things and do affect people. Hopefully though things are breaking, it is a step in the right direction.

    bitacovirJanFbrunopostleJesusbillberndtlangduncan
  • As part of these goals - a large part of BIMTester is not so much the technical voodoo, but more about the way we can better communicate BIM requirements to non-technical people. To demonstrate what this means, I've created a mockup web-application for people to help generate BIMTester requirements.

    You can access it here: https://blenderbim.org/bimtester/ - it is WIP, so don't mind missing content, buttons that don't work, etc. Just a small example to give an idea.

    Would love to hear feedback!

    brunopostleJesusbillbitacovirbernd
  • edited February 2021

    Wow, I need to get my hands on this. I have not done any dev on bimtester for the past three weeks and I will be off the office for the next week too. But after this I will get back ...

    Just one point in the regard of all the "magic that was introduced". When I started hacking on BIMTester it only did really run with BlenderBIM. The base for all my "magic" was:

    • make it possible to run BIMTester standalone
    • BIMTester should not change ifcopenshell source code
    • make it as easy as posible to run BIMTester
    • make it possible to run multiple feature files

    The first three are a must have IMHO. But it seams we all do agree on this.

    In the regard of the fourth I am still not 100 % sure myself what is best, one huge feature file or a lot of small feature files. When I started hacking on BIMTester multiple feature files seam to fit better for me. ATM the version before Dions changes runs for me in a real environment on daily usage with multiple feature files. Changes on multiple feature files have been a bit cumbersome ... I will give the monster feature file a try (I have to when starting to use latest code :-) )

    cheers bernd

  • @bernd I think it is best if we had a voice call when you have time to review the changes. Right now there are three of us hacking on it (rbertucat, you, and me) so we should make sure we are fully aligned. The changes I made were aggressive, but hopefully in the right direction. About 800 lines of code were deleted overall, so I'm pretty sure I messed up somewhere and some of that magic was actually really needed, but I guess we need to discuss too :)

  • edited November 2021

    came back to this. The time beeing I extended the tests in the regard of our needs in the company. BIMTester still rund on a daily basis on all ifc created be the company draftsmen. I am still based on the latest version before all the magic changes. I started to merge together my bimtester code back into all the changes made on official bimtester. My aim is to be on top on official bimtester with as less changes as possible.

    A question on startup ... In the example directory is a steps directory with some step files inside. Why are they in the examples directory? They will not be used there or will they? Is it just some wrecking yard for step files? Or is it some library of step files to not flood official BIMTester step files?

    https://github.com/IfcOpenShell/IfcOpenShell/tree/5c224150ece5cd24b4074f2c68364d1867d7b611/src/ifcbimtester/examples/steps

    cheers bernd

    paullee
  • Any wiki / forum discussion how to use this BimTester in FreeCAD ? Thanks.

  • edited November 2021

    ATM the latest BIMTester code from ifcopenshell repo does not run with the FreeCAD AddOn. All the changes broke the FreeCAD AddOn. If my old BIMTester code is used it still works.
    Best is to have some patience. As soon as i have transfered my code on top of official BIMTester the FreeCAD AddOn will work with the latest BIMTester code.

    paullee
  • Hey @bernd how far are we from an online BIMTester with customizable rules?

  • Depends ... I am not a web developer, thus far away. On the contrary a web developer would say everything is there just some web ui is needed thus he might say we are really close ...

    check the GSOC. A web front end POC has been done already.

  • edited November 2021

    @paullee said:
    Any wiki / forum discussion how to use this BimTester in FreeCAD ? Thanks.

    use FreeCAD AddOn manager to update the AddOn. read the readme https://github.com/bimtester/bimtesterfc#readme run it and report back if it worked out. For me it did worked with the simple example provided with BIMTester.

    bernd

    paullee
  • edited December 2021

    @bernd said:
    use FreeCAD AddOn manager to update the AddOn. read the readme https://github.com/bimtester/bimtesterfc#readme run it and report back if it worked out. For me it did worked with the simple example provided with BIMTester.

    Thanks for the pointer ! Add-on Installation is intuitive.

    However, it needs pystache to run (as mentioned in the readme), no idea what it is as python beginner, would search over web. Could add-on installation includes this so more peoples are not intimidated by the complexity? :D

  • edited December 2021

    import behave.formatter.pretty # Needed for pyinstaller to package it
    No module named 'behave'

    Then after installing (I only try 'pip install behave', seem only install for current user not system-wide), it works ! Thanks !

    BTW, the 'Screen shot' in the Add-on Manager for BIMTester is not working in my case.

  • @bernd Any reason the *.feature files are not stored in bimtester/features folder ? Would it be not good to have common test directly available to user rather than having to copy/paste from wiki ?

  • edited December 2021

    Are ther any on the wiki?

    ATM some basic example feature files as well as some ifc are stored in examples ... https://github.com/IfcOpenShell/IfcOpenShell/tree/ebe5460a9f69ed8a39bfbe8937884ec99202000b/src/ifcbimtester/examples/01_ifcschema_translated

    May be we could add more. Test to the example ones but the examples itself should be suitable for the feature files than. It is on my TODO for bimtester.

    Saving the feature files in bimtester/examples seams fine for me. Any special reason why you wuold like to have them in a directory called features? This directory name is no longer needed to run BIMTester.

    paullee
  • @bernd said:
    Are ther any on the wiki?

    Yes all the MicroMVDs.

    @bernd said:
    Saving the feature files in bimtester/examples seams fine for me. Any special reason why you wuold like to have them in a directory called features? This directory name is no longer needed to run BIMTester.

    To follow behave advices/conventions so it is easier to find and understand the project structure ?

  • edited December 2021

    Thanks for the links.

    The feature files from the wiki are templates, not ready to use feature files. If we put them into the repository we should put them in a template directory.

    Putting the featrure files inside the code would make things more difficault for the user. The interface for the user is the feature file. If we put the feature file inside the code a standard user might be confused. IMHO we should keep the feature fils splitt from the code.
    But the behave standard says it different ...

    We need @Moult here ... Dion what is your opinion in this regard?

    CadGiru
Sign In or Register to comment.