Skip to content

Commit 279db0b

Browse files
committed
Temporarily, ignore undefined vars in mlprimer
* It's not clear what are all the libraries used here as they are not fully specified in the requirements.txt
1 parent 3501e2d commit 279db0b

File tree

1 file changed

+16
-12
lines changed

1 file changed

+16
-12
lines changed

project/interface/mlprimer.py

+16-12
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ def q(tl, s):
157157
q(tl + s * unit_y, s) | q(tl + s * (unit_y + unit_x), s)
158158
)
159159

160-
return q(P2(0, 0), 1)
160+
return q(P2(0, 0), 1) # noqa: F821
161161

162162

163163
def draw_graph(f, c1=Color("red"), c2=Color("lightblue")):
@@ -167,22 +167,22 @@ def draw_graph(f, c1=Color("red"), c2=Color("lightblue")):
167167
def compare(m1, m2):
168168
return (
169169
draw_graph(m1).center_xy()
170-
| hstrut(0.5)
171-
| text("→", 0.5).fill_color(Color("black"))
172-
| hstrut(0.5)
170+
| hstrut(0.5) # noqa: F821
171+
| text("→", 0.5).fill_color(Color("black")) # noqa: F821
172+
| hstrut(0.5) # noqa: F821
173173
| draw_graph(m2).center_xy()
174174
)
175175

176176

177177
def with_points(pts1, pts2, b):
178178
"Draw a picture showing line to boundary"
179179
w1, w2 = 1, 1
180-
model = Linear(w1, w2, b)
180+
model = Linear(w1, w2, b) # noqa: F821
181181
line = make_path([(0, b), (1, b + 1)])
182182
dia = draw_graph(model) + split_graph(pts1, pts2, False)
183183

184184
for pt in pts1:
185-
pt2 = line.get_trace().trace_p(P2(pt[0], -pt[1]), V2(-1, 1))
185+
pt2 = line.get_trace().trace_p(P2(pt[0], -pt[1]), V2(-1, 1)) # noqa: F821
186186
if pt2:
187187
dia += make_path([(pt[0], -pt[1]), pt2]).dashing([5, 5], 0)
188188
return dia
@@ -216,22 +216,26 @@ def show_loss(full_loss):
216216
i = 0
217217
for j, b in enumerate(range(20)):
218218
b = -1.7 + b / 20
219-
m = Linear(1, 1, b)
219+
m = Linear(1, 1, b) # noqa: F821
220220
pt = (b, full_loss(m))
221221
path.append(pt)
222222
if j % 5 == 0:
223-
d = d | hstrut(0.5) | show(m).named(("graph", i))
224-
p = circle(0.01).translate(pt[0], pt[1]).fill_color(Color("black"))
223+
d = d | hstrut(0.5) | show(m).named(("graph", i)) # noqa: F821
224+
p = (
225+
circle(0.01) # noqa: F821
226+
.translate(pt[0], pt[1])
227+
.fill_color(Color("black"))
228+
)
225229
p = p.named(("x", i))
226230
i += 1
227231
scores.append(p)
228232
d = (
229-
(concat(scores) + make_path(path)).center_xy().scale(3)
230-
/ vstrut(0.5)
233+
(concat(scores) + make_path(path)).center_xy().scale(3) # noqa: F821
234+
/ vstrut(0.5) # noqa: F821
231235
/ d.scale(2).center_xy()
232236
)
233237
for i in range(i):
234-
d = d.connect(("graph", i), ("x", i), ArrowOpts(head_pad=0.1))
238+
d = d.connect(("graph", i), ("x", i), ArrowOpts(head_pad=0.1)) # noqa: F821
235239
return d
236240

237241

0 commit comments

Comments
 (0)