-
Notifications
You must be signed in to change notification settings - Fork 1
/
classes.py
71 lines (56 loc) · 2.59 KB
/
classes.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
class Bibliography:
filenamebase = None
authorList = dict() # for number of papers for each author
authorNetwork = dict() # for number of links between pairs of authors
paperList = dict()
paperNetwork = dict()
ignoredEntriesCount = 0 # entries in bib_database that did not have "author"-field
totalEntriesCount = 0
graphOfPapers = None
class Report:
bibfilename = None
totalPubs = None
ignoredPubs = None
nrAuthors = None
maxCC = ""
maxCCsize = None
maxCCsizePerTotal = None
authorsOfMaxCC = ""
secondCCsize = None
secondCCsizePerTotal = None
numberUnconnectedPapers = None
unconnectedPapersPerTotal = None
histogramOutfilename = None
raw = """# Report for {bibfilename}
Your database was read and has the following general characteristics:
* total publications: {totalPubs}
* ignored entries: {ignoredPubs}
* number of authors: {nrAuthors}
## Paper network analysis
The paper network is built by connecting papers that share
authors. If *paper A* shares an author with *paper B* and
*paper B* shares an author with *paper C*, then *A*,*B* and *C* are
in a connected component. **These components might show
communities of researchers.**
* The largest connected component has {maxCCsize} papers which is {maxCCsizePerTotal:.0%} of all papers.
- the papers are:
{maxCC}
- the authors are:
{authorsOfMaxCC}
* the second largest group contains {secondCCsize} ({secondCCsizePerTotal:.0%}) papers.
* {numberUnconnectedPapers} papers ({unconnectedPapersPerTotal:.0%}) of your research don't share authors with any other paper.
![Publications per year (total and of largest component)]({histogramOutfilename})"""
def text(self):
return self.raw.format(bibfilename = self.bibfilename,
totalPubs = self.totalPubs,
ignoredPubs = self.ignoredPubs,
nrAuthors = self.nrAuthors,
maxCCsize = self.maxCCsize,
maxCCsizePerTotal = self.maxCCsizePerTotal,
maxCC = self.maxCC,
authorsOfMaxCC = self.authorsOfMaxCC,
secondCCsize = self.secondCCsize,
secondCCsizePerTotal = self.secondCCsizePerTotal,
numberUnconnectedPapers = self.numberUnconnectedPapers,
unconnectedPapersPerTotal = self.unconnectedPapersPerTotal,
histogramOutfilename = self.histogramOutfilename)