Adds a command-line-interface to plot results files
I think a common task we want to do is "okay, I've got this results file, I want to generate a corner plot". This adds a command line tool to enable this - here is an example usage
$ tupak_plot -r outdir/A_result.h5 outdir/B_result.h5 -f output_file.png -l "result A" "result B" -p mu sigma
This example overlays two results files on top of each other. But it can equally just be applied to a single result file as well. Here is the help message
09:56 ~: $ tupak_plot --help
usage: tupak_plot [-h] [-r RESULTS [RESULTS ...]] [-f FILENAME]
[-l LABELS [LABELS ...]] [-p PARAMETERS [PARAMETERS ...]]
Plot corner plots from results files
optional arguments:
-h, --help show this help message and exit
-r RESULTS [RESULTS ...], --results RESULTS [RESULTS ...]
List of results files to use.
-f FILENAME, --filename FILENAME
Output file name.
-l LABELS [LABELS ...], --labels LABELS [LABELS ...]
List of labels to use for each result.
-p PARAMETERS [PARAMETERS ...], --parameters PARAMETERS [PARAMETERS ...]
List of parameters.
This is obviously one of those things that is quite flexible, but isn't going to do everything that people want it to do. For that, one can still drop into python and do it there.
Any objections? Ideas? Is tupak_plot
to general?
I'll also add that this opens up the box for others to add other CLI tools (the backend is all there, you just need to write the script and modify setup.py
). Personally, I'd say we should keep this for quick and dirty things we want to do at the command line and not go down the road of "tupak on the command line", i.e., making priors and things on the command line. But, obviously people can do that if they want.
Merge request reports
Activity
added 1 commit
- d38231ac - Make explicit color calls when accessing matplotlib
added 1 commit
- 3de2d620 - Add check for test in plot_data to avoid generating plots in tests
added 1 commit
- bff6023d - Add check for test in plot_data to avoid generating plots in tests
I just tried this and got the following error:
Traceback (most recent call last): File "/home/colm.talbot/virtualenvironents/py-2.7/bin/tupak_plot", line 11, in <module> load_entry_point('tupak==0.2', 'console_scripts', 'tupak_plot')() File "/home/colm.talbot/virtualenvironents/py-2.7/lib/python2.7/site-packages/pkg_resources/__init__.py", line 480, in load_entry_point return get_distribution(dist).load_entry_point(group, name) File "/home/colm.talbot/virtualenvironents/py-2.7/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2690, in load_entry_point raise ImportError("Entry point %r not found" % ((group, name),)) ImportError: Entry point ('console_scripts', 'tupak_plot') not found
I'm working in a virtual environment at CIT.
added 44 commits
-
bff6023d...0c75a924 - 43 commits from branch
master
- 0fb36db2 - Merge branch 'master' into add-cli-plot
-
bff6023d...0c75a924 - 43 commits from branch
added 6 commits
-
3bba0404...0b6a3913 - 5 commits from branch
master
- 03d49dd5 - Merge branch 'master' into add-cli-plot
-
3bba0404...0b6a3913 - 5 commits from branch
added 1 commit
- 5b55f094 - Update source coverage to new setup.py style
added 1 commit
- c9077bd0 - Update source coverage to new setup.py style
added 14 commits
-
c9077bd0...64cdcbc9 - 13 commits from branch
master
- 65e0827d - Merge branch 'master' into add-cli-plot
-
c9077bd0...64cdcbc9 - 13 commits from branch
mentioned in commit 41de66b0