Skip to content

Commit 54d9914

Browse files
authored
test: Fix typing issues (#384)
* Avoid reassignment in update_gradient_coordinate * Fix wrong import of Figure
1 parent b61f2e1 commit 54d9914

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

tests/plots/_utils.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import numpy as np
22
import torch
3-
from dash.html import Figure
43
from plotly import graph_objects as go
5-
from plotly.graph_objs import Scatter
4+
from plotly.graph_objs import Figure, Scatter
65

76
from torchjd.aggregation import Aggregator
87

tests/plots/interactive_plotter.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import numpy as np
77
import torch
88
from dash import Dash, Input, Output, callback, dcc, html
9-
from dash.html import Figure
9+
from plotly.graph_objs import Figure
1010
from plots._utils import Plotter, angle_to_coord, coord_to_angle
1111

1212
from torchjd.aggregation import (
@@ -121,11 +121,11 @@ def update_seed(value: int) -> Figure:
121121
prevent_initial_call=True,
122122
)
123123
def update_gradient_coordinate(*values) -> Figure:
124-
values = [float(value) for value in values]
124+
values_ = [float(value) for value in values]
125125

126-
for j in range(len(values) // 2):
127-
angle = values[2 * j]
128-
r = values[2 * j + 1]
126+
for j in range(len(values_) // 2):
127+
angle = values_[2 * j]
128+
r = values_[2 * j + 1]
129129
x, y = angle_to_coord(angle, r)
130130
plotter.matrix[j, 0] = x
131131
plotter.matrix[j, 1] = y

0 commit comments

Comments
 (0)