Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 7f36452

Browse files
committed
Style fixes to grid_finder.
1 parent ae73a46 commit 7f36452

File tree

1 file changed

+18
-27
lines changed

1 file changed

+18
-27
lines changed

lib/mpl_toolkits/axisartist/grid_finder.py

Lines changed: 18 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -55,15 +55,13 @@ def __init__(self,
5555
(may use update_transform)
5656
"""
5757
super().__init__()
58-
5958
self.extreme_finder = extreme_finder
6059
self.grid_locator1 = grid_locator1
6160
self.grid_locator2 = grid_locator2
6261
self.tick_formatter1 = tick_formatter1
6362
self.tick_formatter2 = tick_formatter2
6463

65-
def get_grid_info(self,
66-
x1, y1, x2, y2):
64+
def get_grid_info(self, x1, y1, x2, y2):
6765
"""
6866
lon_values, lat_values : list of grid values. if integer is given,
6967
rough number of grids in each direction.
@@ -75,10 +73,8 @@ def get_grid_info(self,
7573
# i.e., gridline of lon=0 will be drawn from lat_min to lat_max.
7674

7775
lon_min, lon_max, lat_min, lat_max = extremes
78-
lon_levs, lon_n, lon_factor = \
79-
self.grid_locator1(lon_min, lon_max)
80-
lat_levs, lat_n, lat_factor = \
81-
self.grid_locator2(lat_min, lat_max)
76+
lon_levs, lon_n, lon_factor = self.grid_locator1(lon_min, lon_max)
77+
lat_levs, lat_n, lat_factor = self.grid_locator2(lat_min, lat_max)
8278

8379
if lon_factor is None:
8480
lon_values = np.asarray(lon_levs[:lon_n])
@@ -98,32 +94,27 @@ def get_grid_info(self,
9894
ddy = (y2-y1)*1.e-10
9995
bb = Bbox.from_extents(x1-ddx, y1-ddy, x2+ddx, y2+ddy)
10096

101-
grid_info = {}
102-
grid_info["extremes"] = extremes
103-
grid_info["lon_lines"] = lon_lines
104-
grid_info["lat_lines"] = lat_lines
105-
106-
grid_info["lon"] = self._clip_grid_lines_and_find_ticks(lon_lines,
107-
lon_values,
108-
lon_levs,
109-
bb)
110-
111-
grid_info["lat"] = self._clip_grid_lines_and_find_ticks(lat_lines,
112-
lat_values,
113-
lat_levs,
114-
bb)
97+
grid_info = {
98+
"extremes": extremes,
99+
"lon_lines": lon_lines,
100+
"lat_lines": lat_lines,
101+
"lon": self._clip_grid_lines_and_find_ticks(
102+
lon_lines, lon_values, lon_levs, bb),
103+
"lat": self._clip_grid_lines_and_find_ticks(
104+
lat_lines, lat_values, lat_levs, bb),
105+
}
115106

116-
tck_labels = grid_info["lon"]["tick_labels"] = dict()
107+
tck_labels = grid_info["lon"]["tick_labels"] = {}
117108
for direction in ["left", "bottom", "right", "top"]:
118109
levs = grid_info["lon"]["tick_levels"][direction]
119-
tck_labels[direction] = self.tick_formatter1(direction,
120-
lon_factor, levs)
110+
tck_labels[direction] = self.tick_formatter1(
111+
direction, lon_factor, levs)
121112

122-
tck_labels = grid_info["lat"]["tick_labels"] = dict()
113+
tck_labels = grid_info["lat"]["tick_labels"] = {}
123114
for direction in ["left", "bottom", "right", "top"]:
124115
levs = grid_info["lat"]["tick_levels"][direction]
125-
tck_labels[direction] = self.tick_formatter2(direction,
126-
lat_factor, levs)
116+
tck_labels[direction] = self.tick_formatter2(
117+
direction, lat_factor, levs)
127118

128119
return grid_info
129120

0 commit comments

Comments
 (0)