Skip to content

Commit d7acb4a

Browse files
committed
[validation] Remove default terminology check
The property_terminology_check validation can lead to a threading lock in some cases when using Python 3.8 though I was not able to figure out the details yet. Therefore the validation is kept, but removed from the default Validation checks until this can be resolved. Also brings the docstring up to date and adjusts the corresponding test.
1 parent eaf2852 commit d7acb4a

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

odml/validation.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -451,9 +451,7 @@ def object_name_readable(obj):
451451

452452
def property_terminology_check(prop):
453453
"""
454-
1. warn, if there are properties that do not occur in the terminology.
455-
2. warn, if there are multiple values with different units or the unit does
456-
not match the one in the terminology.
454+
Tests if there are properties that do not occur in the terminology.
457455
"""
458456
validation_id = IssueID.property_terminology_check
459457

@@ -470,9 +468,6 @@ def property_terminology_check(prop):
470468
yield ValidationError(prop, msg, LABEL_WARNING, validation_id)
471469

472470

473-
Validation.register_handler('property', property_terminology_check)
474-
475-
476471
def property_dependency_check(prop):
477472
"""
478473
Produces a warning if the dependency attribute refers to a non-existent attribute

test/test_validation.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,9 @@ def test_uniques(self):
208208
""")
209209

210210
def test_property_in_terminology(self):
211+
odml.validation.Validation.register_handler("property",
212+
odml.validation.property_terminology_check)
213+
211214
doc = samplefile.parse("""
212215
s1[t1]
213216
- P1

0 commit comments

Comments
 (0)