@@ -592,8 +592,10 @@ def test_light_source_topo_surface():
592592
593593
594594def test_light_source_shading_default ():
595- """Array comparison test for the default "hsv" blend mode. Ensure the
596- default result doesn't change without warning."""
595+ """
596+ Array comparison test for the default "hsv" blend mode. Ensure the
597+ default result doesn't change without warning.
598+ """
597599 y , x = np .mgrid [- 1.2 :1.2 :8j , - 1.2 :1.2 :8j ]
598600 z = 10 * np .cos (x ** 2 + y ** 2 )
599601
@@ -647,8 +649,10 @@ def test_light_source_shading_default():
647649# additional elements being masked when calculating the gradient thus
648650# the output is different with earlier numpy versions.
649651def test_light_source_masked_shading ():
650- """Array comparison test for a surface with a masked portion. Ensures that
651- we don't wind up with "fringes" of odd colors around masked regions."""
652+ """
653+ Array comparison test for a surface with a masked portion. Ensures that
654+ we don't wind up with "fringes" of odd colors around masked regions.
655+ """
652656 y , x = np .mgrid [- 1.2 :1.2 :8j , - 1.2 :1.2 :8j ]
653657 z = 10 * np .cos (x ** 2 + y ** 2 )
654658
@@ -701,8 +705,10 @@ def test_light_source_masked_shading():
701705
702706
703707def test_light_source_hillshading ():
704- """Compare the current hillshading method against one that should be
705- mathematically equivalent. Illuminates a cone from a range of angles."""
708+ """
709+ Compare the current hillshading method against one that should be
710+ mathematically equivalent. Illuminates a cone from a range of angles.
711+ """
706712
707713 def alternative_hillshade (azimuth , elev , z ):
708714 illum = _sph2cart (* _azimuth2math (azimuth , elev ))
@@ -730,20 +736,25 @@ def alternative_hillshade(azimuth, elev, z):
730736
731737
732738def test_light_source_planar_hillshading ():
733- """Ensure that the illumination intensity is correct for planar
734- surfaces."""
739+ """
740+ Ensure that the illumination intensity is correct for planar surfaces.
741+ """
735742
736743 def plane (azimuth , elevation , x , y ):
737- """Create a plane whose normal vector is at the given azimuth and
738- elevation."""
744+ """
745+ Create a plane whose normal vector is at the given azimuth and
746+ elevation.
747+ """
739748 theta , phi = _azimuth2math (azimuth , elevation )
740749 a , b , c = _sph2cart (theta , phi )
741750 z = - (a * x + b * y ) / c
742751 return z
743752
744753 def angled_plane (azimuth , elevation , angle , x , y ):
745- """Create a plane whose normal vector is at an angle from the given
746- azimuth and elevation."""
754+ """
755+ Create a plane whose normal vector is at an angle from the given
756+ azimuth and elevation.
757+ """
747758 elevation = elevation + angle
748759 if elevation > 90 :
749760 azimuth = (azimuth + 180 ) % 360
@@ -775,8 +786,10 @@ def _sph2cart(theta, phi):
775786
776787
777788def _azimuth2math (azimuth , elevation ):
778- """Converts from clockwise-from-north and up-from-horizontal to
779- mathematical conventions."""
789+ """
790+ Convert from clockwise-from-north and up-from-horizontal to mathematical
791+ conventions.
792+ """
780793 theta = np .radians ((90 - azimuth ) % 360 )
781794 phi = np .radians (90 - elevation )
782795 return theta , phi
@@ -795,8 +808,10 @@ def test_pandas_iterable(pd):
795808
796809@pytest .mark .parametrize ('name' , sorted (cm .cmap_d ))
797810def test_colormap_reversing (name ):
798- """Check the generated _lut data of a colormap and corresponding
799- reversed colormap if they are almost the same."""
811+ """
812+ Check the generated _lut data of a colormap and corresponding reversed
813+ colormap if they are almost the same.
814+ """
800815 cmap = plt .get_cmap (name )
801816 cmap_r = cmap .reversed ()
802817 if not cmap_r ._isinit :
0 commit comments