Skip to content

Commit ef70e39

Browse files
committed
Cleanup
1 parent cd07ddc commit ef70e39

File tree

1 file changed

+6
-32
lines changed

1 file changed

+6
-32
lines changed

paramgenerator/generateparamsbi.py

Lines changed: 6 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,21 @@
11
#!/usr/bin/env python2
22

3-
import sys
4-
import discoverparams
5-
import readfactors
6-
import random
7-
import json
8-
import os
9-
import codecs
103
import calendar
4+
import codecs
5+
import os
6+
import random
117
import time
12-
from datetime import date,datetime,timedelta
8+
from datetime import datetime,timedelta
9+
10+
import readfactors
1311
from timeparameters import *
14-
from calendar import timegm
1512

1613
START_DATE=datetime.strptime("2010-01-01", "%Y-%m-%d")
1714
END_DATE=datetime.strptime("2013-01-01", "%Y-%m-%d")
1815

1916
def format_date(date):
2017
return int(time.mktime(date.timetuple())*1000)
2118

22-
# class ParamsWriter:
23-
# def __init__(self, name, num_params):
24-
# self.files = []
25-
# for i in range(0, num_params):
26-
# self.files.append(codecs.open("params/"+name+"."+str(i+1)+".params", "w",encoding="utf-8"))
27-
28-
# def append(self, params):
29-
# for i, param in enumerate(params):
30-
# self.files[i].write(param+"\n")
3119

3220
class ParamsWriter:
3321
def __init__(self, outdir, number, param_names):
@@ -103,20 +91,6 @@ def prob_post_lengths():
10391
results = [20,40,113,97,240]
10492
return results
10593

106-
107-
# def post_three_month_params(sample, lower_bound, upper_bound):
108-
# results = []
109-
# for ix in range(0, len(sample)/12):
110-
# start_ix = ix*12
111-
# count_sum = 0
112-
# for offset, count in sample[start_ix:start_ix+12]:
113-
# count_sum += count
114-
# if count_sum > lower_bound and count_sum < upper_bound:
115-
# start_day = sample[start_ix][0]
116-
# end_day = sample[start_ix+12][0]
117-
# results.append([[start_day, end_day], count_sum])
118-
# return results
119-
12094
def key_params(sample, lower_bound, upper_bound):
12195
results = []
12296
for key, count in sample:

0 commit comments

Comments
 (0)