YODA Python-interface documentation!

This is the documentation for the Python interface to the YODA data analysis package. It’s rather bare-bones at the moment, and based largely on the docstrings embedded in the Python code. So the documentation you see here is the same as the documentation you can get by calling pydoc or by using the help() function in the Python interpreter, e.g.:

$ python
>>> import yoda
>>> help(yoda.read)
>>> help(yoda.Histo1D)

As time goes by we’ll fill this documentation out with more examples etc. – at least that’s the plan. Feel free to hassle the authors at yoda@projects.hepforge.org if we don’t do it, or if you find things we can improve either in the documentation or the package itself.

Scripts

TODO: the set of yoda* scripts needs to be documented here. For now, you can find out how to use them by calling e.g. yodafoo –help. Here is the current list of scripts that you can try:

yoda-config
yodals
yodacnv
yodadiff
yodamerge
yodascale
yodastack
yoda2yoda
yoda2root
root2yoda
(yodaplot)

Code docs

Basic usage

  • Booking and filling a histogram called ‘/foo’ with 20 bins between 0 and 1:

    import yoda, random
    h = yoda.Histo1D(20, 0.0, 1.0, "/foo")
    print (h)
    => <BinnedHisto1D[d] '/foo' 20 bins>
    for _ in range(1000):
        h.fill(random.uniform(-0.5, 1.5))
    print (h.xMean())
    => 0.5217243567375633
    
  • Extracting histogram statistical properties:

    ## Binned range extent:
    print (h.xMin(), h.xMax())
    => 0.0 1.0
    
    ## Sum-of-weights / integral for whole-range and binned-range only:
    print (h.sumW(), h.sumW(False))
    => 1000.0 525.0
    
    ## All-range and binned-range whole-histo stats:
    print (h.xMean(), h.xStdDev(), h.xVariance())
    => 0.5217243567375633 0.5590492850512596 0.31253610311632457
    print (h.xMean(False), h.xStdDev(False), h.xVariance(False))
    => 0.5200949573114909 0.2895440742052287 0.083835770907363
    
  • Extracting bin properties:

    ## Looping over bins:
    for b in h.bins():
        print (b)
    => <Dbn1D(mean=0, stddev=0.05)>
    => <Dbn1D(mean=0.05, stddev=0.1)>
    => <Dbn1D(mean=0.1, stddev=0.15)>
    => ...
    
    ## Extract
    for b in h.bins():
        print (b.xMin(), b.xMid(), b.xMax(), b.xFocus(), b.sumW2(), b.xMean(), b.xStdDev())
    => 0.0 0.025 0.05 0.0277156583946 19.0 0.0277156583946 0.0156189244522
    => 0.05 0.075 0.1 0.077004858171 22.0 0.077004858171 0.0160044669375
    => 0.1 0.125 0.15 0.124272408837 32.0 0.124272408837 0.01703599909
    => ...
    
  • Saving to file, and reading back:

    ## Saving
    yoda.write(h, "foo.yoda") #< can pass any iterable of histos or other analysis objects
    
    ## Reading to a dict, indexed by histo paths
    aos = yoda.read("foo.yoda")
    print (aos)
    => {'/foo': <Histo1D '/foo' 20 bins, sumw=1e+03, xmean=4.84e-01>}
    
    ## Reading to a list
    aos = yoda.read("foo.yoda", asdict=False)
    print (aos)
    => [<Histo1D '/foo' 20 bins, sumw=1e+03, xmean=4.84e-01>]
    print (aos[0].path())
    => /foo
    
  • Converting to a Scatter, and looping over points:

    s = h.mkScatter()  # <- you may also read scatters from file, e.g. reference data
    print (s)
    => <Scatter2D '/foo' 20 points>
    
    for p in s.points():
        print (p.x(), p.y(), p.xErrs(), p.yErrAvg(), p.errAvg(2))
    => 0.025 380.0 (0.025, 0.025) 87.1779788708
    => 0.075 440.0 (0.02500000000000001, 0.024999999999999994) 93.8083151965
    => ...
    
  • Analysis object metadata:

    print (s.annotations())
    => ['Path', 'Title', 'Type']
    s.setAnnotation("Foo", "My own private Patrick Swayze")
    print (s.annotations())
    => ['Foo', 'Path', 'Title', 'Type']
    print (s.annotation("Foo"))
    => 'My own private Patrick Swayze'
    

Tips and tricks

  • Filtering analysis objects by path:

    aos = yoda.read("mydata.yoda")
    hs = [h for h in aos.values() if "foo" in h.path()]
    

    or, if you have YODA version >= 1.3.2, you can do regex filtering inline during analysis object reading from file:

    aos = yoda.read("mydata.yoda", patterns=".*foo.*")
    
  • Summing histograms:

    import operator
    hsum = reduce(operator.add, hs)
    

Bin/point path searching

The yoda.search subpackage provides tools for finding histogram bins and scatter points based on their parent objects’ paths, and on the bin/point index or the physical location of bin edges.

class yoda.search.PointMatcher(patt)[source]

System for selecting subsets of bins based on a search range syntax extended from Professor weight files:

Path structures:
  • /path/parts/to/histo[syst_variation]@xmin:xmax

  • /path/parts/to/histo[syst_variation]#nmin:nmax

TODO: Extend to multi-dimensional ranges i.e. @xmin:xmax,#nymin:nymax,…

match_pos(p)[source]

Decide if a given point p is in the match range.

p must be an object with attrs xmin, xmax, n

TODO: Use open ranges to include underflow and overflow

TODO: Allow negative indices in Python style, and use index=-1 to mean the N+1 index needed to include the last bin without picking up the overflow, too.

TODO: Extension to multiple dimensions

set_patt(patt)[source]

Find path and index/pos parts of patt and assign them to object attrs

yoda.search.match_aos(aos, patts, unpatts=None, search=False)[source]

Filter a list of analysis objects to those which match given path-matching patterns.

@a patts is a regex or iterable of regexes for positive matching, i.e. retention; @a unpatts is the equivalent for negative matching, i.e. rejection even if a patt matches.

@a search will use Python regex search mode rather than match mode, i.e. match if any part of the path fits the regex, rather than requiring a match from the start of the path.

Histogram plotting

The yoda.plotting module provides in-development tools for conveniently comparing and plotting YODA objects using matplotlib.

Miscellaneous

Other functionality in the yoda package…

yoda.script_helpers.filter_aos(aos, match_re=None, unmatch_re=None)[source]

Remove unwanted analysis objects from a dict (modifies arg, also returned)

yoda.script_helpers.parse_x2y_args(args, xextns, yextns)[source]

Helper function for working out input and output filenames for YODA converter scripts, where the output name is generated by replacing the input file extension (xextn) with the output one (yextn), if there are exactly two arguments and the second arg is consistent with an output name. The x/yextn arguments should include the leading dot.

Main YODA objects

The wrappers on the core C++ YODA data types and functions are all defined in the yoda.core module, which is generated semi-automatically by the Cython system. However, they are all available directly in the yoda namespace by virtue of a from yoda.core import * in the yoda package.

yoda.core.AO

alias of AnalysisObject

class yoda.core.AnalysisObject

AnalysisObject is the base class of the main user-facing objects, such as the Histo, Profile and Scatter classes.

annotation(self, k, default=None)

Get annotation k from this object (falling back to default if not set).

The annotation string will be automatically converted to Python native types as far as possible – more complex types are possible via the ast and yaml modules.

annotations(self)

() -> list[str] A list of all annotation/metadata keys.

annotationsDict(self)

() -> dict[str->str] A dict of all annotations/metadata entries.

axisConfig(self)
clearAnnotations(self)

Clear the annotations dictionary.

dim(self)

Fill dimension or plot dimension of this object, for fillables and scatters respectively

hasAnnotation(self, k)

Check if this object has annotation k.

name(self)

Return the histogram name, i.e. the last part of the path (which may be empty).

path(self)

Used for persistence and as a unique identifier. Must begin with a ‘/’ if not the empty string.

rmAnnotation(self, k)

Remove annotation k from this object.

setAnnotation(self, k, v)

Set annotation k on this object.

setPath(self, path)

Used for persistence and as a unique identifier. Must begin with a ‘/’ if not the empty string.

setTitle(self, title)

Set the histogram title (optional)

title(self)

Histogram title

type(self)

String identifier for this type

class yoda.core.Axis(*args, **kwargs)

A discrete or continuous axis, depending on the edge type.

axisT

axisT: str

edge(self, index)
index(self, edge)
max(self, index)
mid(self, index)
min(self, index)
numBins(self, includeOverflows=False)
type(self)
width(self, index)
class yoda.core.BinnedEstimate1D(*args, **kwargs)

BinnedEstimate1D, i.e. a collection of Estimate objects.

Constructor calling idioms:

BinnedEstimate1D[AxisT](path=””, title=””)

Create a new empty BinnedEstimate1D, with optional path and title.

BinnedEstimate1D[AxisT](edges, path=””, title=””):

Create a new empty BinnedEstimate1D from an iterable of bin edges, with optional path and title.

TODO: more documentation!

areaUnderCurve(self, includeBinVol=True, includeOverflows=False, includeMaskedBins=False)
auc(self, includeBinVol=True, includeOverflows=False, includeMaskedBins=False)
bin(self, *indices)

Access the i’th bin.

binAt(self, x)

Access the coords.

binDim(self)

Return binning dimension.

bins(self, includeOverflows=False, includeMaskedBins=False)

Access the list of bins.

clone(self)

() -> BinnedEstimate1D. Clone this BinnedEstimate1D.

covarianceMatrix(self, ignoreOffDiagonalTerms=False, includeOverflows=False, includeMaskedBins=False, pat_uncorr='^stat|^uncor')
deserializeContent(self, data)

Data deserialisation for MPI communication.

deserializeMeta(self, data, resetPath=False, resetTitle=False)

Meta-data deserialisation for MPI communication.

divideBy(self, BinnedEstimate1D other, efficiency=False)

BinnedEstimate1D -> BinnedEstimate1D

Divide this BinnedEstimate1D by other, returning a BinnedEstimate1D.

indexAt(self, x)
isMasked(self, index)

Check if bin with index is masked.

isVisible(self, index)

