diff --git a/fury/decorators.py b/fury/decorators.py index 040d69c6f9..34adbbc4d9 100644 --- a/fury/decorators.py +++ b/fury/decorators.py @@ -1,7 +1,5 @@ """Decorators for FURY tests.""" -from functools import wraps -from inspect import signature from functools import wraps from inspect import signature import platform @@ -84,18 +82,6 @@ def keyword_only(func): Traceback (most recent call last): ... TypeError: f() missing 1 required keyword-only argument: 'c' - >>> f(1, 2, c=3, d=4, e=5, f=6) - Traceback (most recent call last): - ... - TypeError: f() got an unexpected keyword argument 'f' - >>> f(1, c=3, d=4, e=5) - Traceback (most recent call last): - ... - TypeError: f() missing 1 required positional argument: 'b' - >>> f(1, 2, 3, 4, 5, 6) - Traceback (most recent call last): - ... - TypeError: f() takes 2 positional arguments but 6 were given """ @wraps(func) @@ -122,6 +108,7 @@ def wrapper(*args, **kwargs): if arg not in kwargs and params[arg].default != params[arg].empty ] func_params_sample = [] + # Create a sample of the function call for arg in params.values(): if arg.kind in (arg.POSITIONAL_OR_KEYWORD, arg.POSITIONAL_ONLY): func_params_sample.append(f"{arg.name}_value") diff --git a/fury/interactor.py b/fury/interactor.py index 39a66d553d..db1e8bcea9 100644 --- a/fury/interactor.py +++ b/fury/interactor.py @@ -4,7 +4,6 @@ import numpy as np -from fury.decorators import keyword_only from fury.decorators import keyword_only from fury.lib import ( Command, @@ -119,12 +118,6 @@ def get_prop_at_event_position(self): # TODO: return a list of items (i.e. each level of the assembly path). event_pos = self.GetInteractor().GetEventPosition() - self.picker.Pick( - event_pos[0], - event_pos[1], - 0, - self.GetCurrentRenderer(), - ) self.picker.Pick( event_pos[0], event_pos[1], @@ -186,8 +179,6 @@ def _process_event(self, obj, evt): self.event.reset() # Event fully processed. - @keyword_only - def _button_clicked(self, button, *, last_event=-1, before_last_event=-2): @keyword_only def _button_clicked(self, button, *, last_event=-1, before_last_event=-2): if len(self.history) < abs(before_last_event): @@ -196,7 +187,6 @@ def _button_clicked(self, button, *, last_event=-1, before_last_event=-2): if self.history[last_event]["event"] != button + "ButtonReleaseEvent": return False - if (self.history[before_last_event]["event"]) != (button + "ButtonPressEvent"): # noqa if (self.history[before_last_event]["event"]) != (button + "ButtonPressEvent"): # noqa return False @@ -208,8 +198,8 @@ def _button_double_clicked(self, button): and ( self._button_clicked( button, - -3, - -4, + last_event=-3, + before_last_event=-4, ) ) ): @@ -409,16 +399,6 @@ def force_render(self): """Causes the scene to refresh.""" self.GetInteractor().GetRenderWindow().Render() - @keyword_only - def add_callback( - self, - prop, - event_type, - callback, - *, - priority=0, - args=None, - ): @keyword_only def add_callback( self, @@ -460,9 +440,6 @@ def _callback(_obj, event_name): self.event2id[event_type] = (Command.UserEvent) + ( len(self.event2id) + 1 ) - self.event2id[event_type] = (Command.UserEvent) + ( - len(self.event2id) + 1 - ) event_type = self.event2id[event_type] diff --git a/fury/molecular.py b/fury/molecular.py index 80571c2213..edb10fbb42 100644 --- a/fury/molecular.py +++ b/fury/molecular.py @@ -807,7 +807,7 @@ def ribbon(molecule): for i in range(num_total_atoms): radii[i] = np.repeat( - table.atomic_radius(all_atomic_numbers[i], "VDW"), + table.atomic_radius(all_atomic_numbers[i], radius_type="VDW"), 3, ) rgb[i] = table.atom_color(all_atomic_numbers[i])