Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GitHub visualization #15

Merged
merged 9 commits into from Aug 19, 2016
Merged

Conversation

ghoshbishakh
Copy link
Collaborator

No description provided.

@jchoude
Copy link
Collaborator

jchoude commented Aug 12, 2016

Hey @ghoshbishakh I'm going through this... Just to make sure, is it normal that the heroku version currently doesn't show anything in the graphs?



class GithubStatFetcher:
"""A GitHub statistics fetcher for github repositories
Copy link
Collaborator

Choose a reason for hiding this comment

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

github -> Github

@ghoshbishakh
Copy link
Collaborator Author

@jchoude looks like heroku does not fetch the data correctly when it wakes up. Can you try hard reloading the page now?

weeks : list
List of weeks of contributions. Example:
[
{'w': 1254009600, 'a': 5, 'c': 2, 'd': 9},
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm not really sure of the way this parameter needs to be sent. I guess this comes from the Github API? If so, please refr to that so the the user can go to the correct documentation.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes. That is why I have described it as a helper function. I am not sure how to describe these otherwise.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Just say that it parses the list format returned from the Github API. You might also want to make it "private" so that users know that it's not that useful to them.

@jchoude
Copy link
Collaborator

jchoude commented Aug 12, 2016

Yes it fetched correctly now.

weekly_contributions["changes"] = []
lines = 0
for changes in r1_json:
changeList = []
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same thing here for the "_" in the name.

@jchoude
Copy link
Collaborator

jchoude commented Aug 12, 2016

Seems all good from my point of view. Will wait until your fixes and answers.


cumulative_contributors = self.get_cumulative_contributors(r_json)
contributor_stats[
"cumulative_contributors"] = cumulative_contributors
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@jchoude here is the cumulative_contributors actually. Do you mean something different?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ok, I saw your reply, but it doesn't show up in github. Anyway, makes sense.

2016-08-15 9:16 GMT-04:00 Bishakh Ghosh notifications@github.com:

In github_visualization/github_stats.py
#15 (comment):

  •            contributor_dict["total_commits"] = contributor["total"]
    
  •            grand_total_commits += contributor["total"]
    
  •            total_additions, total_deletions = self.get_total_contributions(
    
  •                contributor["weeks"])
    
  •            contributor_dict["total_additions"] = total_additions
    
  •            contributor_dict["total_deletions"] = total_deletions
    
  •            contributor_dict["weekly_commits"] = contributor["weeks"]
    
  •            contributor_stats["contributors"].insert(0, contributor_dict)
    
  •        contributor_stats["total_commits"] = grand_total_commits
    
  •        cumulative_contributors = self.get_cumulative_contributors(r_json)
    
  •        contributor_stats[
    
  •            "cumulative_contributors"] = cumulative_contributors
    

@jchoude https://github.com/jchoude here is the cumulative_contributors
actually. Do you mean something different?


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/nipy/dipy_web/pull/15/files/544d752148f59db2105e126695f7f6f2b9c43455#r74759230,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ACDSeBtsdgnwCuSyDDw6Lxmy6v7ydHcCks5qgGaYgaJpZM4JeWOf
.

The API endpoint https://api.github.com/repos/nipy/dipy/stats/contributors returns the list of contributors and their weekly contributions. But sometimes in cases if a user has renamed or deleted his/her GitHub profile then it might return "author":null for an intermediate time period after which it is completely removed from the list.

This patch handles the exception by ignoring the "author":null entry and counting rest of the contributors

fixes dipy#21
@jchoude jchoude merged commit a94eb09 into dipy:master Aug 19, 2016
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.

None yet

2 participants