Skip to content

Commit 86ed417

Browse files
committed
Instantiate properties as instance variables instead of class
1 parent bfe9992 commit 86ed417

File tree

1 file changed

+17
-11
lines changed

1 file changed

+17
-11
lines changed

case_utils/case_validate/__init__.py

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,17 @@ class NonExistentCDOConceptWarning(UserWarning):
6666

6767

6868
class ValidationResult:
69-
conforms: bool
70-
graph: Any
71-
text: str
72-
undefined_concepts: Set[rdflib.URIRef]
69+
def __init__(
70+
self,
71+
conforms: bool,
72+
graph: Any,
73+
text: str,
74+
undefined_concepts: Set[rdflib.URIRef],
75+
):
76+
self.conforms = conforms
77+
self.graph = graph
78+
self.text = text
79+
self.undefined_concepts = undefined_concepts
7380

7481

7582
def concept_is_cdo_concept(n_concept: rdflib.URIRef) -> bool:
@@ -229,13 +236,12 @@ def validate(
229236
# Relieve RAM of the data graph after validation has run.
230237
del data_graph
231238

232-
result = ValidationResult()
233-
result.conforms = validate_result[0]
234-
result.graph = validate_result[1]
235-
result.text = validate_result[2]
236-
result.undefined_concepts = undefined_cdo_concepts
237-
238-
return result
239+
return ValidationResult(
240+
validate_result[0],
241+
validate_result[1],
242+
validate_result[2],
243+
undefined_cdo_concepts,
244+
)
239245

240246

241247
def main() -> None:

0 commit comments

Comments
 (0)