@@ -28,9 +28,9 @@ def test_plot(self):
28
28
# the baseline (raw) should have 20 points
29
29
# the clean version (clean) should have 2 points
30
30
# the difference in line numbers should therefore be 2
31
- numLinesRaw = raw .count ("\n " )
32
- numLinesClean = clean .count ("\n " )
33
- assert numLinesRaw - numLinesClean == 18
31
+ num_lines_raw = raw .count ("\n " )
32
+ num_lines_clean = clean .count ("\n " )
33
+ assert num_lines_raw - num_lines_clean == 18
34
34
plt .close ("all" )
35
35
36
36
def test_step (self ):
@@ -50,7 +50,7 @@ def test_scatter(self):
50
50
x = np .linspace (1 , 100 , 20 )
51
51
y = np .linspace (1 , 100 , 20 )
52
52
with plt .rc_context (rc = RC_PARAMS ):
53
- fig , ax = plt .subplots (1 , 1 , figsize = (5 , 5 ))
53
+ _ , ax = plt .subplots (1 , 1 , figsize = (5 , 5 ))
54
54
ax .scatter (x , y )
55
55
ax .set_ylim ([20 , 80 ])
56
56
ax .set_xlim ([20 , 80 ])
@@ -63,9 +63,9 @@ def test_scatter(self):
63
63
# the baseline (raw) should have 20 points
64
64
# the clean version (clean) should have 2 points
65
65
# the difference in line numbers should therefore be 2
66
- numLinesRaw = raw .count ("\n " )
67
- numLinesClean = clean .count ("\n " )
68
- assert numLinesRaw - numLinesClean == 6
66
+ num_lines_raw = raw .count ("\n " )
67
+ num_lines_clean = clean .count ("\n " )
68
+ assert num_lines_raw - num_lines_clean == 6
69
69
plt .close ("all" )
70
70
71
71
def test_bar (self ):
@@ -113,9 +113,9 @@ def test_plot3d(self):
113
113
clean = get_tikz_code ()
114
114
115
115
# Use number of lines to test if it worked.
116
- numLinesRaw = raw .count ("\n " )
117
- numLinesClean = clean .count ("\n " )
118
- assert numLinesRaw - numLinesClean == 13
116
+ num_lines_raw = raw .count ("\n " )
117
+ num_lines_clean = clean .count ("\n " )
118
+ assert num_lines_raw - num_lines_clean == 13
119
119
plt .close ("all" )
120
120
121
121
def test_scatter3d (self ):
@@ -139,10 +139,10 @@ def test_scatter3d(self):
139
139
clean = get_tikz_code ()
140
140
141
141
# Use number of lines to test if it worked.
142
- numLinesRaw = raw .count ("\n " )
143
- numLinesClean = clean .count ("\n " )
142
+ num_lines_raw = raw .count ("\n " )
143
+ num_lines_clean = clean .count ("\n " )
144
144
145
- assert numLinesRaw - numLinesClean == 14
145
+ assert num_lines_raw - num_lines_clean == 14
146
146
plt .close ("all" )
147
147
148
148
def test_wireframe3D (self ):
@@ -257,7 +257,7 @@ def cc(arg):
257
257
xs = np .arange (0 , 10 , 0.4 )
258
258
verts = []
259
259
zs = [0.0 , 1.0 , 2.0 , 3.0 ]
260
- for z in zs :
260
+ for _ in zs :
261
261
ys = np .random .rand (len (xs ))
262
262
ys [0 ], ys [- 1 ] = 0 , 0
263
263
verts .append (list (zip (xs , ys )))
@@ -384,9 +384,9 @@ def test_line_no_markers(self):
384
384
# the baseline (raw) should have 20 points
385
385
# the clean version (clean) should have 2 points
386
386
# the difference in line numbers should therefore be 2
387
- numLinesRaw = raw .count ("\n " )
388
- numLinesClean = clean .count ("\n " )
389
- assert numLinesRaw - numLinesClean == 18
387
+ num_lines_raw = raw .count ("\n " )
388
+ num_lines_clean = clean .count ("\n " )
389
+ assert num_lines_raw - num_lines_clean == 18
390
390
plt .close ("all" )
391
391
392
392
def test_no_line_markers (self ):
@@ -410,9 +410,9 @@ def test_no_line_markers(self):
410
410
# the baseline (raw) should have 20 points
411
411
# the clean version (clean) should have 2 points
412
412
# the difference in line numbers should therefore be 2
413
- numLinesRaw = raw .count ("\n " )
414
- numLinesClean = clean .count ("\n " )
415
- assert numLinesRaw - numLinesClean == 6
413
+ num_lines_raw = raw .count ("\n " )
414
+ num_lines_clean = clean .count ("\n " )
415
+ assert num_lines_raw - num_lines_clean == 6
416
416
plt .close ("all" )
417
417
418
418
def test_line_markers (self ):
@@ -436,9 +436,9 @@ def test_line_markers(self):
436
436
# the baseline (raw) should have 20 points
437
437
# the clean version (clean) should have 2 points
438
438
# the difference in line numbers should therefore be 2
439
- numLinesRaw = raw .count ("\n " )
440
- numLinesClean = clean .count ("\n " )
441
- assert numLinesRaw - numLinesClean == 6
439
+ num_lines_raw = raw .count ("\n " )
440
+ num_lines_clean = clean .count ("\n " )
441
+ assert num_lines_raw - num_lines_clean == 6
442
442
plt .close ("all" )
443
443
444
444
def test_sine (self ):
@@ -459,9 +459,9 @@ def test_sine(self):
459
459
# the baseline (raw) should have 20 points
460
460
# the clean version (clean) should have 2 points
461
461
# the difference in line numbers should therefore be 2
462
- numLinesRaw = raw .count ("\n " )
463
- numLinesClean = clean .count ("\n " )
464
- assert numLinesRaw - numLinesClean == 39
462
+ num_lines_raw = raw .count ("\n " )
463
+ num_lines_clean = clean .count ("\n " )
464
+ assert num_lines_raw - num_lines_clean == 39
465
465
plt .close ("all" )
466
466
467
467
@@ -510,9 +510,9 @@ def test_subplot(self):
510
510
# the baseline (raw) should have 20 points
511
511
# the clean version (clean) should have 2 points
512
512
# the difference in line numbers should therefore be 2
513
- numLinesRaw = raw .count ("\n " )
514
- numLinesClean = clean .count ("\n " )
515
- assert numLinesRaw - numLinesClean == 36
513
+ num_lines_raw = raw .count ("\n " )
514
+ num_lines_clean = clean .count ("\n " )
515
+ assert num_lines_raw - num_lines_clean == 36
516
516
plt .close ("all" )
517
517
518
518
@@ -522,106 +522,106 @@ def test_ylog(self):
522
522
y = np .exp (x )
523
523
524
524
with plt .rc_context (rc = RC_PARAMS ):
525
- fig , ax = plt .subplots (1 )
525
+ _ , ax = plt .subplots (1 )
526
526
ax .plot (x , y )
527
527
ax .set_yscale ("log" )
528
528
raw = get_tikz_code ()
529
529
clean_figure ()
530
530
531
531
clean = get_tikz_code ()
532
- numLinesRaw = raw .count ("\n " )
533
- numLinesClean = clean .count ("\n " )
534
- assert numLinesRaw - numLinesClean == 98
535
- assert numLinesClean == 25
532
+ num_lines_raw = raw .count ("\n " )
533
+ num_lines_clean = clean .count ("\n " )
534
+ assert num_lines_raw - num_lines_clean == 98
535
+ assert num_lines_clean == 25
536
536
plt .close ("all" )
537
537
538
538
def test_xlog (self ):
539
539
y = np .linspace (0 , 3 , 100 )
540
540
x = np .exp (y )
541
541
542
542
with plt .rc_context (rc = RC_PARAMS ):
543
- fig , ax = plt .subplots (1 )
543
+ _ , ax = plt .subplots (1 )
544
544
ax .plot (x , y )
545
545
ax .set_xscale ("log" )
546
546
raw = get_tikz_code ()
547
547
clean_figure ()
548
548
549
549
clean = get_tikz_code ()
550
- numLinesRaw = raw .count ("\n " )
551
- numLinesClean = clean .count ("\n " )
552
- assert numLinesRaw - numLinesClean == 98
553
- assert numLinesClean == 25
550
+ num_lines_raw = raw .count ("\n " )
551
+ num_lines_clean = clean .count ("\n " )
552
+ assert num_lines_raw - num_lines_clean == 98
553
+ assert num_lines_clean == 25
554
554
plt .close ("all" )
555
555
556
556
def test_loglog (self ):
557
- x = np .exp (np .logspace (0 , 5 , 100 ))
558
- y = np .exp (np .logspace (0 , 5 , 100 ))
557
+ x = np .exp (np .logspace (0.0 , 1. 5 , 100 ))
558
+ y = np .exp (np .logspace (0.0 , 1. 5 , 100 ))
559
559
560
560
with plt .rc_context (rc = RC_PARAMS ):
561
- fig , ax = plt .subplots (1 )
561
+ _ , ax = plt .subplots (1 )
562
562
ax .plot (x , y )
563
563
ax .set_xscale ("log" )
564
564
ax .set_yscale ("log" )
565
565
raw = get_tikz_code ()
566
566
clean_figure ()
567
567
568
568
clean = get_tikz_code ()
569
- numLinesRaw = raw .count ("\n " )
570
- numLinesClean = clean .count ("\n " )
571
- assert numLinesRaw - numLinesClean == 99
572
- assert numLinesClean == 27
569
+ num_lines_raw = raw .count ("\n " )
570
+ num_lines_clean = clean .count ("\n " )
571
+ assert num_lines_raw == 125
572
+ assert num_lines_clean == 27
573
573
plt .close ("all" )
574
574
575
575
def test_ylog_2 (self ):
576
576
x = np .arange (1 , 100 )
577
577
y = np .arange (1 , 100 )
578
578
with plt .rc_context (rc = RC_PARAMS ):
579
- fig , ax = plt .subplots (1 )
579
+ _ , ax = plt .subplots (1 )
580
580
ax .plot (x , y )
581
581
ax .set_yscale ("log" )
582
582
raw = get_tikz_code ()
583
583
clean_figure ()
584
584
585
585
clean = get_tikz_code ()
586
- numLinesRaw = raw .count ("\n " )
587
- numLinesClean = clean .count ("\n " )
588
- assert numLinesRaw - numLinesClean == 51
589
- assert numLinesClean == 71
586
+ num_lines_raw = raw .count ("\n " )
587
+ num_lines_clean = clean .count ("\n " )
588
+ assert num_lines_raw - num_lines_clean == 51
589
+ assert num_lines_clean == 71
590
590
plt .close ("all" )
591
591
592
592
def test_xlog_2 (self ):
593
593
x = np .arange (1 , 100 )
594
594
y = np .arange (1 , 100 )
595
595
with plt .rc_context (rc = RC_PARAMS ):
596
- fig , ax = plt .subplots (1 )
596
+ _ , ax = plt .subplots (1 )
597
597
ax .plot (x , y )
598
598
ax .set_xscale ("log" )
599
599
raw = get_tikz_code ()
600
600
clean_figure ()
601
601
602
602
clean = get_tikz_code ()
603
- numLinesRaw = raw .count ("\n " )
604
- numLinesClean = clean .count ("\n " )
605
- assert numLinesRaw - numLinesClean == 51
606
- assert numLinesClean == 71
603
+ num_lines_raw = raw .count ("\n " )
604
+ num_lines_clean = clean .count ("\n " )
605
+ assert num_lines_raw - num_lines_clean == 51
606
+ assert num_lines_clean == 71
607
607
plt .close ("all" )
608
608
609
609
def test_loglog_2 (self ):
610
610
x = np .arange (1 , 100 )
611
611
y = np .arange (1 , 100 )
612
612
with plt .rc_context (rc = RC_PARAMS ):
613
- fig , ax = plt .subplots (1 )
613
+ _ , ax = plt .subplots (1 )
614
614
ax .plot (x , y )
615
615
ax .set_xscale ("log" )
616
616
ax .set_yscale ("log" )
617
617
raw = get_tikz_code ()
618
618
clean_figure ()
619
619
620
620
clean = get_tikz_code ()
621
- numLinesRaw = raw .count ("\n " )
622
- numLinesClean = clean .count ("\n " )
623
- assert numLinesRaw - numLinesClean == 97
624
- assert numLinesClean == 27
621
+ num_lines_raw = raw .count ("\n " )
622
+ num_lines_clean = clean .count ("\n " )
623
+ assert num_lines_raw - num_lines_clean == 97
624
+ assert num_lines_clean == 27
625
625
plt .close ("all" )
626
626
627
627
def test_loglog_3 (self ):
@@ -639,9 +639,9 @@ def test_loglog_3(self):
639
639
640
640
clean_figure (fig )
641
641
clean = get_tikz_code ()
642
- numLinesRaw = raw .count ("\n " )
643
- numLinesClean = clean .count ("\n " )
644
- assert numLinesRaw - numLinesClean == 18
642
+ num_lines_raw = raw .count ("\n " )
643
+ num_lines_clean = clean .count ("\n " )
644
+ assert num_lines_raw - num_lines_clean == 18
645
645
plt .close ("all" )
646
646
647
647
def test_xlog_3 (self ):
@@ -658,9 +658,9 @@ def test_xlog_3(self):
658
658
659
659
clean_figure (fig )
660
660
clean = get_tikz_code ()
661
- numLinesRaw = raw .count ("\n " )
662
- numLinesClean = clean .count ("\n " )
663
- assert numLinesRaw - numLinesClean == 18
661
+ num_lines_raw = raw .count ("\n " )
662
+ num_lines_clean = clean .count ("\n " )
663
+ assert num_lines_raw - num_lines_clean == 18
664
664
plt .close ("all" )
665
665
666
666
0 commit comments