|
[Rivet-svn] rivet: 10 new changesetsRivet Mercurial rivet at projects.hepforge.orgWed Jul 6 21:45:01 BST 2016
details: https://rivet.hepforge.org/hg/rivet/rev/8a5af4b20406 branches: changeset: 5294:8a5af4b20406 user: Andy Buckley <andy at insectnation.org> date: Wed Jul 06 11:29:41 2016 +0100 description: Clarify histo interval default behaviour and non-experimental status details: https://rivet.hepforge.org/hg/rivet/rev/b04fb33a0669 branches: changeset: 5295:b04fb33a0669 user: Andy Buckley <andy at insectnation.org> date: Wed Jul 06 11:30:37 2016 +0100 description: Change default histo interval from 10000 to 1000 details: https://rivet.hepforge.org/hg/rivet/rev/347fc0e40591 branches: changeset: 5296:347fc0e40591 user: Andy Buckley <andy at insectnation.org> date: Wed Jul 06 15:14:13 2016 +0100 description: Introduce a BinData type to help with cleaning up NaN handling in make-plots details: https://rivet.hepforge.org/hg/rivet/rev/2b7dc725364d branches: changeset: 5297:2b7dc725364d user: Andy Buckley <andy at insectnation.org> date: Wed Jul 06 15:33:13 2016 +0100 description: Tidy bin data accessors to avoid dict keys details: https://rivet.hepforge.org/hg/rivet/rev/9d85a6455529 branches: changeset: 5298:9d85a6455529 user: Andy Buckley <andy at insectnation.org> date: Wed Jul 06 16:06:41 2016 +0100 description: Progressing and bugfixing with make-plots tidying and NaN-tolerance details: https://rivet.hepforge.org/hg/rivet/rev/0100ea6bb608 branches: changeset: 5299:0100ea6bb608 user: Andy Buckley <andy at insectnation.org> date: Wed Jul 06 16:20:14 2016 +0100 description: Progressing and bugfixing with make-plots tidying and NaN-tolerance details: https://rivet.hepforge.org/hg/rivet/rev/655ebaaa2f2b branches: changeset: 5300:655ebaaa2f2b user: Andy Buckley <andy at insectnation.org> date: Wed Jul 06 16:21:13 2016 +0100 description: Progressing and bugfixing with make-plots tidying and NaN-tolerance details: https://rivet.hepforge.org/hg/rivet/rev/dd4d8e25f214 branches: changeset: 5301:dd4d8e25f214 user: Andy Buckley <andy at insectnation.org> date: Wed Jul 06 20:35:27 2016 +0100 description: Fix tweaked make-plots floatify() function details: https://rivet.hepforge.org/hg/rivet/rev/1d06efa74c21 branches: changeset: 5302:1d06efa74c21 user: Andy Buckley <andy at insectnation.org> date: Wed Jul 06 20:45:07 2016 +0100 description: Avoid shadowing Python builtins, and other Pythonic tidying details: https://rivet.hepforge.org/hg/rivet/rev/2fd1b6bf4a03 branches: changeset: 5303:2fd1b6bf4a03 user: Andy Buckley <andy at insectnation.org> date: Wed Jul 06 21:30:48 2016 +0100 description: Profile y-ranges protected against nan entries diffs (truncated from 1163 to 50 lines): --- a/bin/make-plots Fri Jul 01 14:05:41 2016 +0100 +++ b/bin/make-plots Wed Jul 06 21:30:48 2016 +0100 @@ -55,6 +55,25 @@ return True return 2.0*abs(a-b)/abs(a+b) < tolerance +def inrange(x, a, b): + return x >= a and x < b + +def floatify(x): + if type(x) is str: + x = x.split() + if not hasattr(x, "__len__"): + x = [x] + x = [float(a) for a in x] + return x[0] if len(x) == 1 else x + +def floatpair(x): + if type(x) is str: + x = x.split() + if hasattr(x, "__len__"): + assert len(x) == 2 + return [float(a) for a in x] + return [float(x), float(x)] + def is_end_marker(line, blockname): m = pat_end_block.match(line) @@ -65,7 +84,47 @@ -class InputData(object): +class Described(object): + "Inherited functionality for objects holding a 'description' dictionary" + + def __init__(self): + pass + + def has_attr(self, key): + return self.description.has_key(key) + + def set_attr(self, key, val): + self.description[key] = val + + def attr(self, key, default=None): + return self.description.get(key, default) + + def attr_bool(self, key, default=None): + x = self.attr(key, default)
More information about the Rivet-svn mailing list |