Conversation
391c93a to
b55da76
Compare
a5bea01 to
a4dc9d0
Compare
ebe1d22 to
98d4efa
Compare
5e4290a to
6a7b91c
Compare
5c9154b to
2155865
Compare
94c318a to
6ad5b2a
Compare
71cc31c to
e497971
Compare
Idea: have an eye an the status of this issue with ifcTester
is working
and add underscore to file path
hopefully the integration test are running
not possible to use, because sim_settings are not part of the base sim_settings
to resolve the dependencies of the PluginIFCCheck the ifccheck task is moved to a new group this group should deal with preprocessing of ifc files
and implementation for ids check
and implemented vor report summary_prop
into other test functions
veronikarichter
left a comment
There was a problem hiding this comment.
Thanks for the revision! Some points remain. Please also consider reformatting the files for a maximum line length of 79 characters and double check spacing and indentation.
| Holds a plugin with only base tasks mostly for demonstration. | ||
| """ | ||
| from bim2sim.plugins import Plugin | ||
| from bim2sim.tasks import prepro, common, bps |
There was a problem hiding this comment.
Please rather use a more common name instead prepro, either 'preprocessing' or something like 'check', since the ifc check is not really a preprocessing (it does not modify the data) but just a preliminary check.
Also, the import of 'bps' is obsolete. Please remove.
| """ | ||
| from bim2sim.plugins import Plugin | ||
| from bim2sim.tasks import prepro, common, bps | ||
| from bim2sim.sim_settings import BuildingSimSettings |
There was a problem hiding this comment.
| from bim2sim.sim_settings import BuildingSimSettings |
not used.
| mandatory=False # TODO make is mandatory AND | ||
| # adapt all tests and examples AND | ||
| # remove default values in check_ifc.py |
There was a problem hiding this comment.
Is there a reason why this is not yet set to mandatory? Since the IFC check is now a separate plugin, the IDS check could be set to mandatory.
In some cases, an IDS check may not be applicable. Could you add a sim_setting if the IFC Check should be executed with or without the IDS checking part? If there is a separate sim_setting to enable the IDS functionality, it may be feasible to keep mandatory=False here.
| # xpaths to elements in html | ||
| # fail percent (unique) | ||
| xpath_fail_perc = '//div[@class="fail percent"]' | ||
| # create function for xpath generation | ||
| xpath_ids_var = Gen_xpath( | ||
| xpath_incl_var = ('//p/span[@class="item" and ' + | ||
| 'contains(normalize-space(.),"{}")]/ strong[{}]')) | ||
|
|
||
| # Specifications passed | ||
| xpath_spec_pass = xpath_ids_var.gen_xpath_name_pos("Specifications passed", 1) | ||
| # Specifications total | ||
| xpath_spec_total = xpath_ids_var.gen_xpath_name_pos("Specifications passed", 2) | ||
| # Requirements passed | ||
| xpath_req_pass = xpath_ids_var.gen_xpath_name_pos("Requirements passed", 1) | ||
| # Requirements total | ||
| xpath_req_total = xpath_ids_var.gen_xpath_name_pos("Requirements passed", 2) | ||
| # Checks passed | ||
| xpath_checks_pass = xpath_ids_var.gen_xpath_name_pos("Checks passed", 1) | ||
| # Checks total | ||
| xpath_checks_total = xpath_ids_var.gen_xpath_name_pos("Checks passed", 2) | ||
|
|
||
| self.xpaths = [ | ||
| xpath_fail_perc, | ||
| xpath_spec_pass, xpath_spec_total, | ||
| xpath_req_pass, xpath_req_total, | ||
| xpath_checks_pass, xpath_checks_total] | ||
|
|
||
| reg_result = self.run_regression_test() | ||
|
|
||
| self.assertTrue(reg_result[0], "Comparison of the ifc tester " + | ||
| "html reports (IDS) fails. " + | ||
| "expected: {} ".format(reg_result[1]) + | ||
| "test: {}".format(reg_result[2])) |
There was a problem hiding this comment.
In my opinion this is still to complicated for a generalized regression test. If I would need to add another regression test for either the ifctester, the summary_prop, the summary_inst or the summary, I would need to write additional full tests which are prone to errors. I assume the structure of the html-result files won't chance across example files (e.g., if I would try to setup another regression test for the DigitalHub), but I would still need to write a quite lenghty test (instead of applying a evaluate_summary function or similar).
You can still decide to keep it like it is, but in my opinion its too hard to handle and adapt to other test cases.
|
|
||
| def test_run_ifc_check_fzk_haus_sum_prop(self): | ||
| """Run IFCCheck regression test with AC20-FZK-Haus.ifc | ||
| checking the html report "summary_prop" generated |
There was a problem hiding this comment.
What is summary_prop? please clarify.
|
|
||
| return (all_guids_unique, double_guids) | ||
|
|
||
| def run_check_guid_empty(ifc_file) -> (bool, dict): |
There was a problem hiding this comment.
As above. Please add is this supposed to be self?
| used_guids[guid] = inst | ||
|
|
||
| return (all_guids_filled, empty_guids) | ||
|
|
| else: | ||
| version_error = False | ||
| return (version_error, schema) | ||
|
|
| all_guids_unique = False | ||
| warnings.warn( | ||
| "Some GUIDs are not unique! A bijective ifc file have " | ||
| "to have unique GUIDs. But bim2sim provides a option " |
There was a problem hiding this comment.
| "to have unique GUIDs. But bim2sim provides a option " | |
| "to have unique GUIDs. But bim2sim provides an option " |
| "Some GUIDs are not unique (for transformed GUIDS " | ||
| "letters lowcase into uppercase)! " | ||
| "A bijective ifc file have " | ||
| "to have unique GUIDs. But bim2sim provides a option " |
There was a problem hiding this comment.
| "to have unique GUIDs. But bim2sim provides a option " | |
| "to have unique GUIDs. But bim2sim provides an option " |
no code changings
implementation of ifc check include IDS support