Skip to content

Commit

Permalink
fix: clamp nones into normal values as well
Browse files Browse the repository at this point in the history
  • Loading branch information
Encord-davids committed Oct 3, 2023
1 parent b19cf89 commit 1f988da
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1369,8 +1369,8 @@ def _transform_char8(value: Optional[str]) -> Optional[int]:
return int.from_bytes(value_bytes, byteorder="little", signed=True)


def _transform_clamp_normal(value: float) -> float:
if math.isnan(value):
def _transform_clamp_normal(value: Optional[float]) -> float:
if not value or math.isnan(value):
return 0.0
elif math.isinf(value):
return 1.0 if value > 0.0 else 0.0
Expand Down

0 comments on commit 1f988da

Please sign in to comment.