augur This is my second blog entry for working at CHAOSS under Augur. This week was mostly spent on fixing some issues that were popping up when trying to run my pipermail code and fixing an error that occurred when doing sentiment analysis on pull requests. So this week’s tasks with my mentor Sean is as follows.

Goals for the week:

  1. Fix issues occurring when trying to implement Pipermail.
  2. Finish uploading github pull requests for experimental github repositories.

Goals

Goal 1:

Pipermail

Now for this goal we seem to be encountering a problem whereby when you run PiperMail it seems that the mailing lists you want to download wasn’t being output to the correct file “mailing_list.csv”. So I added first line 8 this was so that the mailing lists I wanted to be downloaded would be outputted to the file. I would close the file and then reopen it (lines 8-9).

1
2
3
4
5
6
7
8
if (os.stat(path).st_size == 0):
   file.write("Link,mail_list\n")
   file.write("https://lists.opendaylight.org/pipermail/,\"aalldp-dev\"\n")
   file.write("https://lists.opendaylight.org/pipermail/,\"archetypes-dev\"\n")
   print("Please enter the mailing lists and the links for them please")
   print("Going to the default mailing lists")
   file.close()
   file = open(path,"r")

After I would iterate through the file to determine if anything was written to it (lines 2-6), after I would close the file (line 7).

1
2
3
4
5
6
7
count = 0
for line in file:
   print(line)
   count+=1
   if(count == 2):
       break
file.close()

Goal 2:

Github Pull Requests Sentiment Analysis

The next problem that was occurring was then when I was performing sentiment analysis on the pull requests it seemed that some of them would be of type “None”. The program would then crash when this happened because I would feed this into “SentiCR” (line 5). So I just set the message as “ “ (line 4) so that I could continue iterating through the other pull requests.

1
2
3
4
5
for i in messages:
       #print(i)
       if(i == None):
           i = " "
       score=sentiment_analyzer.get_sentiment_polarity(i)

Resources: My branch on augur

Files Used:

Python File - SentiCR

Jupyter Notebook - PiperMail 14

Jupyter Notebook - github_pull_requests_scores_senticr 2