@@ -28,9 +28,9 @@ def test_plot(self):
2828 # the baseline (raw) should have 20 points
2929 # the clean version (clean) should have 2 points
3030 # 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
3434 plt .close ("all" )
3535
3636 def test_step (self ):
@@ -50,7 +50,7 @@ def test_scatter(self):
5050 x = np .linspace (1 , 100 , 20 )
5151 y = np .linspace (1 , 100 , 20 )
5252 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 ))
5454 ax .scatter (x , y )
5555 ax .set_ylim ([20 , 80 ])
5656 ax .set_xlim ([20 , 80 ])
@@ -63,9 +63,9 @@ def test_scatter(self):
6363 # the baseline (raw) should have 20 points
6464 # the clean version (clean) should have 2 points
6565 # 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
6969 plt .close ("all" )
7070
7171 def test_bar (self ):
@@ -113,9 +113,9 @@ def test_plot3d(self):
113113 clean = get_tikz_code ()
114114
115115 # 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
119119 plt .close ("all" )
120120
121121 def test_scatter3d (self ):
@@ -139,10 +139,10 @@ def test_scatter3d(self):
139139 clean = get_tikz_code ()
140140
141141 # 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 " )
144144
145- assert numLinesRaw - numLinesClean == 14
145+ assert num_lines_raw - num_lines_clean == 14
146146 plt .close ("all" )
147147
148148 def test_wireframe3D (self ):
@@ -257,7 +257,7 @@ def cc(arg):
257257 xs = np .arange (0 , 10 , 0.4 )
258258 verts = []
259259 zs = [0.0 , 1.0 , 2.0 , 3.0 ]
260- for z in zs :
260+ for _ in zs :
261261 ys = np .random .rand (len (xs ))
262262 ys [0 ], ys [- 1 ] = 0 , 0
263263 verts .append (list (zip (xs , ys )))
@@ -384,9 +384,9 @@ def test_line_no_markers(self):
384384 # the baseline (raw) should have 20 points
385385 # the clean version (clean) should have 2 points
386386 # 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
390390 plt .close ("all" )
391391
392392 def test_no_line_markers (self ):
@@ -410,9 +410,9 @@ def test_no_line_markers(self):
410410 # the baseline (raw) should have 20 points
411411 # the clean version (clean) should have 2 points
412412 # 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
416416 plt .close ("all" )
417417
418418 def test_line_markers (self ):
@@ -436,9 +436,9 @@ def test_line_markers(self):
436436 # the baseline (raw) should have 20 points
437437 # the clean version (clean) should have 2 points
438438 # 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
442442 plt .close ("all" )
443443
444444 def test_sine (self ):
@@ -459,9 +459,9 @@ def test_sine(self):
459459 # the baseline (raw) should have 20 points
460460 # the clean version (clean) should have 2 points
461461 # 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
465465 plt .close ("all" )
466466
467467
@@ -510,9 +510,9 @@ def test_subplot(self):
510510 # the baseline (raw) should have 20 points
511511 # the clean version (clean) should have 2 points
512512 # 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
516516 plt .close ("all" )
517517
518518
@@ -522,106 +522,106 @@ def test_ylog(self):
522522 y = np .exp (x )
523523
524524 with plt .rc_context (rc = RC_PARAMS ):
525- fig , ax = plt .subplots (1 )
525+ _ , ax = plt .subplots (1 )
526526 ax .plot (x , y )
527527 ax .set_yscale ("log" )
528528 raw = get_tikz_code ()
529529 clean_figure ()
530530
531531 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
536536 plt .close ("all" )
537537
538538 def test_xlog (self ):
539539 y = np .linspace (0 , 3 , 100 )
540540 x = np .exp (y )
541541
542542 with plt .rc_context (rc = RC_PARAMS ):
543- fig , ax = plt .subplots (1 )
543+ _ , ax = plt .subplots (1 )
544544 ax .plot (x , y )
545545 ax .set_xscale ("log" )
546546 raw = get_tikz_code ()
547547 clean_figure ()
548548
549549 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
554554 plt .close ("all" )
555555
556556 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 ))
559559
560560 with plt .rc_context (rc = RC_PARAMS ):
561- fig , ax = plt .subplots (1 )
561+ _ , ax = plt .subplots (1 )
562562 ax .plot (x , y )
563563 ax .set_xscale ("log" )
564564 ax .set_yscale ("log" )
565565 raw = get_tikz_code ()
566566 clean_figure ()
567567
568568 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
573573 plt .close ("all" )
574574
575575 def test_ylog_2 (self ):
576576 x = np .arange (1 , 100 )
577577 y = np .arange (1 , 100 )
578578 with plt .rc_context (rc = RC_PARAMS ):
579- fig , ax = plt .subplots (1 )
579+ _ , ax = plt .subplots (1 )
580580 ax .plot (x , y )
581581 ax .set_yscale ("log" )
582582 raw = get_tikz_code ()
583583 clean_figure ()
584584
585585 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
590590 plt .close ("all" )
591591
592592 def test_xlog_2 (self ):
593593 x = np .arange (1 , 100 )
594594 y = np .arange (1 , 100 )
595595 with plt .rc_context (rc = RC_PARAMS ):
596- fig , ax = plt .subplots (1 )
596+ _ , ax = plt .subplots (1 )
597597 ax .plot (x , y )
598598 ax .set_xscale ("log" )
599599 raw = get_tikz_code ()
600600 clean_figure ()
601601
602602 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
607607 plt .close ("all" )
608608
609609 def test_loglog_2 (self ):
610610 x = np .arange (1 , 100 )
611611 y = np .arange (1 , 100 )
612612 with plt .rc_context (rc = RC_PARAMS ):
613- fig , ax = plt .subplots (1 )
613+ _ , ax = plt .subplots (1 )
614614 ax .plot (x , y )
615615 ax .set_xscale ("log" )
616616 ax .set_yscale ("log" )
617617 raw = get_tikz_code ()
618618 clean_figure ()
619619
620620 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
625625 plt .close ("all" )
626626
627627 def test_loglog_3 (self ):
@@ -639,9 +639,9 @@ def test_loglog_3(self):
639639
640640 clean_figure (fig )
641641 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
645645 plt .close ("all" )
646646
647647 def test_xlog_3 (self ):
@@ -658,9 +658,9 @@ def test_xlog_3(self):
658658
659659 clean_figure (fig )
660660 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
664664 plt .close ("all" )
665665
666666
0 commit comments