-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdata.py
More file actions
33 lines (24 loc) · 758 Bytes
/
data.py
File metadata and controls
33 lines (24 loc) · 758 Bytes
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
class PatchStrategy:
def __init__(self, name):
self.name = name
self.tp = 0
self.fp = 0
self.tn = 0
self.fn = 0
self.wrongLocation = 0
self.commitPatches = 0
self.commitSuccess = 0
self.file = 0
self.fileSuccess = 0
self.line = 0
self.lineSuccess = 0
def getNumCommitFailures(self):
return self.commitPatches - self.commitSuccess
def getNumFilePatchFailures(self):
return self.file - self.fileSuccess
def getNumLinePatchFailures(self):
return self.line - self.lineSuccess
class Experiment:
def __init__(self):
self.normal = PatchStrategy("normal")
self.filtered = PatchStrategy("filtered")