@@ -143,18 +143,17 @@ def computeTimeMedians(factors, lastmonthcount = LAST_MONTHS):
143
143
144
144
return (medianFirstMonth , medianLastMonth , median )
145
145
146
- def readTimeParams (persons , factorFiles , friendFiles ):
146
+ def readTimeParams (persons , personFactorFiles , activityFactorFiles , friendFiles ):
147
147
148
148
postCounts = {}
149
149
groupCounts = {}
150
150
offset = 8
151
151
monthcount = 12 * 3 + 1
152
152
153
- for inputFactorFile in factorFiles :
153
+ for inputFactorFile in personFactorFiles :
154
154
with open (inputFactorFile , 'r' ) as f :
155
- personCount = int (f .readline ())
156
- for i in range (personCount ):
157
- line = f .readline ().split ("," )
155
+ for line in f .readlines ():
156
+ line = line .split ("," )
158
157
person = int (line [0 ])
159
158
localPostCounts = map (int ,line [offset :offset + monthcount ])
160
159
localGroupCounts = map (int , line [offset + monthcount :])
@@ -209,15 +208,15 @@ def readTimeParams(persons, factorFiles, friendFiles):
209
208
210
209
211
210
212
- def findTimeParams (input , factorFiles , friendFiles , startYear ):
211
+ def findTimeParams (input , personFactorFiles , activityFactorFiles , friendFiles , startYear ):
213
212
START_YEAR = startYear
214
213
fPostCount = {}
215
214
ffPostCount = {}
216
215
persons = []
217
216
for queryId in input :
218
217
persons += input [queryId ][0 ]
219
218
220
- (fPostCount , ffPostCount , ffGroupCount ) = readTimeParams (set (persons ),factorFiles , friendFiles )
219
+ (fPostCount , ffPostCount , ffGroupCount ) = readTimeParams (set (persons ),personFactorFiles , activityFactorFiles , friendFiles )
221
220
222
221
mapParam = {
223
222
"f" : fPostCount ,
0 commit comments