Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test plot_conversion as well #3

Merged
merged 1 commit into from
Dec 24, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ autograd==1.2
lifelines==0.11.2
matplotlib>=2.0.0
numpy
pytz
scipy
seaborn==0.8.1
six==1.11.0
5 changes: 3 additions & 2 deletions test_convoys.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import datetime
import matplotlib
import numpy
import pytz
import random
import scipy.stats
matplotlib.use('Agg') # Needed for matplotlib to run in Travis
Expand Down Expand Up @@ -65,9 +66,9 @@ def test_bootstrapped_exponential_model(c=0.05, lambd=0.1, n=10000):

def test_plot_cohorts(c=0.05, k=10, lambd=0.1, n=1000):
data = []
now = datetime.datetime(2001, 7, 1)
now = datetime.datetime(2001, 7, 1, tzinfo=pytz.utc)
for x in range(n):
date_a = datetime.datetime(2000, 1, 1) + datetime.timedelta(days=random.random()*100)
date_a = datetime.datetime(2000, 1, 1, tzinfo=pytz.utc) + datetime.timedelta(days=random.random()*100)
if random.random() < c:
delay = scipy.stats.gamma.rvs(a=k, scale=1.0/lambd)
date_b = date_a + datetime.timedelta(days=delay)
Expand Down