Skip to content

Commit

Permalink
remove unnecessary dataclass serialization logic
Browse files Browse the repository at this point in the history
  • Loading branch information
brentyi committed Mar 21, 2024
1 parent 67f0926 commit 91e45dc
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions src/viser/infra/_messages.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,6 @@ def _prepare_for_serialization(value: Any, annotation: Type) -> Any:
if isinstance(value, onp.ndarray):
return value.data if value.data.c_contiguous else value.copy().data

if dataclasses.is_dataclass(annotation):
types = get_type_hints_cached(annotation)
value = {
k: _prepare_for_serialization(v, types[k])
for k, v in dataclasses.asdict(value).items()
}

return value


Expand Down

0 comments on commit 91e45dc

Please sign in to comment.