rootfig 0.1.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
rootfig/__init__.py ADDED
@@ -0,0 +1,97 @@
1
+ """rootfig: publication-quality histograms straight from ROOT trees, without ROOT.
2
+
3
+ The quick path::
4
+
5
+ import rootfig as rf
6
+
7
+ rf.plot("events.root", "Muon_pt", tree="events", selection="Muon_pt > 20", bins=50)
8
+
9
+ The composable path uses :class:`Sample`, :class:`Variable`, :class:`Cut` and
10
+ :class:`Style` objects with the same :func:`plot` function. Lower layers are
11
+ exposed as sub-packages: :mod:`rootfig.io`, :mod:`rootfig.expressions`,
12
+ :mod:`rootfig.selection`, :mod:`rootfig.histograms`, :mod:`rootfig.plotting`.
13
+ """
14
+
15
+ from rootfig.api import (
16
+ SummaryTable,
17
+ correlation,
18
+ cutflow,
19
+ efficiency,
20
+ histogram,
21
+ histograms,
22
+ load,
23
+ plot,
24
+ plot2d,
25
+ plot_histograms,
26
+ profile,
27
+ summarize,
28
+ )
29
+ from rootfig.errors import (
30
+ BinningError,
31
+ ExpressionError,
32
+ IncompatibleWeightError,
33
+ LuminosityError,
34
+ MissingBranchError,
35
+ RootfigError,
36
+ RootfigWarning,
37
+ SelectionError,
38
+ SourceError,
39
+ )
40
+ from rootfig.expressions import evaluate
41
+ from rootfig.histograms import (
42
+ Cutflow,
43
+ CutflowTable,
44
+ Efficiency,
45
+ Histogram,
46
+ Profile,
47
+ Ratio,
48
+ Summary,
49
+ ratio,
50
+ significance,
51
+ )
52
+ from rootfig.model import Cut, Sample, Style, Variable, log_bins
53
+ from rootfig.plotting import Plot, use_style
54
+
55
+ __version__ = "0.1.0"
56
+
57
+ __all__ = [
58
+ "BinningError",
59
+ "Cut",
60
+ "Cutflow",
61
+ "CutflowTable",
62
+ "Efficiency",
63
+ "ExpressionError",
64
+ "Histogram",
65
+ "IncompatibleWeightError",
66
+ "LuminosityError",
67
+ "MissingBranchError",
68
+ "Plot",
69
+ "Profile",
70
+ "Ratio",
71
+ "RootfigError",
72
+ "RootfigWarning",
73
+ "Sample",
74
+ "SelectionError",
75
+ "SourceError",
76
+ "Style",
77
+ "Summary",
78
+ "SummaryTable",
79
+ "Variable",
80
+ "__version__",
81
+ "correlation",
82
+ "cutflow",
83
+ "efficiency",
84
+ "evaluate",
85
+ "histogram",
86
+ "histograms",
87
+ "load",
88
+ "log_bins",
89
+ "plot",
90
+ "plot2d",
91
+ "plot_histograms",
92
+ "profile",
93
+ "ratio",
94
+ "significance",
95
+ "summarize",
96
+ "use_style",
97
+ ]
rootfig/_typing.py ADDED
@@ -0,0 +1,21 @@
1
+ """Shared type aliases."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from typing import TYPE_CHECKING, Any, TypeAlias
6
+
7
+ import hist
8
+ import numpy as np
9
+ import numpy.typing as npt
10
+
11
+ if TYPE_CHECKING:
12
+ Hist: TypeAlias = hist.Hist[Any]
13
+ """A ``hist.Hist`` with any storage (``Weight`` in everything rootfig produces)."""
14
+ else:
15
+ Hist = hist.Hist
16
+
17
+ FloatArray: TypeAlias = npt.NDArray[np.float64]
18
+ """A one-dimensional float array."""
19
+
20
+ AnyArray: TypeAlias = npt.NDArray[Any]
21
+ """A NumPy array of any dtype."""