Check if bin with index is visible.

lengthContent(self, fixed_length=False)

Length of serialisation data vector for MPI communication.

lengthMeta(self, skipPath=True, skipTitle=True)

Length of serialisation meta-data vector for MPI communication.

localToGlobalIndex(self, *indices)

Convert local indices to internal global index.

maskBin(self, idx, status=True)

Mask/Unmask bin the i’th bin.

maskBinAt(self, x, status=True)

Mask/Unmask bin at the set of coords.

maskBins(self, index_list, status=True)

Mask/Unmask serval bins..

maskSlice(self, dim, idx, status=True)

Mask/Unmask a slice at idx along axis dim.

maskedBins(self)
mkScatter(self, path='', pat_match='', includeOverflows=False, includeMaskedBins=False)

None -> Scatter2D.

Make a new Scatter2D.

numBins(self, includeOverflows=False, includeMaskedBins=False)

() -> int Number of bins in this BinnedEstimate.

numBinsX(self, includeOverflows=False)

numBinsX on x axis.

rebinX(self, arg, *args, **kwargs)
rebinXBy(self, n, begin=1, end=sys.maxsize)

rebinXBy on x axis.

rebinXTo(self, edges)

rebinXTo on x axis.

reset(self)

Reset the scatter, removing all points

scale(self, factor)
serializeContent(self, fixed_length=False)

Data serialisation for MPI communication.

serializeMeta(self, skipPath=True, skipTitle=True)

Meta-data serialisation for MPI communication.

set(self, *args)

Set bin with Estimate.

sources(self)
vals(self)
xEdges(self, includeOverflows=False)

xEdges on x axis.

xMax(self)

xMax on x axis.

xMin(self)

xMin on x axis.

xWidths(self, includeOverflows=True)

xWidths on x axis.

class yoda.core.BinnedEstimate2D(*args, **kwargs)

BinnedEstimate2D, i.e. a collection of Estimate objects.

Constructor calling idioms:

BinnedEstimate2D[AxisT1,AxisT2](path=””, title=””)

Create a new empty BinnedEstimate2D, with optional path and title.

BinnedEstimate2D[AxisT1,AxisT2](edges, path=””, title=””):

Create a new empty BinnedEstimate2D from an iterable of bin edges, with optional path and title.

TODO: more documentation!

areaUnderCurve(self, includeBinVol=True, includeOverflows=False, includeMaskedBins=False)
auc(self, includeBinVol=True, includeOverflows=False, includeMaskedBins=False)
bin(self, *indices)

Access the i’th bin.

binAt(self, x, y)

Access the coords.

binDim(self)

Return binning dimension.

bins(self, includeOverflows=False, includeMaskedBins=False)

Access the list of bins.

clone(self)

() -> BinnedEstimate2D. Clone this BinnedEstimate2D.

covarianceMatrix(self, ignoreOffDiagonalTerms=False, includeOverflows=False, includeMaskedBins=False, pat_uncorr='^stat|^uncor')
deserializeContent(self, data)

Data deserialisation for MPI communication.

deserializeMeta(self, data, resetPath=False, resetTitle=False)

Meta-data deserialisation for MPI communication.

divideBy(self, BinnedEstimate2D other, efficiency=False)

BinnedEstimate2D -> BinnedEstimate2D

Divide this BinnedEstimate2D by other, returning a BinnedEstimate2D.

indexAt(self, x, y)
isMasked(self, index)

Check if bin with index is masked.

isVisible(self, index)

Check if bin with index is visible.

lengthContent(self, fixed_length=False)

Length of serialisation data vector for MPI communication.

lengthMeta(self, skipPath=True, skipTitle=True)

Length of serialisation meta-data vector for MPI communication.

localToGlobalIndex(self, *indices)

Convert local indices to internal global index.

maskBin(self, idx, status=True)

Mask/Unmask bin the i’th bin.

maskBinAt(self, x, y, status=True)

Mask/Unmask bin at the set of coords.

maskBins(self, index_list, status=True)

Mask/Unmask serval bins..

maskSlice(self, dim, idx, status=True)

Mask/Unmask a slice at idx along axis dim.

maskedBins(self)
mkScatter(self, path='', pat_match='', includeOverflows=False, includeMaskedBins=False)

None -> Scatter3D.

Make a new Scatter3D.

numBins(self, includeOverflows=False, includeMaskedBins=False)

() -> int Number of bins in this BinnedEstimate.

numBinsX(self, includeOverflows=False)

numBinsX on x axis.

numBinsY(self, includeOverflows=False)

numBinsY on y axis.

rebinX(self, arg, *args, **kwargs)
rebinXBy(self, n, begin=1, end=sys.maxsize)

rebinXBy on x axis.

rebinXTo(self, edges)

rebinXTo on x axis.

rebinY(self, arg, *args, **kwargs)
rebinYBy(self, n, begin=1, end=sys.maxsize)

rebinYBy on y axis.

rebinYTo(self, edges)

rebinYTo on y axis.

reset(self)

Reset the scatter, removing all points

scale(self, factor)
serializeContent(self, fixed_length=False)

Data serialisation for MPI communication.

serializeMeta(self, skipPath=True, skipTitle=True)

Meta-data serialisation for MPI communication.

set(self, *args)

Set bin with Estimate.

sources(self)
vals(self)
xEdges(self, includeOverflows=False)

xEdges on x axis.

xMax(self)

xMax on x axis.

xMin(self)

xMin on x axis.

xWidths(self, includeOverflows=True)

xWidths on x axis.

yEdges(self, includeOverflows=False)

yEdges on y axis.

yMax(self)

yMax on y axis.

yMin(self)

yMin on y axis.

yWidths(self, includeOverflows=True)

yWidths on y axis.

class yoda.core.BinnedEstimate3D(*args, **kwargs)

BinnedEstimate3D, i.e. a collection of Estimate objects.

Constructor calling idioms:

BinnedEstimate3D[AxisT1,AxisT2,AxisT3](path=””, title=””)

Create a new empty BinnedEstimate3D, with optional path and title.

BinnedEstimate3D[AxisT1,AxisT2,AxisT3](edges, path=””, title=””):

Create a new empty BinnedEstimate3D from an iterable of bin edges, with optional path and title.

TODO: more documentation!

areaUnderCurve(self, includeBinVol=True, includeOverflows=False, includeMaskedBins=False)
auc(self, includeBinVol=True, includeOverflows=False, includeMaskedBins=False)
bin(self, *indices)

Access the i’th bin.

binAt(self, x, y, z)

Access the coords.

binDim(self)

Return binning dimension.

bins(self, includeOverflows=False, includeMaskedBins=False)

Access the list of bins.

clone(self)

() -> BinnedEstimate3D. Clone this BinnedEstimate3D.

covarianceMatrix(self, ignoreOffDiagonalTerms=False, includeOverflows=False, includeMaskedBins=False, pat_uncorr='^stat|^uncor')
deserializeContent(self, data)

Data deserialisation for MPI communication.

deserializeMeta(self, data, resetPath=False, resetTitle=False)

Meta-data deserialisation for MPI communication.

divideBy(self, BinnedEstimate3D other, efficiency=False)

BinnedEstimate3D -> BinnedEstimate3D

Divide this BinnedEstimate3D by other, returning a BinnedEstimate3D.

indexAt(self, x, y, z)
isMasked(self, index)

Check if bin with index is masked.

isVisible(self, index)

Check if bin with index is visible.

lengthContent(self, fixed_length=False)

Length of serialisation data vector for MPI communication.

lengthMeta(self, skipPath=True, skipTitle=True)

Length of serialisation meta-data vector for MPI communication.

localToGlobalIndex(self, *indices)

Convert local indices to internal global index.

maskBin(self, idx, status=True)

Mask/Unmask bin the i’th bin.

maskBinAt(self, x, y, z, status=True)

Mask/Unmask bin at the set of coords.

maskBins(self, index_list, status=True)

Mask/Unmask serval bins..

maskSlice(self, dim, idx, status=True)

Mask/Unmask a slice at idx along axis dim.

maskedBins(self)
mkScatter(self, path='', pat_match='', includeOverflows=False, includeMaskedBins=False)

None -> Scatter4D.

Make a new Scatter4D.

numBins(self, includeOverflows=False, includeMaskedBins=False)

() -> int Number of bins in this BinnedEstimate.

numBinsX(self, includeOverflows=False)

numBinsX on x axis.

numBinsY(self, includeOverflows=False)

numBinsY on y axis.

numBinsZ(self, includeOverflows=False)

numBinsZ on z axis.

rebinX(self, arg, *args, **kwargs)
rebinXBy(self, n, begin=1, end=sys.maxsize)

rebinXBy on x axis.

rebinXTo(self, edges)

rebinXTo on x axis.

rebinY(self, arg, *args, **kwargs)
rebinYBy(self, n, begin=1, end=sys.maxsize)

rebinYBy on y axis.

rebinYTo(self, edges)

rebinYTo on y axis.

rebinZ(self, arg, *args, **kwargs)
rebinZBy(self, n, begin=1, end=sys.maxsize)

rebinZBy on z axis.

rebinZTo(self, edges)

rebinZTo on z axis.

reset(self)

Reset the scatter, removing all points

scale(self, factor)
serializeContent(self, fixed_length=False)

Data serialisation for MPI communication.

serializeMeta(self, skipPath=True, skipTitle=True)

Meta-data serialisation for MPI communication.

set(self, *args)

Set bin with Estimate.

sources(self)
vals(self)
xEdges(self, includeOverflows=False)

xEdges on x axis.

xMax(self)

xMax on x axis.

xMin(self)

xMin on x axis.

xWidths(self, includeOverflows=True)

xWidths on x axis.

yEdges(self, includeOverflows=False)

yEdges on y axis.

yMax(self)

yMax on y axis.

yMin(self)

yMin on y axis.

yWidths(self, includeOverflows=True)

yWidths on y axis.

zEdges(self, includeOverflows=False)

zEdges on z axis.

zMax(self)

zMax on z axis.

zMin(self)

zMin on z axis.

zWidths(self, includeOverflows=True)

zWidths on z axis.

class yoda.core.BinnedHisto1D(*args, **kwargs)

BinnedHisto1D, i.e. a collection of Dbn1D objects.

Constructor calling idioms:

BinnedHisto1D[AxisT](path=””, title=””)

Create a new empty BinnedHisto1D, with optional path and title.

BinnedHisto1D[AxisT](edges, path=””, title=””):

Create a new empty BinnedHisto1D from an iterable of bin edges, with optional path and title.

TODO: more documentation!

bin(self, *indices)

Access the i’th bin.

binAt(self, x)

Access the coords.

binDim(self)

Return binning dimension.

bins(self, includeOverflows=False, includeMaskedBins=False)

Access the list of bins.

clone(self)

() -> BinnedHisto1D. Clone this BinnedHisto1D.

dVol(self, includeOverflows=True)
density(self, includeOverflows=True)
densityError(self, includeOverflows=True)
densitySum(self, includeOverflows=True)
deserializeContent(self, data)

Data deserialisation for MPI communication.

deserializeMeta(self, data, resetPath=False, resetTitle=False)

Meta-data deserialisation for MPI communication.

divideBy(self, BinnedHisto1D other, efficiency=False)

BinnedHisto1D -> BinnedEstimate1D

Divide this BinnedHisto1D by other, returning a BinnedEstimate1D.

effNumEntries(self, includeOverflows=True)
fill(self, x, weight=1.0, fraction=1.0)

([coords], float weight=1.0, float fraction=1.0) -> int

Fills the distribution with the given weight at given [coords].

fillDim(self)
indexAt(self, x)
integral(self, includeOverflows=True)
integralError(self, includeOverflows=True)
isMasked(self, index)

Check if bin with index is masked.

isVisible(self, index)

Check if bin with index is visible.

lengthContent(self, fixed_length=False)

Length of serialisation data vector for MPI communication.

lengthMeta(self, skipPath=True, skipTitle=True)

Length of serialisation meta-data vector for MPI communication.

localToGlobalIndex(self, *indices)

Convert local indices to internal global index.

maskBin(self, idx, status=True)

Mask/Unmask bin the i’th bin.

maskBinAt(self, x, status=True)

Mask/Unmask bin at the set of coords.

maskBins(self, index_list, status=True)

Mask/Unmask serval bins..

maskSlice(self, dim, idx, status=True)

Mask/Unmask a slice at idx along axis dim.

maskedBins(self)
maxDensity(self, includeOverflows=True)
mkEstimate(self, str path='', str source='', divbyvol=True)

None -> Estimate.

Convert this BinnedHisto1D to an BinnedEstimate1D.

mkScatter(self, path='', binwidthdiv=True, useFocus=False, includeOverflows=False, includeMaskedBins=False)

None -> Scatter2D.

Make a new Scatter2D.

normalize(self, normto=1.0, includeOverflows=True)
numBins(self, includeOverflows=False, includeMaskedBins=False)

() -> int Number of bins in this BinnedHisto.

numBinsX(self, includeOverflows=False)

numBinsX on x axis.

numEntries(self, includeOverflows=True)
rebinX(self, arg, *args, **kwargs)
rebinXBy(self, n, begin=1, end=sys.maxsize)

rebinXBy on x axis.

rebinXTo(self, edges)

rebinXTo on x axis.

reset(self)

Reset the scatter, removing all points

scaleW(self, factor)
serializeContent(self, fixed_length=False)

Data serialisation for MPI communication.

serializeMeta(self, skipPath=True, skipTitle=True)

Meta-data serialisation for MPI communication.

set(self, *args)

Set bin with Dbn1D.

sumW(self, includeOverflows=True)
sumW2(self, includeOverflows=True)
sumWA(self, dim, includeOverflows=True)
sumWA2(self, dim, includeOverflows=True)
xEdges(self, includeOverflows=False)

xEdges on x axis.

xMax(self)

xMax on x axis.

xMean(self, includeOverflows=True)

xMean on x axis.

xMin(self)

xMin on x axis.

xRMS(self, includeOverflows=True)

xRMS on x axis.

xStdDev(self, includeOverflows=True)

xStdDev on x axis.

xStdErr(self, includeOverflows=True)

xStdErr on x axis.

xVariance(self, includeOverflows=True)

xVariance on x axis.

xWidths(self, includeOverflows=True)

xWidths on x axis.

class yoda.core.BinnedHisto2D(*args, **kwargs)

BinnedHisto2D, i.e. a collection of Dbn2D objects.

Constructor calling idioms:

BinnedHisto2D[AxisT1,AxisT2](path=””, title=””)

Create a new empty BinnedHisto2D, with optional path and title.

BinnedHisto2D[AxisT1,AxisT2](edges, path=””, title=””):

Create a new empty BinnedHisto2D from an iterable of bin edges, with optional path and title.

TODO: more documentation!

bin(self, *indices)

Access the i’th bin.

binAt(self, x, y)

Access the coords.

binDim(self)

Return binning dimension.

bins(self, includeOverflows=False, includeMaskedBins=False)

Access the list of bins.

clone(self)

() -> BinnedHisto2D. Clone this BinnedHisto2D.

dVol(self, includeOverflows=True)
density(self, includeOverflows=True)
densityError(self, includeOverflows=True)
densitySum(self, includeOverflows=True)
deserializeContent(self, data)

Data deserialisation for MPI communication.

deserializeMeta(self, data, resetPath=False, resetTitle=False)

Meta-data deserialisation for MPI communication.

divideBy(self, BinnedHisto2D other, efficiency=False)

BinnedHisto2D -> BinnedEstimate2D

Divide this BinnedHisto2D by other, returning a BinnedEstimate2D.

effNumEntries(self, includeOverflows=True)
fill(self, x, y, weight=1.0, fraction=1.0)

([coords], float weight=1.0, float fraction=1.0) -> int

Fills the distribution with the given weight at given [coords].

fillDim(self)
indexAt(self, x, y)
integral(self, includeOverflows=True)
integralError(self, includeOverflows=True)
isMasked(self, index)

Check if bin with index is masked.

isVisible(self, index)

Check if bin with index is visible.

lengthContent(self, fixed_length=False)

Length of serialisation data vector for MPI communication.

lengthMeta(self, skipPath=True, skipTitle=True)

Length of serialisation meta-data vector for MPI communication.

localToGlobalIndex(self, *indices)

Convert local indices to internal global index.

maskBin(self, idx, status=True)

Mask/Unmask bin the i’th bin.

maskBinAt(self, x, y, status=True)

Mask/Unmask bin at the set of coords.

maskBins(self, index_list, status=True)

Mask/Unmask serval bins..

maskSlice(self, dim, idx, status=True)

Mask/Unmask a slice at idx along axis dim.

maskedBins(self)
maxDensity(self, includeOverflows=True)
mkEstimate(self, str path='', str source='', divbyvol=True)

None -> Estimate.

Convert this BinnedHisto2D to an BinnedEstimate2D.

mkScatter(self, path='', binwidthdiv=True, useFocus=False, includeOverflows=False, includeMaskedBins=False)

None -> Scatter3D.

Make a new Scatter3D.

normalize(self, normto=1.0, includeOverflows=True)
numBins(self, includeOverflows=False, includeMaskedBins=False)

() -> int Number of bins in this BinnedHisto.

numBinsX(self, includeOverflows=False)

numBinsX on x axis.

numBinsY(self, includeOverflows=False)

numBinsY on y axis.

numEntries(self, includeOverflows=True)
rebinX(self, arg, *args, **kwargs)
rebinXBy(self, n, begin=1, end=sys.maxsize)

rebinXBy on x axis.

rebinXTo(self, edges)

rebinXTo on x axis.

rebinY(self, arg, *args, **kwargs)
rebinYBy(self, n, begin=1, end=sys.maxsize)

rebinYBy on y axis.

rebinYTo(self, edges)

rebinYTo on y axis.

reset(self)

Reset the scatter, removing all points

scaleW(self, factor)
serializeContent(self, fixed_length=False)

Data serialisation for MPI communication.

serializeMeta(self, skipPath=True, skipTitle=True)

Meta-data serialisation for MPI communication.

set(self, *args)

Set bin with Dbn2D.

sumW(self, includeOverflows=True)
sumW2(self, includeOverflows=True)
sumWA(self, dim, includeOverflows=True)
sumWA2(self, dim, includeOverflows=True)
xEdges(self, includeOverflows=False)

xEdges on x axis.

xMax(self)

xMax on x axis.

xMean(self, includeOverflows=True)

xMean on x axis.

xMin(self)

xMin on x axis.

xRMS(self, includeOverflows=True)

xRMS on x axis.

xStdDev(self, includeOverflows=True)

xStdDev on x axis.

xStdErr(self, includeOverflows=True)

xStdErr on x axis.

xVariance(self, includeOverflows=True)

xVariance on x axis.

xWidths(self, includeOverflows=True)

xWidths on x axis.

yEdges(self, includeOverflows=False)

yEdges on y axis.

yMax(self)

yMax on y axis.

yMean(self, includeOverflows=True)

yMean on y axis.

yMin(self)

yMin on y axis.

yRMS(self, includeOverflows=True)

yRMS on y axis.

yStdDev(self, includeOverflows=True)

yStdDev on y axis.

yStdErr(self, includeOverflows=True)

yStdErr on y axis.

yVariance(self, includeOverflows=True)

yVariance on y axis.

yWidths(self, includeOverflows=True)

yWidths on y axis.

class yoda.core.BinnedHisto3D(*args, **kwargs)

BinnedHisto3D, i.e. a collection of Dbn3D objects.

Constructor calling idioms:

BinnedHisto3D[AxisT1,AxisT2,AxisT3](path=””, title=””)

Create a new empty BinnedHisto3D, with optional path and title.

BinnedHisto3D[AxisT1,AxisT2,AxisT3](edges, path=””, title=””):

Create a new empty BinnedHisto3D from an iterable of bin edges, with optional path and title.

TODO: more documentation!

bin(self, *indices)

Access the i’th bin.

binAt(self, x, y, z)

Access the coords.

binDim(self)

Return binning dimension.

bins(self, includeOverflows=False, includeMaskedBins=False)

Access the list of bins.

clone(self)

() -> BinnedHisto3D. Clone this BinnedHisto3D.

