google / digitalbuildings

Digital Buildings (ontology and SDK) currently being used by Google internally to manage our own buildings.
Apache License 2.0
363 stars 137 forks source link

scorer.py AttributeError #1004

Open bsimmons-onboard opened 1 year ago

bsimmons-onboard commented 1 year ago

Describe the bug Unable to run scorer.py, throws an AttributeError:

To Reproduce python3 tools/scoring/scorer.py -prop ahu_prop.yaml -sol ahu_solution.yaml ... Scoring — building universe FieldUniverse undefined in ConfigUniverse ... Traceback (most recent call last): File "/home/brian/github/digitalbuildings/tools/scoring/scorer.py", line 72, in <module> pp.pprint(scorer.execute()) File "/home/brian/github/digitalbuildings/tools/scoring/score/parse_config.py", line 248, in execute self.results = self.aggregate_results( File "/home/brian/github/digitalbuildings/tools/scoring/score/parse_config.py", line 218, in aggregate_results evaluated = dimension(deserialized_files=deserialized_files).evaluate() File "/home/brian/github/digitalbuildings/tools/scoring/score/dimensions/entity_point_identification.py", line 195, in evaluate self._evaluate_virtual(proposed_file=proposed_file, File "/home/brian/github/digitalbuildings/tools/scoring/score/dimensions/entity_point_identification.py", line 107, in _evaluate_virtual proposed_points_virtual = self._fetch_points_virtual( File "/home/brian/github/digitalbuildings/tools/scoring/score/dimensions/entity_point_identification.py", line 55, in _fetch_points_virtual return [ File "/home/brian/github/digitalbuildings/tools/scoring/score/dimensions/entity_point_identification.py", line 57, in <listcomp> set(file[link.source].translation[target_field].raw_field_name File "/home/brian/github/digitalbuildings/tools/scoring/score/dimensions/entity_point_identification.py", line 57, in <genexpr> set(file[link.source].translation[target_field].raw_field_name AttributeError: 'UndefinedField' object has no attribute 'raw_field_name'

OS (please complete the following information): Ubuntu

Test Files Sending test files to digitalbuildings-support@googlegroups.com

bsimmons-onboard commented 1 year ago

Looks like this is caused by MISSING fields. I was able to run the scoring tool after removing them from the prop and solution files.

charbull commented 1 year ago

@mschulze17 @trav3711 we need to update the scorer to support the missing fields, it could be a P2 but would be worth it to capture it somewhere internally

trav3711 commented 1 year ago

@bsimmons-onboard Is this issue blocking for you?

bsimmons-onboard commented 1 year ago

@trav3711 I can proceed with a workaround where I remove missing fields from the prop and solution files. From the README it seems like missing types are intended to factor into the score. https://github.com/google/digitalbuildings/tree/master/tools/scoring#caveats

charbull commented 1 year ago

@bsimmons-onboard assigned this bug to you :)

charbull commented 1 year ago

Chatted and reassigning to @trav3711