Correct, IfcOpenShell does not package BIMTester, IfcClash, IfcDiff, etc.
Couldn't you just run bimtester.run_tests(...)
? instead of the first three lines of code?
Correct, IfcOpenShell does not package BIMTester, IfcClash, IfcDiff, etc.
Couldn't you just run bimtester.run_tests(...)
? instead of the first three lines of code?
@Moult said:
Couldn't you just run
bimtester.run_tests(...)
? instead of the first three lines of code?
No not really, give it a try. It does really strange file copy stuff with the feature files. To fix it I would have needed to change all the method, but than for sure it would not run in Blender anymor :-) Thus I ask here.
bernd
found the problem, one has to change the directory from the python console run bimtester and change it back.
path_to_bimtester_module = "/home/hugo/Documents/dev/ifcopenshell/ifcopenshell-official/ifcos/src/ifcbimtester/"
path_to_ifc_and_featurefiles = "/home/hugo/Desktop/zeug/ifcos_bimtester/bimtester/myrun/"
import importlib
import os
import sys
import webbrowser
sys.path.append(path_to_bimtester_module)
import bimtester
importlib.reload(bimtester)
cwd = os.getcwd()
os.chdir(path_to_ifc_and_featurefiles)
bimtester.run_tests({'feature': os.path.join(path_to_ifc_and_featurefiles, "01_proj.feature"), 'advanced_arguments': None, 'console': False})
bimtester.generate_report()
bimtester.run_tests({'feature': os.path.join(path_to_ifc_and_featurefiles, "02_elem.feature"), 'advanced_arguments': None, 'console': False})
bimtester.generate_report()
os.chdir(cwd)
webbrowser.open(os.path.join(path_to_ifc_and_featurefiles, "report", "01_proj.feature" + ".html"))
webbrowser.open(os.path.join(path_to_ifc_and_featurefiles, "report", "02_elem.feature" + ".html"))
Still ...
copies the feature file inside the directory of the bimtester module. Why is it needed to copy data into the code directory. I do not understand this?
If the module will be installed on /usr/local and the user has not write access all bimtester does not work.
May be my question is wrong ... Just found this only happens if bimtester is not installed with pyinstaller? https://github.com/IfcOpenShell/IfcOpenShell/blob/b4f4d9b3c5f495943d26462cf7b052b57e53b608/src/ifcbimtester/bimtester.py#L22-L26 What the hell is pyinstaller?
How about to add some standard tmp directory here made with tmpdir module?
What the hell is pyinstaller?
:D :D pyinstaller is a package that allows creating a proper executable of a python program. This would happen if you run the command in L3 or L5. I guess this statement allows to run bimtester both to create the exe or as a module, but not sure about it.
thanks jesusbill
done another step.
behave (this is what is behind bimtester) needs a special folder structure. In the directory with the feature files there need to be a directory called step with the step implementation. The problem with bimtester is, the features may change from project to project, whereas the step will not be changed.
https://www.testaddict.space/understanding-behaves-feature-files-and-step-implementations/
my version of bimtester:
https://gist.github.com/berndhahnebach/2774f553643c275f8a8e912a426e413d
It is done the other way around. features are NOT copied in ifcopenshell source code but steps are copied to the features and deleted after the run. IMHO a much cleaner way to do it and it would work if bimtester is installed in a write protected directory.
I plan to make some small FreeCAD workbench out of bimtester. In there I will propose another way of file copy. The ifc, the feature files and the step files will be copied into tmp. In there the behave tests will be run thus the report will be saved in tmp as well. The report than will be opened in webbrowser.
@Moult
I run into trouble with bimtester in the regard of the purging. I did wrote my own run_test method (this is very good news since I will start using bimtester at work). I saw you did wrote a purging class which does some replacement in the feature files. Would you give some informations what is this about.
cheers bernd
@bernd the purging function detects if there are any tests which mention an IFC GlobalId, and if the GlobalId doesn't exist in the active IFC file, it simply removes the test. This is to allow for IFC updates where people delete objects.
thanks for the information.
Two problems resist:
if I make changes to the step files and include some prints for debugging, nothing is printed
if I run bimtester from FreeCAD twice I run into a behave.step_registry.AmbiguousStep
failure see https://github.com/behave/behave/issues/871 . Means I have to restart FreeCAD for a second ifc test. Have you had this problem?
I do not get these tests to work. Do you have example featue files for them. They are missing here: https://wiki.osarch.org/index.php?title=Using_MicroMVDs_for_exchange_requirements
Why not try Ontology? IFCOWL is so smooth
@shanmama said:
Why not try Ontology? IFCOWL is so smooth
To be honest I have no idea how this ifcowl works ... Not much around on the web, which does describe it or give some examples ...
@shanmama RDF/OWL is not smooth, because it's NoSQL, but could be useful, especially when it's a trend nowadays and many like zombies want it
@ReD_CoDE said:
@shanmama RDF/OWL is not smooth, because it's NoSQL, but could be useful, especially when it's a trend nowadays and many like zombies want it
Yes. I try to manage it based on MongoDB
Login or Register to reply.