dVol(self, includeOverflows=True)
density(self, includeOverflows=True)
densityError(self, includeOverflows=True)
densitySum(self, includeOverflows=True)
deserializeContent(self, data)

Data deserialisation for MPI communication.

deserializeMeta(self, data, resetPath=False, resetTitle=False)

Meta-data deserialisation for MPI communication.

divideBy(self, BinnedHisto3D other, efficiency=False)

BinnedHisto3D -> BinnedEstimate3D

Divide this BinnedHisto3D by other, returning a BinnedEstimate3D.

effNumEntries(self, includeOverflows=True)
fill(self, x, y, z, weight=1.0, fraction=1.0)

([coords], float weight=1.0, float fraction=1.0) -> int

Fills the distribution with the given weight at given [coords].

fillDim(self)
indexAt(self, x, y, z)
integral(self, includeOverflows=True)
integralError(self, includeOverflows=True)
isMasked(self, index)

Check if bin with index is masked.

isVisible(self, index)

Check if bin with index is visible.

lengthContent(self, fixed_length=False)

Length of serialisation data vector for MPI communication.

lengthMeta(self, skipPath=True, skipTitle=True)

Length of serialisation meta-data vector for MPI communication.

localToGlobalIndex(self, *indices)

Convert local indices to internal global index.

maskBin(self, idx, status=True)

Mask/Unmask bin the i’th bin.

maskBinAt(self, x, y, z, status=True)

Mask/Unmask bin at the set of coords.

maskBins(self, index_list, status=True)

Mask/Unmask serval bins..

maskSlice(self, dim, idx, status=True)

Mask/Unmask a slice at idx along axis dim.

maskedBins(self)
maxDensity(self, includeOverflows=True)
mkEstimate(self, str path='', str source='', divbyvol=True)

None -> Estimate.

Convert this BinnedHisto3D to an BinnedEstimate3D.

mkScatter(self, path='', binwidthdiv=True, useFocus=False, includeOverflows=False, includeMaskedBins=False)

None -> Scatter4D.

Make a new Scatter4D.

normalize(self, normto=1.0, includeOverflows=True)
numBins(self, includeOverflows=False, includeMaskedBins=False)

() -> int Number of bins in this BinnedHisto.

numBinsX(self, includeOverflows=False)

numBinsX on x axis.

numBinsY(self, includeOverflows=False)

numBinsY on y axis.

numBinsZ(self, includeOverflows=False)

numBinsZ on z axis.

numEntries(self, includeOverflows=True)
rebinX(self, arg, *args, **kwargs)
rebinXBy(self, n, begin=1, end=sys.maxsize)

rebinXBy on x axis.

rebinXTo(self, edges)

rebinXTo on x axis.

rebinY(self, arg, *args, **kwargs)
rebinYBy(self, n, begin=1, end=sys.maxsize)

rebinYBy on y axis.

rebinYTo(self, edges)

rebinYTo on y axis.

rebinZ(self, arg, *args, **kwargs)
rebinZBy(self, n, begin=1, end=sys.maxsize)

rebinZBy on z axis.

rebinZTo(self, edges)

rebinZTo on z axis.

reset(self)

Reset the scatter, removing all points

scaleW(self, factor)
serializeContent(self, fixed_length=False)

Data serialisation for MPI communication.

serializeMeta(self, skipPath=True, skipTitle=True)

Meta-data serialisation for MPI communication.

set(self, *args)

Set bin with Dbn3D.

sumW(self, includeOverflows=True)
sumW2(self, includeOverflows=True)
sumWA(self, dim, includeOverflows=True)
sumWA2(self, dim, includeOverflows=True)
xEdges(self, includeOverflows=False)

xEdges on x axis.

xMax(self)

xMax on x axis.

xMean(self, includeOverflows=True)

xMean on x axis.

xMin(self)

xMin on x axis.

xRMS(self, includeOverflows=True)

xRMS on x axis.

xStdDev(self, includeOverflows=True)

xStdDev on x axis.

xStdErr(self, includeOverflows=True)

xStdErr on x axis.

xVariance(self, includeOverflows=True)

xVariance on x axis.

xWidths(self, includeOverflows=True)

xWidths on x axis.

yEdges(self, includeOverflows=False)

yEdges on y axis.

yMax(self)

yMax on y axis.

yMean(self, includeOverflows=True)

yMean on y axis.

yMin(self)

yMin on y axis.

yRMS(self, includeOverflows=True)

yRMS on y axis.

yStdDev(self, includeOverflows=True)

yStdDev on y axis.

yStdErr(self, includeOverflows=True)

yStdErr on y axis.

yVariance(self, includeOverflows=True)

yVariance on y axis.

yWidths(self, includeOverflows=True)

yWidths on y axis.

zEdges(self, includeOverflows=False)

zEdges on z axis.

zMax(self)

zMax on z axis.

zMean(self, includeOverflows=True)

zMean on z axis.

zMin(self)

zMin on z axis.

zRMS(self, includeOverflows=True)

zRMS on z axis.

zStdDev(self, includeOverflows=True)

zStdDev on z axis.

zStdErr(self, includeOverflows=True)

zStdErr on z axis.

zVariance(self, includeOverflows=True)

zVariance on z axis.

zWidths(self, includeOverflows=True)

zWidths on z axis.

class yoda.core.BinnedProfile1D(*args, **kwargs)

BinnedProfile1D, i.e. a collection of Dbn2D objects.

Constructor calling idioms:

BinnedProfile1D[AxisT](path=””, title=””)

Create a new empty BinnedProfile1D, with optional path and title.

BinnedProfile1D[AxisT](edges, path=””, title=””):

Create a new empty BinnedProfile1D from an iterable of bin edges, with optional path and title.

TODO: more documentation!

bin(self, *indices)

Access the i’th bin.

binAt(self, x)

Access the coords.

binDim(self)

Return binning dimension.

bins(self, includeOverflows=False, includeMaskedBins=False)

Access the list of bins.

clone(self)

() -> BinnedProfile1D. Clone this BinnedProfile1D.

dVol(self, includeOverflows=True)
density(self, includeOverflows=True)
densityError(self, includeOverflows=True)
densitySum(self, includeOverflows=True)
deserializeContent(self, data)

Data deserialisation for MPI communication.

deserializeMeta(self, data, resetPath=False, resetTitle=False)

Meta-data deserialisation for MPI communication.

divideBy(self, BinnedProfile1D other, efficiency=False)

BinnedProfile1D -> BinnedEstimate1D

Divide this BinnedProfile1D by other, returning a BinnedEstimate1D.

effNumEntries(self, includeOverflows=True)
fill(self, x, y, weight=1.0, fraction=1.0)

([coords], float weight=1.0, float fraction=1.0) -> int

Fills the distribution with the given weight at given [coords].

fillDim(self)
indexAt(self, x)
integral(self, includeOverflows=True)
integralError(self, includeOverflows=True)
isMasked(self, index)

Check if bin with index is masked.

isVisible(self, index)

Check if bin with index is visible.

lengthContent(self, fixed_length=False)

Length of serialisation data vector for MPI communication.

lengthMeta(self, skipPath=True, skipTitle=True)

Length of serialisation meta-data vector for MPI communication.

localToGlobalIndex(self, *indices)

Convert local indices to internal global index.

maskBin(self, idx, status=True)

Mask/Unmask bin the i’th bin.

maskBinAt(self, x, status=True)

Mask/Unmask bin at the set of coords.

maskBins(self, index_list, status=True)

Mask/Unmask serval bins..

maskSlice(self, dim, idx, status=True)

Mask/Unmask a slice at idx along axis dim.

maskedBins(self)
maxDensity(self, includeOverflows=True)
mkEstimate(self, str path='', str source='', divbyvol=True)

None -> Estimate.

Convert this BinnedProfile1D to an BinnedEstimate1D.

mkHisto(self, str path='')

None -> BinnedHisto1D.

Convert this BinnedProfile1D to a BinnedHisto1D.

mkScatter(self, path='', binwidthdiv=True, useFocus=False, includeOverflows=False, includeMaskedBins=False)

None -> Scatter2D.

Make a new Scatter2D.

normalize(self, normto=1.0, includeOverflows=True)
numBins(self, includeOverflows=False, includeMaskedBins=False)

() -> int Number of bins in this BinnedProfile.

numBinsX(self, includeOverflows=False)

numBinsX on x axis.

numEntries(self, includeOverflows=True)
rebinX(self, arg, *args, **kwargs)
rebinXBy(self, n, begin=1, end=sys.maxsize)

rebinXBy on x axis.

rebinXTo(self, edges)

rebinXTo on x axis.

reset(self)

Reset the scatter, removing all points

scaleW(self, factor)
serializeContent(self, fixed_length=False)

Data serialisation for MPI communication.

serializeMeta(self, skipPath=True, skipTitle=True)

Meta-data serialisation for MPI communication.

set(self, *args)

Set bin with Dbn2D.

sumW(self, includeOverflows=True)
sumW2(self, includeOverflows=True)
sumWA(self, dim, includeOverflows=True)
sumWA2(self, dim, includeOverflows=True)
xEdges(self, includeOverflows=False)

xEdges on x axis.

xMax(self)

xMax on x axis.

xMean(self, includeOverflows=True)

xMean on x axis.

xMin(self)

xMin on x axis.

xRMS(self, includeOverflows=True)

xRMS on x axis.

xStdDev(self, includeOverflows=True)

xStdDev on x axis.

xStdErr(self, includeOverflows=True)

xStdErr on x axis.

xVariance(self, includeOverflows=True)

xVariance on x axis.

xWidths(self, includeOverflows=True)

xWidths on x axis.

class yoda.core.BinnedProfile2D(*args, **kwargs)

BinnedProfile2D, i.e. a collection of Dbn3D objects.

Constructor calling idioms:

BinnedProfile2D[AxisT1,AxisT2](path=””, title=””)

Create a new empty BinnedProfile2D, with optional path and title.

BinnedProfile2D[AxisT1,AxisT2](edges, path=””, title=””):

Create a new empty BinnedProfile2D from an iterable of bin edges, with optional path and title.

TODO: more documentation!

bin(self, *indices)

Access the i’th bin.

binAt(self, x, y)

