Skip to content

Instantly share code, notes, and snippets.

@arfon
Last active May 4, 2023 09:27
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save arfon/dfa38f0bbf89617160b350de8bc9f3c4 to your computer and use it in GitHub Desktop.
How to calculate how many people have reviewed for JOSS
### Find all the published reviewers
papers = Paper.visible
reviewers = []
papers.each { |p| reviewers << p.reviewers.each(&:downcase!) }
### Unique reviewers (922)
puts reviewers.flatten.uniq.count
### Find the highest reviewer counts
reviewer_counts = Hash.new(0)
reviewers.flatten.each do |reviewer_instance|
if reviewer_counts.has_key?(reviewer_instance)
reviewer_counts[reviewer_instance] += 1
else
reviewer_counts[reviewer_instance] = 1
end
end
sorted = reviewer_counts.sort_by { |_key,value| value }.reverse.to_h
reviewer_table = File.open("reviewers.md", 'w')
reviewer_table.puts "| Handle | Count |"
reviewer_table.puts "|---|---|"
sorted.take(50).to_h.each do |reviewer, count|
next if reviewer == "@arfon" || "@kevin-mattheus-moerman" || "@kyleniemeyer" || "@danielskatz"
reviewer_table.puts "| #{reviewer} | #{count} |"
end
reviewer_table.close
Handle Count
@luizirber 13
@amoeba 13
@nicoguaro 13
@haozeke 12
@mattpitkin 11
@sara-02 11
@rougier 10
@corybrunson 10
@chilipp 9
@djmitche 9
@ziotom78 9
@nhejazi 9
@fil 9
@brainstorm 8
@trallard 8
@jsgalan 8
@strengejacke 8
@acolum 8
@janfreyberg 8
@mkhorton 8
@chennachaos 8
@krother 7
@zhampel 7
@dvalters 7
@ejhigson 7
@benmarwick 7
@tacaswell 7
@kellieotto 7
@stuartcampbell 7
@gonsie 7
@ixjlyons 7
@soodoku 7
@ahwillia 7
@tomfaulkenberry 7
@vsoch 6
@iljah 6
@hugoledoux 6
@grlee77 6
@mnarayan 6
@jonathanreardon 6
@adi3 6
@sirsharpest 6
@kthyng 6
@nnadeau 6
@brunaw 6
@zingale 6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment