|
[Rivet-svn] rivet: added pgfplots-based version of make-plotsRivet Mercurial rivet at projects.hepforge.orgFri Jun 15 00:15:01 BST 2018
details: https://rivet.hepforge.org/hg/rivet/rev/58ea5e2f90c1 branches: release-2-6-x changeset: 6329:58ea5e2f90c1 user: Christian Gutschow <chris.g at cern.ch> date: Fri Jun 15 00:09:51 2018 +0100 description: added pgfplots-based version of make-plots diffs (truncated from 2786 to 50 lines): --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/bin/make-pgfplots Fri Jun 15 00:09:51 2018 +0100 @@ -0,0 +1,2783 @@ +#! /usr/bin/env python + +"""\ +Usage: %prog [options] file.dat [file2.dat ...] + +TODO + * Optimise output for e.g. lots of same-height bins in a row + * Add a RatioFullRange directive to show the full range of error bars + MC envelope in the ratio + * Tidy LaTeX-writing code -- faster to compile one doc only, then split it? + * Handle boolean values flexibly (yes, no, true, false, etc. as well as 1, 0) +""" + +from __future__ import print_function + +## +## This program is copyright by Christian Gutschow <chris.g at cern.ch> and +## the Rivet team https://rivet.hepforge.org. It may be used +## for scientific and private purposes. Patches are welcome, but please don't +## redistribute changed versions yourself. +## + +## Check the Python version +import sys +if sys.version_info[:3] < (2,6,0): + print("make-plots requires Python version >= 2.6.0... exiting") + sys.exit(1) + +## Try to rename the process on Linux +try: + import ctypes + libc = ctypes.cdll.LoadLibrary('libc.so.6') + libc.prctl(15, 'make-plots', 0, 0, 0) +except Exception as e: + pass + + +import os, logging, re +import tempfile +import getopt +import string +import copy +from math import * + + +## Regex patterns +pat_begin_block = re.compile(r'^#+\s*BEGIN ([A-Z0-9_]+) ?(\S+)?') +pat_end_block = re.compile('^#+\s*END ([A-Z0-9_]+)')
More information about the Rivet-svn mailing list |