rootloader 0.4.0__tar.gz → 0.4.2__tar.gz
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.
- {rootloader-0.4.0 → rootloader-0.4.2}/PKG-INFO +1 -1
- {rootloader-0.4.0 → rootloader-0.4.2}/rootloader/tdirectory.py +14 -9
- {rootloader-0.4.0 → rootloader-0.4.2}/rootloader/ttree.py +3 -0
- rootloader-0.4.2/rootloader/version.py +1 -0
- rootloader-0.4.0/rootloader/version.py +0 -1
- {rootloader-0.4.0 → rootloader-0.4.2}/.gitignore +0 -0
- {rootloader-0.4.0 → rootloader-0.4.2}/LICENSE +0 -0
- {rootloader-0.4.0 → rootloader-0.4.2}/README.md +0 -0
- {rootloader-0.4.0 → rootloader-0.4.2}/docs/README.md +0 -0
- {rootloader-0.4.0 → rootloader-0.4.2}/docs/rootloader/attrdict.md +0 -0
- {rootloader-0.4.0 → rootloader-0.4.2}/docs/rootloader/index.md +0 -0
- {rootloader-0.4.0 → rootloader-0.4.2}/docs/rootloader/tdirectory.md +0 -0
- {rootloader-0.4.0 → rootloader-0.4.2}/docs/rootloader/tfile.md +0 -0
- {rootloader-0.4.0 → rootloader-0.4.2}/docs/rootloader/th1.md +0 -0
- {rootloader-0.4.0 → rootloader-0.4.2}/docs/rootloader/th2.md +0 -0
- {rootloader-0.4.0 → rootloader-0.4.2}/docs/rootloader/tleaf.md +0 -0
- {rootloader-0.4.0 → rootloader-0.4.2}/docs/rootloader/ttree.md +0 -0
- {rootloader-0.4.0 → rootloader-0.4.2}/docs/rootloader/version.md +0 -0
- {rootloader-0.4.0 → rootloader-0.4.2}/pyproject.toml +0 -0
- {rootloader-0.4.0 → rootloader-0.4.2}/rootloader/__init__.py +0 -0
- {rootloader-0.4.0 → rootloader-0.4.2}/rootloader/attrdict.py +0 -0
- {rootloader-0.4.0 → rootloader-0.4.2}/rootloader/tfile.py +0 -0
- {rootloader-0.4.0 → rootloader-0.4.2}/rootloader/th1.py +0 -0
- {rootloader-0.4.0 → rootloader-0.4.2}/rootloader/th2.py +0 -0
- {rootloader-0.4.0 → rootloader-0.4.2}/rootloader/tleaf.py +0 -0
|
@@ -39,16 +39,17 @@ class tdirectory(attrdict):
|
|
|
39
39
|
|
|
40
40
|
# keep key if not yet in dict
|
|
41
41
|
if name not in keys.keys():
|
|
42
|
-
keys[name] = key
|
|
42
|
+
keys[name] = (name, key.GetCycle())
|
|
43
43
|
else:
|
|
44
44
|
|
|
45
45
|
# keep key with largest cycle number
|
|
46
|
-
if key.GetCycle() > keys[name]
|
|
47
|
-
keys[name] = key
|
|
46
|
+
if key.GetCycle() > keys[name][1]:
|
|
47
|
+
keys[name] = (name, key.GetCycle())
|
|
48
48
|
|
|
49
49
|
# read trees and histograms from data file
|
|
50
|
-
for name,
|
|
51
|
-
|
|
50
|
+
for name, cycle in tqdm(keys.values(), desc=f'Loading {directory.GetName()}',
|
|
51
|
+
leave=False, total=len(keys)):
|
|
52
|
+
obj = directory.Get(f'{name};{cycle}')
|
|
52
53
|
classname = obj.ClassName()
|
|
53
54
|
|
|
54
55
|
# TTree
|
|
@@ -84,6 +85,9 @@ class tdirectory(attrdict):
|
|
|
84
85
|
if klist:
|
|
85
86
|
klist.sort()
|
|
86
87
|
|
|
88
|
+
# drop hidden variables
|
|
89
|
+
klist = [k for k in klist if k[0] != '_']
|
|
90
|
+
|
|
87
91
|
# get number of columns based on terminal size
|
|
88
92
|
maxsize = max((len(k) for k in klist)) + 2
|
|
89
93
|
terminal_width = os.get_terminal_size().columns - 4 # indent by 4 spaces below
|
|
@@ -128,7 +132,8 @@ class tdirectory(attrdict):
|
|
|
128
132
|
def to_dataframe(self):
|
|
129
133
|
"""Convert all objects possible (th1, th2, and ttree) into pandas dataframes"""
|
|
130
134
|
for k in self.keys():
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
+
if type(self[k]) is not pd.DataFrame:
|
|
136
|
+
try:
|
|
137
|
+
self[k] = self[k].to_dataframe()
|
|
138
|
+
except AttributeError:
|
|
139
|
+
pass
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = '0.4.2'
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = '0.4.0'
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|