Skip to content

Commit 1d03aa3

Browse files
author
Benedikt Obermayer
committed
floats in json
1 parent 17d5e8a commit 1d03aa3

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

scelvis/callbacks.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -524,8 +524,8 @@ def update_filter_cells_controls(pathname, attribute, filters_json):
524524
range_min = values.min()
525525
range_max = values.max()
526526
if attribute in filters:
527-
val_min = float(filters[attribute][0])
528-
val_max = float(filters[attribute][1])
527+
val_min = filters[attribute][0]
528+
val_max = filters[attribute][1]
529529
else:
530530
val_min = range_min
531531
val_max = range_max
@@ -601,7 +601,7 @@ def update_filter_cells_filters(
601601
if not pd.api.types.is_numeric_dtype(values):
602602
filters[attribute] = sorted(cat_value)
603603
else:
604-
filters[attribute] = ["{0:g}".format(v) for v in range_value]
604+
filters[attribute] = range_value
605605

606606
status += ", ".join(attributes)
607607
return (json.dumps(filters), status, status)
@@ -632,8 +632,8 @@ def activate_filter_cells_reset(pathname, filters_json):
632632
else:
633633
range_min = values.min()
634634
range_max = values.max()
635-
val_min = float(filters[attribute][0])
636-
val_max = float(filters[attribute][1])
635+
val_min = filters[attribute][0]
636+
val_max = filters[attribute][1]
637637
if val_min > range_min or val_max < range_max:
638638
disabled = False
639639

0 commit comments

Comments
 (0)