Skip to content

Commit

Permalink
Fix issue where a lambda cannot be serialized.
Browse files Browse the repository at this point in the history
  • Loading branch information
Gamenot committed Oct 31, 2023
1 parent fc90e72 commit d56cf1a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion envision/data_formatter.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ class Operation(IntEnum):

_primitives = {int, float, str, VehicleType, TrafficActorType}

def _passthrough_method_1_arg(v):
return v

class ReductionContext:
"""Mappings between an object and its reduction to an ID."""
Expand Down Expand Up @@ -126,7 +128,7 @@ class EnvisionDataFormatterArgs(NamedTuple):
"""Data formatter configurations."""

id: Optional[str]
serializer: Callable[[list], Any] = lambda d: d
serializer: Callable[[list], Any] = _passthrough_method_1_arg
float_decimals: int = 2
bool_as_int: bool = True
enable_reduction: bool = True
Expand Down

0 comments on commit d56cf1a

Please sign in to comment.