Skip to content

Commit 382bfa7

Browse files
committed
Min code improvements
1 parent 0d0906d commit 382bfa7

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

MLStructFP/db/image/_rect_binary.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,9 @@ def _get_floor_plot(self, floor: 'Floor', rect: Optional['Rect'], store: bool) -
9191
if floor_id in self._plot.keys():
9292
return self._plot[floor_id]
9393

94-
fig: 'Figure'
95-
ax: 'plt.Axes'
96-
fig = plt.figure(frameon=False) # Don't configure dpi
94+
fig: 'Figure' = plt.figure(frameon=False) # Don't configure dpi
9795
plt.style.use('default') # Don't modify this either
98-
ax = fig.add_axes([0, 0, 1, 1])
96+
ax: 'plt.Axes' = fig.add_axes([0, 0, 1, 1])
9997
ax.axis('off')
10098
ax.set_aspect(aspect='equal')
10199
ax.grid(False) # Don't enable as this may destroy the figures
@@ -178,7 +176,7 @@ def make_region(self, xmin: NumberType, xmax: NumberType, ymin: NumberType, ymax
178176
plt.figure(fig.number)
179177

180178
# Save the figure
181-
figname = f'{rect.id}' if rect else f'{floor.id}-x-{xmin:.2f}-{xmax:.2f}-y-{ymin:.2f}-{ymax:.2f}'
179+
figname: str = f'{rect.id}' if rect else f'{floor.id}-x-{xmin:.2f}-{xmax:.2f}-y-{ymin:.2f}-{ymax:.2f}'
182180

183181
ax.set_xlim(min(xmin, xmax), max(xmin, xmax))
184182
ax.set_ylim(min(ymin, ymax), max(ymin, ymax))

0 commit comments

Comments
 (0)