Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
gtfierro committed Oct 31, 2024
1 parent d1d5791 commit 6726c29
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 12 deletions.
4 changes: 3 additions & 1 deletion buildingmotif/dataclasses/shape_collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
24 changes: 13 additions & 11 deletions buildingmotif/dataclasses/validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]:
Expand Down Expand Up @@ -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


Expand Down

0 comments on commit 6726c29

Please sign in to comment.