Skip to content

Commit

Permalink
Merge branch 'more-cleanup' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
cliffckerr committed Jun 4, 2018
2 parents c2b1de2 + 911ce31 commit 2a4208f
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions hptool/healthpackage.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@
Version:
"""

import hptool as hp
import numpy as np
import pylab as pl
import hptool as hp
import sciris.core as sc


class HealthPackage(object):
'''
Class to hold the results from the analysis.
Expand Down Expand Up @@ -43,7 +45,7 @@ def make_package(self, burdenset=None, interset=None):
nrows = origdata.nrows()

# Create new dataframe
df = sc.dataframe(cols=['active'], data=pl.ones(nrows))
df = sc.dataframe(cols=['active'], data=np.ones(nrows))
for col in ['shortname']+critical_cols: # Copy columns over
df[col] = origdata[col]

Expand Down Expand Up @@ -88,7 +90,7 @@ def plot_dalys(self):
DA_data = df['dalys_averted']
plot_data = list(DA_data[:max_entries-1])
plot_data.append(sum(DA_data[max_entries:]))
plot_data = pl.array(plot_data)/1e3
plot_data = np.array(plot_data)/1e3
plot_data = plot_data.round()
total_averted = (plot_data.sum()/1e3)
data_labels = ['%i'%datum for datum in plot_data]
Expand Down Expand Up @@ -121,7 +123,7 @@ def plot_cascade(self, vertical=True):
DA_labels = df['shortname'][inds]
npts = len(DA_data)
colors = sc.gridcolors(npts, limits=(0.25,0.75))
x = pl.arange(len(DA_data))
x = np.arange(len(DA_data))
pl.axes(ax_size)
for pt in range(npts):
loc = x[pt:]
Expand Down

0 comments on commit 2a4208f

Please sign in to comment.