Mercurial > hg > numerics
changeset 104:889728b8d359
minor cleanup
author | Jeff Hammel <k0scist@gmail.com> |
---|---|
date | Sun, 15 Mar 2015 08:53:30 -0700 |
parents | 067aa27050a3 |
children | 32a849b8f1f0 |
files | numerics/bar.py |
diffstat | 1 files changed, 7 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/numerics/bar.py Sun Mar 15 08:28:42 2015 -0700 +++ b/numerics/bar.py Sun Mar 15 08:53:30 2015 -0700 @@ -12,9 +12,9 @@ import argparse import csv import os -import pandas as pd -import subprocess +#import pandas as pd import sys +from .read import CSVParser from bokeh.charts import Bar from bokeh.plotting import * from collections import OrderedDict @@ -30,14 +30,15 @@ bar.show() class BarChartParser(CSVParser): + """command line options parser for bar charts""" # TODO: upstream to PlotParser def __init__(self, **kwargs): kwargs.setdefault('formatter_class', argparse.RawTextHelpFormatter) kwargs.setdefault('description', __doc__) CSVParser.__init__(self, **kwargs) - parser.add_argument('-t', '--title', dest='title', - help="plot title") + self.add_argument('-t', '--title', dest='title', + help="plot title") def main(args=sys.argv[1:]): @@ -48,10 +49,10 @@ options = parser.parse_args(args) # parse file - data = pd.read_csv(options.input, header=None, names=options.columns, index_col=0) +# data = pd.read_csv(options.input, header=None, names=options.columns, index_col=0) # generate bar chart - bar_chart(data, options.output, title=options.title or options.input.name) +# bar_chart(data, options.output, title=options.title or options.input.name) if __name__ == '__main__': main()