Skip to content

Commit

Permalink
fix: Final review changes (?) - remove defaults and make empty str ar…
Browse files Browse the repository at this point in the history
…ray not None-array
  • Loading branch information
Lundez committed Sep 9, 2023
1 parent 65902f3 commit 87f57ef
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions solara/components/slider.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def SliderInt(
max: int = 10,
step: int = 1,
on_value: Optional[Callable[[int], None]] = None,
thumb_label: Union[bool, Literal["always"]] = "always",
thumb_label: Union[bool, Literal["always"]] = True,
tick_labels: Union[List[str], Literal["end_points"], bool] = False,
disabled: bool = False,
):
Expand Down Expand Up @@ -68,7 +68,7 @@ def set_value_cast(value):

if tick_labels == "end_points":
num_repeats = int(math.ceil((max - min) / step)) - 1
tick_labels = [str(min), *([None] * num_repeats), str(max)]
tick_labels = [str(min), *([""] * num_repeats), str(max)]

return rv.Slider(
v_model=reactive_value.value,
Expand All @@ -93,7 +93,7 @@ def SliderRangeInt(
max: int = 10,
step: int = 1,
on_value: Callable[[Tuple[int, int]], None] = None,
thumb_label: Union[bool, Literal["always"]] = "always",
thumb_label: Union[bool, Literal["always"]] = True,
tick_labels: Union[List[str], Literal["end_points"], bool] = False,
disabled: bool = False,
) -> reacton.core.ValueElement[ipyvuetify.RangeSlider, Tuple[int, int]]:
Expand Down Expand Up @@ -137,7 +137,7 @@ def set_value_cast(value):

if tick_labels == "end_points":
num_repeats = int(math.ceil((max - min) / step)) - 1
tick_labels = [str(min), *([None] * num_repeats), str(max)]
tick_labels = [str(min), *([""] * num_repeats), str(max)]

return cast(
reacton.core.ValueElement[ipyvuetify.RangeSlider, Tuple[int, int]],
Expand Down Expand Up @@ -165,7 +165,7 @@ def SliderFloat(
max: float = 10.0,
step: float = 0.1,
on_value: Callable[[float], None] = None,
thumb_label: Union[bool, Literal["always"]] = "always",
thumb_label: Union[bool, Literal["always"]] = True,
tick_labels: Union[List[str], Literal["end_points"], bool] = False,
disabled: bool = False,
):
Expand Down Expand Up @@ -208,7 +208,7 @@ def set_value_cast(value):

if tick_labels == "end_points":
num_repeats = int(math.ceil((max - min) / step)) - 1
tick_labels = [str(min), *([None] * num_repeats), str(max)]
tick_labels = [str(min), *([""] * num_repeats), str(max)]

return rv.Slider(
v_model=reactive_value.value,
Expand All @@ -233,7 +233,7 @@ def SliderRangeFloat(
max: float = 10.0,
step: float = 0.1,
on_value: Callable[[Tuple[float, float]], None] = None,
thumb_label: Union[bool, Literal["always"]] = "always",
thumb_label: Union[bool, Literal["always"]] = True,
tick_labels: Union[List[str], Literal["end_points"], bool] = False,
disabled: bool = False,
) -> reacton.core.ValueElement[ipyvuetify.RangeSlider, Tuple[float, float]]:
Expand Down Expand Up @@ -277,7 +277,7 @@ def set_value_cast(value):

if tick_labels == "end_points":
num_repeats = int(math.ceil((max - min) / step)) - 1
tick_labels = [str(min), *([None] * num_repeats), str(max)]
tick_labels = [str(min), *([""] * num_repeats), str(max)]

return cast(
reacton.core.ValueElement[ipyvuetify.RangeSlider, Tuple[float, float]],
Expand Down

0 comments on commit 87f57ef

Please sign in to comment.