Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitbb050f3

Browse files
committed
Update for Clean Code
Update for Clean Code- convert duplicated conditions to one line- remove unnecessary variable in loop
1 parent3420d9e commitbb050f3

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

‎python/visualizationCommand.py‎

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,10 @@ def _vp_seaborn_show_values(axs, precision=1, space=0.01):
77
pstr='{:.'+str(precision)+'f}'
88

99
def_single(ax):
10-
# check orient
10+
# check orient / if 0
1111
orient='v'
12-
iflen(ax.patches)==1:
13-
# check if 0
14-
ifax.patches[0].get_x()==0:
15-
orient='h'
12+
iflen(ax.patches)==1andax.patches[0].get_x()==0:
13+
orient='h'
1614
else:
1715
# compare 0, 1 patches
1816
p0=ax.patches[0]
@@ -36,7 +34,7 @@ def _single(ax):
3634
ax.text(_x,_y,value,ha='left')
3735

3836
ifisinstance(axs,_vp_np.ndarray):
39-
foridx,axin_vp_np.ndenumerate(axs):
37+
for_,axin_vp_np.ndenumerate(axs):
4038
_single(ax)
4139
else:
4240
_single(axs)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp