tdi/pyPEPA — pull request #8 by allanderek (2013-07-17 10:58:54+00:00)
Title: pretty print tidying

Dear Dariusz,

This is just a small refactoring of the pretty printing code in pypepa/utils.py.
Previously all of the pretty print methods essentially wrote the pretty-printing twice, once for the console and once for an output .csv file. This just refactors that out so that we are only writing the pretty print code once.

A small other comment. In pypepa/cli/cli.py we have lines to set the output file based on the kind of results we are computing and the pepa file name. This means that --output is ignored, which is probably a little surprising for most users. Additionally the whole pepa file name is used which means we end up with names like "simple.pepa-steady.csv" where probably it would be nicer just to use the basename part. Arguably then, the following line for steady-state:

args.output = "{}-steady.csv".format(pm.name)

could be changed to be:

name = args.output if args.output else os.pathname.splitext(pm.name)[0]
args.output = "{}-steady.csv".format(name)

And of course similarly for the utilisations and throughput. Thoughts?

kind regards,
allan