Skip to content

Commit

Permalink
Preserve the unit when serializing
Browse files Browse the repository at this point in the history
  • Loading branch information
haticekaratay committed Dec 19, 2024
1 parent 640b615 commit d7d7439
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion jdaviz/core/template_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -4698,7 +4698,7 @@ def float_precision(column, item):
elif isinstance(item, (np.float32, np.float64)):
return float(item)
elif isinstance(item, u.Quantity):
return item.value.tolist() if item.size > 1 else item.value
return {"value": item.value.tolist() if item.size > 1 else item.value, "unit": str(item.unit)}
elif isinstance(item, np.bool_):
return bool(item)
elif isinstance(item, np.ndarray):
Expand Down

0 comments on commit d7d7439

Please sign in to comment.