@@ -20,9 +20,8 @@ def test_schema_assignment_geometry():
2020 )
2121 ])
2222 schema_id = "expected_id"
23- ontology = OntologyBuilder (tools = [
24- Tool (Tool .Type .LINE , name = name , feature_schema_id = schema_id )
25- ])
23+ ontology = OntologyBuilder (
24+ tools = [Tool (Tool .Type .LINE , name = name , feature_schema_id = schema_id )])
2625 label .assign_schema_ids (ontology )
2726
2827 assert label .annotations [0 ].schema_id == schema_id
@@ -35,10 +34,9 @@ def test_schema_assignment_classification():
3534
3635 label = Label (data = RasterData (arr = np .ones ((32 , 32 , 3 ), dtype = np .uint8 )),
3736 annotations = [
38- ClassificationAnnotation (
39- value = Radio (answer = ClassificationAnswer (
40- name = option_name )),
41- name = radio_name ),
37+ ClassificationAnnotation (value = Radio (
38+ answer = ClassificationAnswer (name = option_name )),
39+ name = radio_name ),
4240 ClassificationAnnotation (value = Text (answer = "some text" ),
4341 name = text_name )
4442 ])
@@ -73,8 +71,7 @@ def test_schema_assignment_subclass():
7371 option_name = "my_option"
7472 classification = ClassificationAnnotation (
7573 name = radio_name ,
76- value = Radio (answer = ClassificationAnswer (
77- name = option_name )),
74+ value = Radio (answer = ClassificationAnswer (name = option_name )),
7875 )
7976 label = Label (
8077 data = RasterData (arr = np .ones ((32 , 32 , 3 ), dtype = np .uint8 )),
@@ -117,8 +114,7 @@ def test_highly_nested():
117114 nested_option_name = "nested_option_name"
118115 classification = ClassificationAnnotation (
119116 name = radio_name ,
120- value = Radio (answer = ClassificationAnswer (
121- name = option_name )),
117+ value = Radio (answer = ClassificationAnswer (name = option_name )),
122118 classifications = [
123119 ClassificationAnnotation (value = Radio (answer = ClassificationAnswer (
124120 name = nested_option_name )),
@@ -146,22 +142,21 @@ def test_highly_nested():
146142 instructions = radio_name ,
147143 feature_schema_id = classification_schema_id ,
148144 options = [
149- Option (
150- value = option_name ,
151- feature_schema_id = option_schema_id ,
152- options = [
153- OClassification (
154- class_type = OClassification .Type .RADIO ,
155- instructions = nested_name ,
156- feature_schema_id =
157- nested_classification_schema_id ,
158- options = [
159- Option (
160- value = nested_option_name ,
161- feature_schema_id =
162- nested_classification_schema_id )
163- ])
164- ])
145+ Option (value = option_name ,
146+ feature_schema_id = option_schema_id ,
147+ options = [
148+ OClassification (
149+ class_type = OClassification .Type .RADIO ,
150+ instructions = nested_name ,
151+ feature_schema_id =
152+ nested_classification_schema_id ,
153+ options = [
154+ Option (
155+ value = nested_option_name ,
156+ feature_schema_id =
157+ nested_classification_schema_id )
158+ ])
159+ ])
165160 ])
166161 ])
167162 ])
0 commit comments