Skip to content

BMC revision#2

Open
seokjunS wants to merge 1 commit into
masterfrom
bmc_revision
Open

BMC revision#2
seokjunS wants to merge 1 commit into
masterfrom
bmc_revision

Conversation

@seokjunS

Copy link
Copy Markdown
Collaborator

No description provided.

if muniq != None:
sorted_list.append( muniq)

utils.my_logging("[Sorted_list]\n")

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utils.my_logging은 debug용도로 보여집니다. 필요 없는 부분이면 삭제 부탁드립니다.



if length >= 1:
if len(sorted_list[0]) == 0 :

@seokjunS seokjunS Jun 10, 2018

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

위에서 (184 ~ 189줄) sorted_list 의 각 element가 0일때 모두 제거하는 코드가 있었습니다.
그렇다면, 해당 if문이 실행될 일이 없을 것 같은데 왜 들어갔는지 알수있을까요?

next = sorted_list[1] if length >= 2 else ([None, None], False)

if curr[0][1] != next[0][1] and curr[1]:
utils.my_logging("\nCurr\n")

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

위에서 언급했듯이 my_logging 제거 부탁드립니다.

else :
t = 1
is_unique = 0
while t < len(sorted_list) :

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

len(sorted_list) 대신 length를 쓸 수 있을것 같습니다.

Comment thread src/utils/utils.py
fw.write("%s\n" % s)
print(s)

def my_logging(s):

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

불필요하면 삭제 부탁드립니다.

del sorted_list[s]
else :
s = s + 1

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

184 ~ 189 줄의 코드는 제가 이해하기로는

  1. sorted_list의 element를 iteration하면서
  2. element의 길이가 0이면 sorted_list에서 제거하는 코드입니다.

해당 코드는 위의 171 ~ 176줄의 코드와 합쳐질 수 있을거 같습니다.

  methods = {"W_C2T": 0, "C_C2T": 1, "W_G2A": 2, "C_G2A": 3}
  sorted_list = []
  for _, i in methods.iteritems():
    muniq = get_and_uniq( group[i], 1 ) # (value, is_uniq)
    if muniq != None and len(muniq) > 0:
      sorted_list.append( muniq)

손으로 짠 코드니 재확인 부탁드립니다.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant