Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## v0.2.1

Updated to support numpy 2.0

## v0.2.0

Full-fledged implementation.

## v0.1.0

First official release.
2 changes: 1 addition & 1 deletion Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jupyterlab-widgets = "==3.0.13"
kiwisolver = "==1.4.7"
matplotlib = "==3.9.4"
matplotlib-inline = "==0.1.7"
numpy = "==1.26.4"
numpy = "==2.3.5"
packaging = "==24.2"
parso = "==0.8.4"
pexpect = "==4.9.0"
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ classifiers = [
]
dependencies = [
"ipywidgets>=8.0.0",
"numpy<2.0.0",
"numpy<3.0",
"widget_code_input>=4.0.17",
"matplotlib",
"termcolor"
Expand Down
2 changes: 1 addition & 1 deletion src/scwidgets/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "0.2.0"
__version__ = "0.2.1"
__authors__ = "the scicode-widgets developer team"

from .check import * # noqa: F403
Expand Down
2 changes: 1 addition & 1 deletion src/scwidgets/check/_asserts.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,5 +307,5 @@ def assert_numpy_sub_dtype(


assert_numpy_floating_sub_dtype = functools.partial(
assert_numpy_sub_dtype, numpy_type=np.floating
assert_numpy_sub_dtype, numpy_type=float
)
2 changes: 1 addition & 1 deletion src/scwidgets/check/_widget_check_registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class CheckableWidget:
"""

def __init__(
self, check_registry: Optional[CheckRegistry], name: Optional[str] = None
self, check_registry: Optional[CheckRegistry] = None, name: Optional[str] = None
):
self._check_registry = check_registry
if self._check_registry is not None:
Expand Down
6 changes: 4 additions & 2 deletions src/scwidgets/cue/_widget_cue.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class CueWidget:

def __init__(
self,
widgets_to_observe: Union[List[Widget], Widget],
widgets_to_observe: Union[List[Widget], Widget, None] = None,
traits_to_observe: Union[
str, Sentinel, List[Union[str, Sentinel, List[str]]]
] = "value",
Expand All @@ -30,7 +30,9 @@ def __init__(
):
self._widgets_to_observe: List[Widget] = []
self._traits_to_observe: List[Union[str, Sentinel, List[str]]] = []
self.set_widgets_to_observe(widgets_to_observe, traits_to_observe)
if widgets_to_observe is not None:
# normal usage (your explicit calls)
self.set_widgets_to_observe(widgets_to_observe, traits_to_observe)

self.cued = cued

Expand Down
10 changes: 8 additions & 2 deletions src/scwidgets/cue/_widget_reset_cue_button.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ def __init__(

self._css_style = css_style

Button.__init__(self, *args, **kwargs)
tooltip = kwargs.pop("button_tooltip", None)
Button.__init__(self, *args, tooltip=tooltip, **kwargs)

if widgets_to_observe is None:
widgets_to_observe = []
Expand All @@ -88,7 +89,12 @@ def __init__(
if cued is None:
cued = any([cue_widget.cued for cue_widget in cue_widgets])

CueWidget.__init__(self, widgets_to_observe, traits_to_observe, cued)
CueWidget.__init__(
self,
widgets_to_observe=widgets_to_observe,
traits_to_observe=traits_to_observe,
cued=cued,
)
self._cue_widgets = cue_widgets

self.on_click(self._on_click)
Expand Down
12 changes: 6 additions & 6 deletions tests/test_widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -819,7 +819,7 @@ def test_reset_cue_button(

# Check if unused text input does not effect cueing of button
unused_text_input.send_keys("a")
time.sleep(0.1)
time.sleep(0.5)
assert unused_text_input.get_attribute("value") == "Unuseda"
assert (
sum(
Expand Down Expand Up @@ -847,7 +847,7 @@ def test_reset_cue_button(
)
assert not (reset_cue_button.is_enabled())
else:
time.sleep(0.1)
time.sleep(0.5)
assert reset_cue_button.is_enabled()

# Checks if two more widgets are cued on change
Expand Down Expand Up @@ -884,7 +884,7 @@ def test_reset_cue_button(
)
assert not (reset_cue_button.is_enabled())
else:
time.sleep(0.1)
time.sleep(0.5)
assert reset_cue_button.is_enabled()

assert (
Expand Down Expand Up @@ -993,7 +993,7 @@ def test_button_clicks(
# button is obscured so we need to click with action on the cell
ActionChains(driver).click(nb_cell).perform()
check_all_widgets_button.click()
time.sleep(0.1)
time.sleep(0.5)
outputs = nb_cell.find_elements(By.CLASS_NAME, OUTPUT_CLASS_NAME)
assert (
sum(
Expand All @@ -1011,7 +1011,7 @@ def test_button_clicks(
WebDriverWait(driver, 5).until(
expected_conditions.element_to_be_clickable(set_all_references_button)
).click()
time.sleep(0.1)
time.sleep(0.5)
outputs = nb_cell.find_elements(By.CLASS_NAME, OUTPUT_CLASS_NAME)
assert (
sum(
Expand All @@ -1029,7 +1029,7 @@ def test_button_clicks(
WebDriverWait(driver, 5).until(
expected_conditions.element_to_be_clickable(check_all_widgets_button)
).click()
time.sleep(0.1)
time.sleep(0.5)
outputs = nb_cell.find_elements(By.CLASS_NAME, OUTPUT_CLASS_NAME)
assert (
sum(
Expand Down
10 changes: 5 additions & 5 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ setenv =
deps =
pytest<8.0.0
pytest-rerunfailures
pytest-html<4.0.0,
pytest-html<4.0.0
# selenium juypter notebook tests
jupyterlab==3.6.5
# fixing selenium version to have backwards-compatibility with pytest-selenium
Expand All @@ -41,8 +41,8 @@ deps =
jupytext==1.15.0
imageio
# we fix matplotlib for consistent image tests
matplotlib==3.7.2
numpy<2.0.0
matplotlib==3.7.3
numpy<3.0
scikit-image
ipympl
commands =
Expand Down Expand Up @@ -74,8 +74,8 @@ deps =
jupytext==1.15.0
imageio
# we fix matplotlib for consistent image tests
matplotlib==3.7.2
numpy<2.0.0
matplotlib==3.7.3
numpy<3.0
scikit-image
ipympl
commands =
Expand Down
Loading