From 6726c295facc8f31a00391f4677beadbd94914bb Mon Sep 17 00:00:00 2001 From: Gabe Fierro Date: Thu, 31 Oct 2024 13:21:14 -0600 Subject: [PATCH] formatting --- buildingmotif/dataclasses/shape_collection.py | 4 +++- buildingmotif/dataclasses/validation.py | 24 ++++++++++--------- 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/buildingmotif/dataclasses/shape_collection.py b/buildingmotif/dataclasses/shape_collection.py index e289f7d77..5e11df8ce 100644 --- a/buildingmotif/dataclasses/shape_collection.py +++ b/buildingmotif/dataclasses/shape_collection.py @@ -360,7 +360,9 @@ def gensym(): # look at pshapes implicitly defined by sh:path for pshape in graph.subjects(predicate=SH.path): - if pshape == shape: # skip the input 'shape', otherwise this will infinitely recurse + if ( + pshape == shape + ): # skip the input 'shape', otherwise this will infinitely recurse continue path = _sh_path_to_path(graph, graph.value(pshape, SH.path)) if not graph.value(pshape, SH.qualifiedValueShape): diff --git a/buildingmotif/dataclasses/validation.py b/buildingmotif/dataclasses/validation.py index 2b0c33a7f..9aadff664 100644 --- a/buildingmotif/dataclasses/validation.py +++ b/buildingmotif/dataclasses/validation.py @@ -94,14 +94,14 @@ def _result_uri(self) -> Node: graph """ return next(self.validation_result.subjects(RDF.type, SH.ValidationResult)) - #possible_uris: Set[Node] = set(self.validation_result.subjects()) - #objects: Set[Node] = set(self.validation_result.objects()) - #sub_not_obj = possible_uris - objects - #if len(sub_not_obj) != 1: + # possible_uris: Set[Node] = set(self.validation_result.subjects()) + # objects: Set[Node] = set(self.validation_result.objects()) + # sub_not_obj = possible_uris - objects + # if len(sub_not_obj) != 1: # raise Exception( # "Validation result has more than one 'root' node, which should not happen. Please raise an issue on https://github.com/NREL/BuildingMOTIF" # ) - #return sub_not_obj.pop() + # return sub_not_obj.pop() @cached_property def failed_shape(self) -> Optional[URIRef]: @@ -149,12 +149,14 @@ def from_validation_report(cls, report: Graph) -> List["OrShape"]: ret = [] for result, focus, shapes in results: validation_report = report.cbd(result) - ret.append(cls( - focus, - validation_report, - report, - tuple([s for s in Collection(report, shapes)]), - )) + ret.append( + cls( + focus, + validation_report, + report, + tuple([s for s in Collection(report, shapes)]), + ) + ) return ret