Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
km3io
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
km3py
km3io
Commits
12bedaf9
Commit
12bedaf9
authored
5 years ago
by
Tamas Gal
Browse files
Options
Downloads
Plain Diff
Merge branch 'ktools' into 'master'
Ktools See merge request
!2
parents
9ea6d2f2
4ddcafbd
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!2
Ktools
Pipeline
#7526
passed with warnings
5 years ago
Stage: test
Stage: coverage
Stage: doc
Stage: deploy
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
km3io/utils/kprinttree.py
+38
-0
38 additions, 0 deletions
km3io/utils/kprinttree.py
requirements.txt
+1
-0
1 addition, 0 deletions
requirements.txt
setup.py
+5
-0
5 additions, 0 deletions
setup.py
with
44 additions
and
0 deletions
km3io/utils/kprinttree.py
0 → 100644
+
38
−
0
View file @
12bedaf9
#!/usr/bin/env python
# coding=utf-8
# Filename: kprinttree.py
# Author: Tamas Gal <tgal@km3net.de>
"""
Print the available ROOT trees.
Usage:
kprinttree.py FILENAME
kprinttree.py (-h | --help)
Options:
-h --help Show this screen.
"""
import
uproot
def
print_tree
(
filename
):
f
=
uproot
.
open
(
filename
)
for
key
,
ttree
in
f
.
items
():
try
:
print
(
"
{} : {}
"
.
format
(
key
.
decode
(),
len
(
ttree
)))
except
TypeError
:
print
(
"
{}
"
.
format
(
key
.
decode
()))
def
main
():
from
docopt
import
docopt
args
=
docopt
(
__doc__
)
print_tree
(
args
[
'
FILENAME
'
])
if
__name__
==
'
__main__
'
:
main
()
This diff is collapsed.
Click to expand it.
requirements.txt
+
1
−
0
View file @
12bedaf9
docopt
uproot
>=3.10.12
setuptools_scm
This diff is collapsed.
Click to expand it.
setup.py
+
5
−
0
View file @
12bedaf9
...
...
@@ -32,6 +32,11 @@ setup(
},
install_requires
=
requirements
,
python_requires
=
'
>=3.5
'
,
entry_points
=
{
'
console_scripts
'
:
[
'
KPrintTree=km3io.utils.kprinttree:main
'
]
},
classifiers
=
[
'
Intended Audience :: Developers
'
,
'
Intended Audience :: Science/Research
'
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment