From 63802ef0a8bef7a4e3debf3b87f3e7d854fde00d Mon Sep 17 00:00:00 2001 From: "hampus.londogard@gmail.com" Date: Wed, 2 Aug 2023 11:11:22 +0200 Subject: [PATCH] fix: remove numpy --- solara/components/slider.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/solara/components/slider.py b/solara/components/slider.py index 846257bd0..6cfbab7a8 100644 --- a/solara/components/slider.py +++ b/solara/components/slider.py @@ -1,10 +1,10 @@ +import math import os from datetime import date, datetime, timedelta from typing import Callable, List, Optional, Tuple, TypeVar, Union, cast import ipyvue import ipyvuetify -import numpy as np import reacton.core import traitlets from typing_extensions import Literal @@ -65,7 +65,7 @@ def set_value_cast(value): reactive_value.value = int(value) if tick_labels == "end_points": - num_repeats = int(np.ceil((max - min) / step)) - 1 + num_repeats = int(math.ceil((max - min) / step)) - 1 tick_labels = [str(min), *([None] * num_repeats), str(max)] return rv.Slider( @@ -133,7 +133,7 @@ def set_value_cast(value): reactive_value.set((int(v1), int(v2))) if tick_labels == "end_points": - num_repeats = int(np.ceil((max - min) / step)) - 1 + num_repeats = int(math.ceil((max - min) / step)) - 1 tick_labels = [str(min), *([None] * num_repeats), str(max)] return cast( @@ -203,7 +203,7 @@ def set_value_cast(value): reactive_value.set(float(value)) if tick_labels == "end_points": - num_repeats = int(np.ceil((max - min) / step)) - 1 + num_repeats = int(math.ceil((max - min) / step)) - 1 tick_labels = [str(min), *([None] * num_repeats), str(max)] return rv.Slider( @@ -271,7 +271,7 @@ def set_value_cast(value): reactive_value.set((float(v1), float(v2))) if tick_labels == "end_points": - num_repeats = int(np.ceil((max - min) / step)) - 1 + num_repeats = int(math.ceil((max - min) / step)) - 1 tick_labels = [str(min), *([None] * num_repeats), str(max)] return cast(