Access the coords.

binDim(self)

Return binning dimension.

bins(self, includeOverflows=False, includeMaskedBins=False)

Access the list of bins.

clone(self)

() -> BinnedProfile2D. Clone this BinnedProfile2D.

dVol(self, includeOverflows=True)
density(self, includeOverflows=True)
densityError(self, includeOverflows=True)
densitySum(self, includeOverflows=True)
deserializeContent(self, data)

Data deserialisation for MPI communication.

deserializeMeta(self, data, resetPath=False, resetTitle=False)

Meta-data deserialisation for MPI communication.

divideBy(self, BinnedProfile2D other, efficiency=False)

BinnedProfile2D -> BinnedEstimate2D

Divide this BinnedProfile2D by other, returning a BinnedEstimate2D.

effNumEntries(self, includeOverflows=True)
fill(self, x, y, z, weight=1.0, fraction=1.0)

([coords], float weight=1.0, float fraction=1.0) -> int

Fills the distribution with the given weight at given [coords].

fillDim(self)
indexAt(self, x, y)
integral(self, includeOverflows=True)
integralError(self, includeOverflows=True)
isMasked(self, index)

Check if bin with index is masked.

isVisible(self, index)

Check if bin with index is visible.

lengthContent(self, fixed_length=False)

Length of serialisation data vector for MPI communication.

lengthMeta(self, skipPath=True, skipTitle=True)

Length of serialisation meta-data vector for MPI communication.

localToGlobalIndex(self, *indices)

Convert local indices to internal global index.

maskBin(self, idx, status=True)

Mask/Unmask bin the i’th bin.

maskBinAt(self, x, y, status=True)

Mask/Unmask bin at the set of coords.

maskBins(self, index_list, status=True)

Mask/Unmask serval bins..

maskSlice(self, dim, idx, status=True)

Mask/Unmask a slice at idx along axis dim.

maskedBins(self)
maxDensity(self, includeOverflows=True)
mkEstimate(self, str path='', str source='', divbyvol=True)

None -> Estimate.

Convert this BinnedProfile2D to an BinnedEstimate2D.

mkHisto(self, str path='')

None -> BinnedHisto2D.

Convert this BinnedProfile2D to a BinnedHisto2D.

mkScatter(self, path='', binwidthdiv=True, useFocus=False, includeOverflows=False, includeMaskedBins=False)

None -> Scatter3D.

Make a new Scatter3D.

normalize(self, normto=1.0, includeOverflows=True)
numBins(self, includeOverflows=False, includeMaskedBins=False)

() -> int Number of bins in this BinnedProfile.

numBinsX(self, includeOverflows=False)

numBinsX on x axis.

numBinsY(self, includeOverflows=False)

numBinsY on y axis.

numEntries(self, includeOverflows=True)
rebinX(self, arg, *args, **kwargs)
rebinXBy(self, n, begin=1, end=sys.maxsize)

rebinXBy on x axis.

rebinXTo(self, edges)

rebinXTo on x axis.

rebinY(self, arg, *args, **kwargs)
rebinYBy(self, n, begin=1, end=sys.maxsize)

rebinYBy on y axis.

rebinYTo(self, edges)

rebinYTo on y axis.

reset(self)

Reset the scatter, removing all points

scaleW(self, factor)
serializeContent(self, fixed_length=False)

Data serialisation for MPI communication.

serializeMeta(self, skipPath=True, skipTitle=True)

Meta-data serialisation for MPI communication.

set(self, *args)

Set bin with Dbn3D.

sumW(self, includeOverflows=True)
sumW2(self, includeOverflows=True)
sumWA(self, dim, includeOverflows=True)
sumWA2(self, dim, includeOverflows=True)
xEdges(self, includeOverflows=False)

xEdges on x axis.

xMax(self)

xMax on x axis.

xMean(self, includeOverflows=True)

xMean on x axis.

xMin(self)

xMin on x axis.

xRMS(self, includeOverflows=True)

xRMS on x axis.

xStdDev(self, includeOverflows=True)

xStdDev on x axis.

xStdErr(self, includeOverflows=True)

xStdErr on x axis.

xVariance(self, includeOverflows=True)

xVariance on x axis.

xWidths(self, includeOverflows=True)

xWidths on x axis.

yEdges(self, includeOverflows=False)

yEdges on y axis.

yMax(self)

yMax on y axis.

yMean(self, includeOverflows=True)

yMean on y axis.

yMin(self)

yMin on y axis.

yRMS(self, includeOverflows=True)

yRMS on y axis.

yStdDev(self, includeOverflows=True)

yStdDev on y axis.

yStdErr(self, includeOverflows=True)

yStdErr on y axis.

yVariance(self, includeOverflows=True)

yVariance on y axis.

yWidths(self, includeOverflows=True)

yWidths on y axis.

class yoda.core.Counter(path='', title='')

Weight counter. Like a histogram without any axis (and hence only one bin).

Call fill() like with a histogram. Sums of weights can be returned, with val() and err() being shorthand for the sum of weights and its binomial error.

Counter(path=””, title=””).

Construct a counter with optional path and title but no bins.

clone(self)

None -> Couner. Clone this Counter.

deserializeContent(self, data)

Data deserialisation for MPI communication.

deserializeMeta(self, data, resetPath=False, resetTitle=False)

Data deserialisation for MPI communication.

divideBy(self, Counter other, efficiency=False)
effNumEntries(self)

None -> float Effective number of times this counter was filled, computed from weights.

err(self)

() -> float Binomial uncertainty on the sum of weights filled into this counter.

fill(self, weight=1.0, fraction=1.0)

([w]) -> None. Fill with given optional weight.

lengthContent(self, fixed_length=False)

Length of serialisaed data vector for MPI communication.

lengthMeta(self, skipPath=True, skipTitle=True)

Length of serialisaed meta-data vector for MPI communication.

mkEstimate(self, path='', source='')

None -> Estimate. Convert this Counter to a Estimate.

mkScatter(self, path='')

None -> Scatter1D. Convert this Counter to a Scatter1D, with x representing the value and error.

numEntries(self)

None -> float Number of times this counter was filled.

relErr(self)

() -> float Relative binomial uncertainty on the sum of weights filled into this counter.

reset(self)

None -> None. Reset the counter.

scaleW(self, w)

(float) -> None. Rescale the weights in this counter by the factor w.

serializeContent(self, fixed_length=False)

Data serialisation for MPI communication.

serializeMeta(self, skipPath=True, skipTitle=True)

Meta-data serialisation for MPI communication.

set(self, numEntries, sumW, sumW2)

(float, float, float) -> None

Set the distribution counters with the arguments provided.

sumW(self)

() -> float Sum of weights filled into this counter.

sumW2(self)

() -> float Sum of weights filled into this counter.

val(self)

() -> float Sum of weights filled into this counter.

class yoda.core.Dbn0D

A zero-dimensional ‘counter’, used and exposed by Counter.

copy(self)
effNumEntries(self)

Effective number of entries (for weighted events)

errW(self)

Error on sumW

fill(self, weight=1.0, fraction=1.0)

(float weight=1.0) -> None

Fills the distribution with the given weight at given x.

numEntries(self)

The number of entries

relErrW(self)

Relative error on sumW

reset(self)

() -> None

Reset the distribution counters to the unfilled state.

scaleW(self, w)

(float) -> None

Scale the weights by the given factor.

set(self, numEntries, sumW, sumW2)

(float, float, float) -> None

Set the distribution counters with the arguments provided.

sumW(self)

sum(weights)

sumW2(self)

sum(weights * weights)

class yoda.core.Dbn1D

A 1D distribution ‘counter’, used and exposed by 1D histograms and their bins.

RMS(self, dim=0)

Weighted RMS on axis dim

copy(self)
effNumEntries(self)

Effective number of entries (for weighted events)

errW(self)

Error on sumW

fill(self, x, weight=1.0, fraction=1.0)

(float x, float weight=1.0) -> None

Fills the distribution with the given weight at given x.

mean(self, dim=0)

Weighted mean on axis dim

numEntries(self)

The number of entries

relErrW(self)

Relative error on sumW

reset(self)

() -> None

Reset the distribution counters to the unfilled state.

scale(self, i, w)

(int, float) -> None

Scale the weights by the given factor along axis i.

scaleW(self, w)

(float) -> None

Scale the weights by the given factor.

scaleX(self, x)

(float) -> None

Scale the x dimension by the given factor.

set(self, float numEntries, sumW, sumW2)

State-setting method.

stdDev(self, dim=0)

Weighted standard deviation on axis dim

stdErr(self, dim=0)

Weighted standard error on the mean on axis dim

sumW(self)

sum(weights)

sumW2(self)

sum(weights * weights)

sumWX(self)

sum(weights * xs)

sumWX2(self)

sum(weights * xs * xs)

variance(self, dim=0)

Weighted variance on axis dim

xMean(self)

Weighted mean of x

xRMS(self)

Weighted root mean squared (RMS) of x

xStdDev(self)

Weighted standard deviation of x

xStdErr(self)

Weighted standard error on <x>

xVariance(self)

Weighted variance of x

class yoda.core.Dbn2D

A 2D distribution ‘counter’, used and exposed by 2D histograms and their bins.

RMS(self, dim=0)

Weighted RMS on axis dim

copy(self)
crossTerm(self, i, j)

sum(weights is * js)

effNumEntries(self)

Effective number of entries (for weighted events)

errW(self)

Error on sumW

fill(self, x, y, weight=1.0, fraction=1.0)

(float x, float y, float weight=1.0) -> None

Fills the distribution with the given weight at given x.

mean(self, dim=0)

Weighted mean on axis dim

numEntries(self)

The number of entries

relErrW(self)

Relative error on sumW

reset(self)

() -> None

Reset the distribution counters to the unfilled state.

scale(self, i, w)

(int, float) -> None

Scale the weights by the given factor along axis i.

scaleW(self, w)

(float) -> None

Scale the weights by the given factor.

scaleX(self, x)

(float) -> None

Scale the x dimension by the given factor.

scaleY(self, y)

(float) -> None

Scale the y dimension by the given factor.

set(self, float numEntries, sumW, sumW2, sumWcross)

State-setting method.

stdDev(self, dim=0)

