Skip to content

Commit e8b7cac

Browse files
committed
added feedback
1 parent 8ba41c4 commit e8b7cac

File tree

1 file changed

+2
-40
lines changed

1 file changed

+2
-40
lines changed

libs/labelbox/src/labelbox/schema/ontology.py

Lines changed: 2 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ def add_option(self, option: Option) -> None:
223223
self.options.append(option)
224224

225225
@dataclass
226-
class ResponseOption:
226+
class ResponseOption(Option):
227227
"""
228228
An option is a possible answer within a PromptResponseClassification response object in
229229
a Project's ontology.
@@ -239,45 +239,7 @@ class ResponseOption:
239239
feature_schema_id: (str)
240240
options: (list)
241241
"""
242-
value: Union[str, int]
243-
label: Optional[Union[str, int]] = None
244-
schema_id: Optional[str] = None
245-
feature_schema_id: Optional[FeatureSchemaId] = None
246-
options: List["Classification"] = field(default_factory=list)
247-
248-
def __post_init__(self):
249-
if self.label is None:
250-
self.label = self.value
251-
252-
@classmethod
253-
def from_dict(
254-
cls,
255-
dictionary: Dict[str,
256-
Any]) -> Dict[Union[str, int], Union[str, int]]:
257-
return cls(value=dictionary["value"],
258-
label=dictionary["label"],
259-
schema_id=dictionary.get("schemaNodeId", None),
260-
feature_schema_id=dictionary.get("featureSchemaId", None),
261-
options=[
262-
PromptResponseClassification.from_dict(o)
263-
for o in dictionary.get("options", [])
264-
])
265-
266-
def asdict(self) -> Dict[str, Any]:
267-
return {
268-
"schemaNodeId": self.schema_id,
269-
"featureSchemaId": self.feature_schema_id,
270-
"label": self.label,
271-
"value": self.value,
272-
"options": [o.asdict(is_subclass=True) for o in self.options]
273-
}
274-
275-
def add_option(self, option: 'Classification') -> None:
276-
if option.name in (o.name for o in self.options):
277-
raise InconsistentOntologyException(
278-
f"Duplicate nested classification '{option.name}' "
279-
f"for option '{self.label}'")
280-
self.options.append(option)
242+
pass
281243

282244

283245
@dataclass

0 commit comments

Comments
 (0)