Skip to content

Upstr update skorn/mva-trainer!45, adding sanitized variables for conversion and filenames.

Chris Scheulen requested to merge upstr_update into master

Previously, vectorized variables would be saved in the hdf5-files as arrays and therefore be of type object. This creates problems with some internal numpy functions and is inefficient for storage purposes.

With the inclusion of a new method in HelperModules.py named sanitize_root, vectorized variables are now detected and converted into 2-tuples of (variablename, fill_value) in accordance with http://scikit-hep.org/root_numpy/reference/generated/root_numpy.root2array.html.

The method allows usage of vectorized variables in expressions, although using multiple vectorized variables in the same expression has not been tested and is therefore NOT recommended. The checks currently work via detection of a pattern [n] somewhere in the config expression, where n has to fulfill str.isdigit().

Special characters in variable names are now also filtered in scripts/HelperModules/Histograms.py by the method filter_VarPathName to allow for usage in filenames.

Some small bug fixes and improvements are included as well. A section on framework usage on lxplus is added to the README.md.

Edited by Chris Scheulen

Merge request reports