Weighted standard deviation on axis dim

stdErr(self, dim=0)

Weighted standard error on the mean on axis dim

sumW(self)

sum(weights)

sumW2(self)

sum(weights * weights)

sumWX(self)

sum(weights * xs)

sumWX2(self)

sum(weights * xs * xs)

sumWY(self)

sum(weights * xs)

sumWY2(self)

sum(weights * ys * ys)

variance(self, dim=0)

Weighted variance on axis dim

xMean(self)

Weighted mean of x

xRMS(self)

Weighted root mean squared (RMS) of x

xStdDev(self)

Weighted standard deviation of x

xStdErr(self)

Weighted standard error on <x>

xVariance(self)

Weighted variance of x

yMean(self)

Weighted mean of y

yRMS(self)

Weighted root mean squared (RMS) of y

yStdDev(self)

Weighted standard deviation of y

yStdErr(self)

Weighted standard error on <y>

yVariance(self)

Weighted variance of y

class yoda.core.Dbn3D

A 3D distribution ‘counter’, used and exposed by 3D histograms and their bins.

RMS(self, dim=0)

Weighted RMS on axis dim

copy(self)
crossTerm(self, i, j)

sum(weights is * js)

effNumEntries(self)

Effective number of entries (for weighted events)

errW(self)

Error on sumW

fill(self, x, y, z, weight=1.0, fraction=1.0)

(float x, float y, float z, float weight=1.0) -> None

Fills the distribution with the given weight at given x.

mean(self, dim=0)

Weighted mean on axis dim

numEntries(self)

The number of entries

relErrW(self)

Relative error on sumW

reset(self)

() -> None

Reset the distribution counters to the unfilled state.

scale(self, i, w)

(int, float) -> None

Scale the weights by the given factor along axis i.

scaleW(self, w)

(float) -> None

Scale the weights by the given factor.

scaleX(self, x)

(float) -> None

Scale the x dimension by the given factor.

scaleY(self, y)

(float) -> None

Scale the y dimension by the given factor.

scaleZ(self, z)

(float) -> None

Scale the z dimension by the given factor.

set(self, float numEntries, sumW, sumW2, sumWcross)

State-setting method.

stdDev(self, dim=0)

Weighted standard deviation on axis dim

stdErr(self, dim=0)

Weighted standard error on the mean on axis dim

sumW(self)

sum(weights)

sumW2(self)

sum(weights * weights)

sumWX(self)

sum(weights * xs)

sumWX2(self)

sum(weights * xs * xs)

sumWY(self)

sum(weights * xs)

sumWY2(self)

sum(weights * ys * ys)

sumWZ(self)

sum(weights * xs)

sumWZ2(self)

sum(weights * zs * zs)

variance(self, dim=0)

Weighted variance on axis dim

xMean(self)

Weighted mean of x

xRMS(self)

Weighted root mean squared (RMS) of x

xStdDev(self)

Weighted standard deviation of x

xStdErr(self)

Weighted standard error on <x>

xVariance(self)

Weighted variance of x

yMean(self)

Weighted mean of y

yRMS(self)

Weighted root mean squared (RMS) of y

yStdDev(self)

Weighted standard deviation of y

yStdErr(self)

Weighted standard error on <y>

yVariance(self)

Weighted variance of y

zMean(self)

Weighted mean of z

zRMS(self)

Weighted root mean squared (RMS) of z

zStdDev(self)

Weighted standard deviation of z

zStdErr(self)

Weighted standard error on <z>

zVariance(self)

Weighted variance of z

class yoda.core.Estimate

A point estimate, consisting of a central value and an error breakdown.

copy(self)
deserializeSources(self, data)
err(self, source='')
errAvg(self, source='')
errDown(self, source='')
errDownUp(self, source='')
errEnv(self, source='')
errNeg(self, source='')
errNegPos(self, source='')
errPos(self, source='')
errUp(self, source='')
hasSource(self, str source)
numErrs(self)
quadSum(self, pat_match='')
quadSumAvg(self, pat_match='')
quadSumEnv(self, pat_match='')
quadSumNeg(self, pat_match='')
quadSumPos(self, pat_match='')
relErr(self, source='')
relErrAvg(self, source='')
relErrDown(self, source='')
relErrDownUp(self, source='')
relErrEnv(self, source='')
relErrUp(self, source='')
relTotalErr(self, pat_match='')
relTotalErrAvg(self, pat_match='')
relTotalErrEnv(self, pat_match='')
relTotalErrNeg(self, pat_match='')
relTotalErrPos(self, pat_match='')
reset(self)

() -> None

Reset the estimates to the unfilled state.

rmErrs(self)
rmSource(self, str source)
scale(self, factor)
serializeSources(self)
set(self, val, errs, source='')
setErr(self, *es)
setVal(self, value)
sources(self)
totalErr(self, pat_match='')
totalErrAvg(self, pat_match='')
totalErrEnv(self, pat_match='')
totalErrNeg(self, pat_match='')
totalErrPos(self, pat_match='')
val(self)
valMax(self, source='')
valMin(self, source='')
class yoda.core.Estimate0D(path='', title='')

An Estimate0D, consisting of a central value and an error breakdown.

clone(self)

None -> Estimate0D. Clone this Estimate0Dr.

deserializeContent(self, data)

Data deserialisation for MPI communication.

deserializeMeta(self, data, resetPath=False, resetTitle=False)

Meta-data deserialisation for MPI communication.

err(self, source='')
errDown(self, source='')
errDownUp(self, source='')
errNeg(self, source='')
errNegPos(self, source='')
errPos(self, source='')
errUp(self, source='')
hasSource(self, str source)
lengthContent(self, fixed_length=False)

Length of serialisaed data vector for MPI communication.

lengthMeta(self, skipPath=True, skipTitle=True)

Length of serialisaed meta-data vector for MPI communication.

mkScatter(self, path='', pat_match='')

None -> Scatter1D.

Make a new Scatter1D.

numErrs(self)
quadSum(self, pat_match='')
quadSumNeg(self, pat_match='')
quadSumPos(self, pat_match='')
relErr(self, source='')
relErrDown(self, source='')
relErrDownUp(self, source='')
relErrUp(self, source='')
relTotalErr(self, pat_match='')
relTotalErrNeg(self, pat_match='')
relTotalErrPos(self, pat_match='')
reset(self)

() -> None

Reset the Estimate0Ds to the unfilled state.

rmErrs(self)
rmSource(self, str source)
scale(self, factor)
serializeContent(self, fixed_length=False)

Data serialisation for MPI communication.

serializeMeta(self, skipPath=True, skipTitle=True)

Meta-data serialisation for MPI communication.

set(self, val, errs, source='')
setErr(self, *es)
setVal(self, value)
sources(self)
totalErr(self, pat_match='')
val(self)
yoda.core.Estimate1D

alias of BinnedEstimate1D

yoda.core.Estimate2D

alias of BinnedEstimate2D

yoda.core.Estimate3D

alias of BinnedEstimate3D

yoda.core.H1D

alias of BinnedHisto1D

yoda.core.H2D

alias of BinnedHisto2D

yoda.core.H3D

alias of BinnedHisto3D

yoda.core.Histo1D

alias of BinnedHisto1D

yoda.core.Histo2D

alias of BinnedHisto2D

yoda.core.Histo3D

alias of BinnedHisto3D

yoda.core.P1D

alias of Point1D

yoda.core.P2D

alias of Point2D

yoda.core.P3D

alias of Point3D

yoda.core.P4D

alias of Point4D

class yoda.core.Point

A generic point with errors, used by the Scatter classes.

dim(self)

None -> int

Space dimension of the point (should match containing Scatter)

scale(self, i, scale)

(int, float) -> None

Scale values on axis i

setErr(self, i, e)

(int, float) -> None

Set symmetric errors on axis i.

setErrMinus(self, i, e)

(int, float) -> None

Set minus error on axis i.

setErrPlus(self, i, e)

(int, float) -> None

Set plus error on axis i.

setErrs(self, i, *es)

(int, float) -> None (int, [float, float]) -> None (int, float, float) -> None

Set asymmetric errors on axis i.

setVal(self, i, val)

(int, float) -> None

Value on axis i

val(self, i)

int -> float Value on axis i

class yoda.core.Point1D(*args, **kwargs)

A 1D point with errors, used by the Scatter1D class.

copy(self)
errs(self, i)

(int) -> list[double] Returns error pair along axis i

max(self, i)

(int) -> double Returns maximal value along axis i

min(self, i)

(int) -> double Returns minimal value along axis i

scaleX(self, a)

(float) -> None Scale the x values and errors by factor a.

setX(self, x)

Set the x value

setXErrs(self, *es)

(float,) -> None ([float, float]) -> None (float, float) -> None

Set asymmetric errors on x-axis.

val(self, i)

(int) -> double Returns value along axis i

x(self)

The x value

xErrAvg(self)
xErrMinus(self)
xErrPlus(self)
xErrs(self)

The x errors

xMax(self)

The maximum x position, i.e. highest error

xMin(self)

The minimum x position, i.e. lowest error

class yoda.core.Point2D(*args, **kwargs)

A 2D point with errors, used by the Scatter2D class.

copy(self)
errs(self, i)

(int) -> list[double] Returns error pair along axis i

max(self, i)

(int) -> double Returns maximal value along axis i

min(self, i)

(int) -> double Returns minimal value along axis i

scaleX(self, a)

(float) -> None Scale the x values and errors by factor a.

scaleY(self, a)

(float) -> None Scale the y values and errors by factor a.

setX(self, x)

Set the x value

setXErrs(self, *es)

(float,) -> None ([float, float]) -> None (float, float) -> None

Set asymmetric errors on x-axis.

setY(self, y)

Set the y value

setYErrs(self, *es)

(float,) -> None ([float, float]) -> None (float, float) -> None

Set asymmetric errors on y-axis.

val(self, i)

(int) -> double Returns value along axis i

x(self)

The x value

xErrAvg(self)
xErrMinus(self)
xErrPlus(self)
xErrs(self)

The x errors

xMax(self)

The maximum x position, i.e. highest error

xMin(self)

The minimum x position, i.e. lowest error

y(self)

The y value

yErrAvg(self)
yErrMinus(self)
yErrPlus(self)
yErrs(self)

The y errors

yMax(self)

The maximum y position, i.e. highest error

yMin(self)

The minimum y position, i.e. lowest error

class yoda.core.Point3D(*args, **kwargs)

A 3D point with errors, used by the Scatter3D class.

copy(self)
errs(self, i)

(int) -> list[double] Returns error pair along axis i

max(self, i)

(int) -> double Returns maximal value along axis i

min(self, i)

(int) -> double Returns minimal value along axis i

scaleX(self, a)

(float) -> None Scale the x values and errors by factor a.

scaleY(self, a)

(float) -> None Scale the y values and errors by factor a.

scaleZ(self, a)

(float) -> None Scale the z values and errors by factor a.

setX(self, x)

Set the x value

setXErrs(self, *es)

(float,) -> None ([float, float]) -> None (float, float) -> None

Set asymmetric errors on x-axis.

setY(self, y)

Set the y value

setYErrs(self, *es)

(float,) -> None ([float, float]) -> None (float, float) -> None

Set asymmetric errors on y-axis.

setZ(self, z)

Set the z value

setZErrs(self, *es)

(float,) -> None ([float, float]) -> None (float, float) -> None

Set asymmetric errors on z-axis.

val(self, i)

(int) -> double Returns value along axis i

x(self)

The x value

xErrAvg(self)
xErrMinus(self)
xErrPlus(self)
xErrs(self)

The x errors

xMax(self)

The maximum x position, i.e. highest error

xMin(self)

The minimum x position, i.e. lowest error

y(self)

The y value

yErrAvg(self)
yErrMinus(self)
yErrPlus(self)
yErrs(self)

The y errors

yMax(self)

The maximum y position, i.e. highest error

yMin(self)

The minimum y position, i.e. lowest error

z(self)

The z value

zErrAvg(self)
zErrMinus(self)
zErrPlus(self)
zErrs(self)

The z errors

zMax(self)

The maximum z position, i.e. highest error

zMin(self)

The minimum z position, i.e. lowest error

class yoda.core.Point4D(*args, **kwargs)

A 4D point with errors, used by the Scatter4D class.

copy(self)
errs(self, i)

(int) -> list[double] Returns error pair along axis i

max(self, i)

(int) -> double Returns maximal value along axis i

min(self, i)

(int) -> double Returns minimal value along axis i

val(self, i)

(int) -> double Returns value along axis i

yoda.core.Profile1D

alias of BinnedProfile1D

yoda.core.Profile2D

alias of BinnedProfile2D

yoda.core.RMS(sample, weights)

(list[float], list[float]) -> float Return the weighted RMS of the entries in the provided sample list.

yoda.core.S1D

alias of Scatter1D

yoda.core.S2D

alias of Scatter2D

yoda.core.S3D

alias of Scatter3D

yoda.core.S4D

alias of Scatter4D

class yoda.core.Scatter1D(*args, **kwargs)

1D scatter plot, i.e. a collection of Point1D objects with positions and errors.

Constructor calling idioms:

Scatter1D(path=””, title=””)

Create a new empty scatter, with optional path and title.

Scatter1D(points, path=””, title=””):

Create a new empty scatter from an iterable of points, with optional path and title.

TODO: more documentation!

addPoint(self, *args, **kwargs)

Add a new point.

Provide either a single yoda.Point1D object, or the two args: x, xerrs=0.

addPoints(self, iterable)

Add several new points.

clone(self)

() -> Scatter1D. Clone this Scatter1D.

combineWith(self, others)

Try to add points from other Scatter1Ds into this one.

deserializeContent(self, data)

Data deserialisation for MPI communication.

deserializeMeta(self, data, resetPath=False, resetTitle=False)

Meta-data deserialisation for MPI communication.

edges(self, i)

(int) -> list[list[double,double]] Returns point edges along axis i

errAvgs(self, i)

(int) -> list[double] Returns list of average errors along axis i

errs(self, i)

(int) -> list[(double,double)] Returns list of (neg,pos) error pairs along axis i

lengthContent(self, fixed_length=False)

Length of serialisaed data vector for MPI communication.

lengthMeta(self, skipPath=True, skipTitle=True)

Length of serialisaed meta-data vector for MPI communication.

maxs(self, i)

(int) -> list[double] Returns list of largest values along axis i

mins(self, i)

(int) -> list[double] Returns list of lowest values along axis i

mkScatter(self, path=None, includeOverflows=None, includeMaskedBins=None)

None -> Scatter1D. Make a new Scatter1D. Exists to allow mkScatter calls on any AnalysisObject, even if it already is a scatter.

numPoints(self)

() -> int Number of points in this scatter.

point(self, size_t i)

Access the i’th point.

points(self)

Access the ordered list of points.

reset(self)

Reset the scatter, removing all points

rmPoint(self, idx)
rmPoints(self, idxs)
scale(self, i, scale)

(int, float) -> None Scale values and errors on axis i

scaleErr(self, i, scale)

(int, float) -> None Scale errors on axis i

scaleVal(self, i, scale)

(int, float) -> None Scale values on axis i

scaleX(self, a)

(float) -> None Scale the x values and errors of the points in this scatter by factor a.

serializeContent(self, fixed_length=False)

Data serialisation for MPI communication.

serializeMeta(self, skipPath=True, skipTitle=True)

Meta-data serialisation for MPI communication.

vals(self, i)

(int) -> list[double] Returns list of values along axis i

xErrAvgs(self)

The average error along the x-axis.

xErrs(self)

The error pairs along the x-axis.

xMax(self)

The highest central x values.

xMaxs(self)

All x high values.

xMin(self)

The lowest central x values.

xMins(self)

All x low values.

xVals(self)

All x values.

class yoda.core.Scatter2D(*args, **kwargs)

2D scatter plot, i.e. a collection of Point2D objects with positions and errors.

Constructor calling idioms:

Scatter2D(path=””, title=””)

Create a new empty scatter, with optional path and title.

Scatter2D(points, path=””, title=””):

Create a new empty scatter from an iterable of points, with optional path and title.

TODO: more documentation!

addPoint(self, *args, **kwargs)

Add a new point.

Provide either a single yoda.Point2D object, or the two args: x, xerrs=0.

addPoints(self, iterable)

Add several new points.

clone(self)

() -> Scatter1D. Clone this Scatter2D.

combineWith(self, others)

Try to add points from other Scatter2Ds into this one.

deserializeContent(self, data)

Data deserialisation for MPI communication.

deserializeMeta(self, data, resetPath=False, resetTitle=False)

Meta-data deserialisation for MPI communication.

edges(self, i)

(int) -> list[list[double,double]] Returns point edges along axis i

errAvgs(self, i)

(int) -> list[double] Returns list of average errors along axis i

errs(self, i)

(int) -> list[(double,double)] Returns list of (neg,pos) error pairs along axis i

lengthContent(self, fixed_length=False)

Length of serialisaed data vector for MPI communication.

lengthMeta(self, skipPath=True, skipTitle=True)

Length of serialisaed meta-data vector for MPI communication.

maxs(self, i)

(int) -> list[double] Returns list of largest values along axis i

mins(self, i)

(int) -> list[double] Returns list of lowest values along axis i

mkScatter(self, path=None, includeOverflows=None, includeMaskedBins=None)

None -> Scatter2D. Make a new Scatter2D. Exists to allow mkScatter calls on any AnalysisObject, even if it already is a scatter.

numPoints(self)

() -> int Number of points in this scatter.

point(self, size_t i)

Access the i’th point.

points(self)

Access the ordered list of points.

reset(self)

Reset the scatter, removing all points

rmPoint(self, idx)
rmPoints(self, idxs)
scale(self, i, scale)

(int, float) -> None Scale values and errors on axis i

scaleErr(self, i, scale)

(int, float) -> None Scale errors on axis i

scaleVal(self, i, scale)

(int, float) -> None Scale values on axis i

scaleX(self, a)

(float) -> None Scale the x values and errors of the points in this scatter by factor a.

scaleY(self, a)

(float) -> None Scale the y values and errors of the points in this scatter by factor a.

serializeContent(self, fixed_length=False)

Data serialisation for MPI communication.

serializeMeta(self, skipPath=True, skipTitle=True)

Meta-data serialisation for MPI communication.

vals(self, i)

(int) -> list[double] Returns list of values along axis i

xErrAvgs(self)

The average error along the x-axis.

xErrs(self)

The error pairs along the x-axis.

xMax(self)

The highest central x values.

xMaxs(self)

All x high values.

xMin(self)

The lowest central x values.

xMins(self)

All x low values.

xVals(self)

All x values.

yErrAvgs(self)

The average error along the y-axis.

yErrs(self)

The error pairs along the y-axis.

yMax(self)

The highest central y values.

yMaxs(self)

All y high values.

yMin(self)

The lowest central y values.

yMins(self)

All y low values.

yVals(self)

All y values.

class yoda.core.Scatter3D(*args, **kwargs)

3D scatter plot, i.e. a collection of Point3D objects with positions and errors.

Constructor calling idioms:

Scatter3D(path=””, title=””)

Create a new empty scatter, with optional path and title.

Scatter3D(points, path=””, title=””):

Create a new empty scatter from an iterable of points, with optional path and title.

TODO: more documentation!

addPoint(self, *args, **kwargs)

Add a new point.

Provide either a single yoda.Point3D object, or the two args: x, xerrs=0.

addPoints(self, iterable)

Add several new points.

clone(self)

() -> Scatter1D. Clone this Scatter3D.

combineWith(self, others)

Try to add points from other Scatter3Ds into this one.

deserializeContent(self, data)

Data deserialisation for MPI communication.

deserializeMeta(self, data, resetPath=False, resetTitle=False)

Meta-data deserialisation for MPI communication.

edges(self, i)

(int) -> list[list[double,double]] Returns point edges along axis i

errAvgs(self, i)

(int) -> list[double] Returns list of average errors along axis i

errs(self, i)

(int) -> list[(double,double)] Returns list of (neg,pos) error pairs along axis i

lengthContent(self, fixed_length=False)

Length of serialisaed data vector for MPI communication.

lengthMeta(self, skipPath=True, skipTitle=True)

Length of serialisaed meta-data vector for MPI communication.

maxs(self, i)

(int) -> list[double] Returns list of largest values along axis i

mins(self, i)

(int) -> list[double] Returns list of lowest values along axis i

mkScatter(self, path=None, includeOverflows=None, includeMaskedBins=None)

None -> Scatter3D. Make a new Scatter3D. Exists to allow mkScatter calls on any AnalysisObject, even if it already is a scatter.

numPoints(self)

() -> int Number of points in this scatter.

point(self, size_t i)

Access the i’th point.

points(self)

Access the ordered list of points.

reset(self)

Reset the scatter, removing all points

rmPoint(self, idx)
rmPoints(self, idxs)
scale(self, i, scale)

(int, float) -> None Scale values and errors on axis i

scaleErr(self, i, scale)

(int, float) -> None Scale errors on axis i

scaleVal(self, i, scale)

(int, float) -> None Scale values on axis i

scaleX(self, a)

(float) -> None Scale the x values and errors of the points in this scatter by factor a.

scaleY(self, a)

(float) -> None Scale the y values and errors of the points in this scatter by factor a.

scaleZ(self, a)

(float) -> None Scale the z values and errors of the points in this scatter by factor a.

serializeContent(self, fixed_length=False)

Data serialisation for MPI communication.

serializeMeta(self, skipPath=True, skipTitle=True)

Meta-data serialisation for MPI communication.

vals(self, i)

(int) -> list[double] Returns list of values along axis i

xErrAvgs(self)

The average error along the x-axis.

xErrs(self)

The error pairs along the x-axis.

xMax(self)

The highest central x values.

xMaxs(self)

All x high values.

xMin(self)

The lowest central x values.

xMins(self)

All x low values.

xVals(self)

All x values.

yErrAvgs(self)

The average error along the y-axis.

yErrs(self)

The error pairs along the y-axis.

yMax(self)

The highest central y values.

yMaxs(self)

All y high values.

yMin(self)

The lowest central y values.

yMins(self)

All y low values.

yVals(self)

All y values.

zErrAvgs(self)

The average error along the z-axis.

zErrs(self)

The error pairs along the z-axis.

zMax(self)

The highest central z values.

zMaxs(self)

All z high values.

zMin(self)

The lowest central z values.

zMins(self)

All z low values.

zVals(self)

All z values.

class yoda.core.Scatter4D(*args, **kwargs)

4D scatter plot, i.e. a collection of Point4D objects with positions and errors.

Constructor calling idioms:

Scatter4D(path=””, title=””)

Create a new empty scatter, with optional path and title.

Scatter4D(points, path=””, title=””):

Create a new empty scatter from an iterable of points, with optional path and title.

TODO: more documentation!

addPoint(self, *args, **kwargs)

Add a new point.

Provide either a single yoda.Point4D object, or the two args: x, xerrs=0.

addPoints(self, iterable)

Add several new points.

clone(self)

() -> Scatter1D. Clone this Scatter4D.

combineWith(self, others)

Try to add points from other Scatter4Ds into this one.

deserializeContent(self, data)

Data deserialisation for MPI communication.

deserializeMeta(self, data, resetPath=False, resetTitle=False)

Meta-data deserialisation for MPI communication.

edges(self, i)

(int) -> list[list[double,double]] Returns point edges along axis i

errAvgs(self, i)

(int) -> list[double] Returns list of average errors along axis i

errs(self, i)

(int) -> list[(double,double)] Returns list of (neg,pos) error pairs along axis i

lengthContent(self, fixed_length=False)

Length of serialisaed data vector for MPI communication.

lengthMeta(self, skipPath=True, skipTitle=True)

Length of serialisaed meta-data vector for MPI communication.

maxs(self, i)

(int) -> list[double] Returns list of largest values along axis i

mins(self, i)

(int) -> list[double] Returns list of lowest values along axis i

mkScatter(self, path=None, includeOverflows=None, includeMaskedBins=None)

None -> Scatter4D. Make a new Scatter4D. Exists to allow mkScatter calls on any AnalysisObject, even if it already is a scatter.

numPoints(self)

() -> int Number of points in this scatter.

point(self, size_t i)

Access the i’th point.

points(self)

Access the ordered list of points.

reset(self)

Reset the scatter, removing all points

rmPoint(self, idx)
rmPoints(self, idxs)
scale(self, i, scale)

(int, float) -> None Scale values and errors on axis i

scaleErr(self, i, scale)

(int, float) -> None Scale errors on axis i

scaleVal(self, i, scale)

(int, float) -> None Scale values on axis i

serializeContent(self, fixed_length=False)

Data serialisation for MPI communication.

serializeMeta(self, skipPath=True, skipTitle=True)

Meta-data serialisation for MPI communication.

vals(self, i)

(int) -> list[double] Returns list of values along axis i

yoda.core.correlation(sample1, sample2)

(float, list[float]) -> int Return the unweighted correlation of the two provided sample lists.

yoda.core.covariance(sample1, sample2)

(list[float], list[float]) -> float Return the unweighted covariance of the two provided sample lists.

yoda.core.divide(ao1, ao2, efficiency=False)

(AnalysisObject, AnalysisObject) -> Estimate{0,1,2,3}D Divide one AnalysisObject by another, producing an Estimate appropriate dimension by using the logic of the bound divideBy methods.

yoda.core.effNumEntries(weights)

(list[float]) -> float Return the effective number of entries given a list of weights.

yoda.core.efficiency(ao1, ao2)

(AnalysisObject, AnalysisObject) -> Estimate{0,1,2,3}D Divide one AnalysisObject by another, producing an Estimate appropriate dimension by using the logic of the bound divideBy methods.

yoda.core.getDataPath()

Return the directory containing the YODA data files

yoda.core.getLibPath()

Return the directory containing the YODA library

yoda.core.getYodaDataPath()

Return the list of directories containing YODA data files

yoda.core.index_between(x, binedges)

(float, list[float]) -> int Return the index of the bin which would contain x, or -1 if there is no enclosing bin in the given set of n+1 bin edges.

yoda.core.linspace(nbins, xmin, xmax)

(int, float, float) -> list[float] Make a list of n+1 bin edges linearly spaced between xmin and xmax, with the first and last edges on those boundaries.

yoda.core.logspace(nbins, xmin, xmax)

(int, float, float) -> list[float] Make a list of n+1 bin edges linearly spaced on the interval log(xmin..xmax), with the first and last edges on those boundaries.

yoda.core.mean(sample, weights)

(list[float], list[float]) -> float Return the weighted mean of the entries in the provided sample list.

yoda.core.naiveChi2(sample1, sample2, errors1=[], errors2=[])

(list[float], list[float], list[float], list[float] -> float Return the error-weighted chi2 statistic of the two provided sample lists.

Note that this calculation is rather naive as it neglects the error breakdowns that may be available for the curves being compared. More sophisticated comparisons will require a separate analysis based on the Estimate objects utilising the full covariance information.

yoda.core.naiveChi2reduced(sample1, sample2, errors1=[], errors2=[])

(list[float], list[float], list[float], list[float] -> float Return the error-weighted reduced chi2 statistic of the two provided sample lists.

Note that this calculation is rather naive as it neglects the error breakdowns that may be available for the curves being compared. More sophisticated comparisons will require a separate analysis based on the Estimate objects utilising the full covariance information.

yoda.core.pdfspace(nbins, xmin, xmax, fn, nsample=10000)

(int, float, float, [int]) -> list[float] Make a list of n+1 bin edges spaced with density proportional to fn(x) between xmin and xmax, with the first and last edges on those boundaries.

The density is manually integrated by the Trapezium Rule, using nsample linspace points.

Note: manually implemented in Python here rather than mapping the C++ version, since that requires some awkward Cython shim work: https://stackoverflow.com/questions/39044063/pass-a-closure-from-cython-to-c https://github.com/cython/cython/tree/master/Demos/callback

yoda.core.read(filename, asdict=True, patterns='', unpatterns='')

Read data objects from the provided filename, auto-determining the format from the file extension.

The loaded data objects can be filtered on their path strings, using the optional patterns and unpatterns arguments. These can be strings, compiled regex objects with a ‘match’ method, or any iterable of those types. If given, only analyses with paths which match at least one pattern, and do not match any unpatterns, will be returned.

Returns a dict or list of analysis objects depending on the asdict argument.

yoda.core.readFLAT(file_or_filename, asdict=True, patterns='', unpatterns='')

Read data objects from the provided FLAT-format file.

The loaded data objects can be filtered on their path strings, using the optional patterns and unpatterns arguments. These can be strings, compiled regex objects with a ‘match’ method, or any iterable of those types. If given, only analyses with paths which match at least one pattern, and do not match any unpatterns, will be returned.

Returns a dict or list of analysis objects depending on the asdict argument.

yoda.core.readYODA(file_or_filename, asdict=True, patterns='', unpatterns='')

Read data objects from the provided YODA-format file.

The loaded data objects can be filtered on their path strings, using the optional patterns and unpatterns arguments. These can be strings, compiled regex objects with a ‘match’ method, or any iterable of those types. If given, only analyses with paths which match at least one pattern, and do not match any unpatterns, will be returned.

Returns a dict or list of analysis objects depending on the asdict argument.

yoda.core.stdDev(sample, weights)

(list[float], list[float]) -> float Return the weighted standard deviation of the entries in the provided sample list.

yoda.core.stdErr(sample, weights)

(list[float], list[float]) -> float Return the weighted standard error of the entries in the provided sample list.

yoda.core.variance(sample, weights)

(list[float], list[float]) -> float Return the weighted variance of the entries in the provided sample list.

yoda.core.version()

Return YODA library version as a string

yoda.core.write(ana_objs, filename, precision=-1)

Write data objects to the provided filename, auto-determining the format from the file extension.

yoda.core.writeFLAT(ana_objs, file_or_filename, precision=-1)

Write data objects to the provided file in FLAT format.

yoda.core.writeYODA(ana_objs, file_or_filename, precision=-1)

Write data objects to the provided file in YODA format.

yoda.core.writeYODA1(ana_objs, file_or_filename, precision=-1)

Write data objects to the provided file in YODA1 format.

Indices and tables