scikit-hep / hepconvert

BSD 3-Clause "New" or "Revised" License
11 stars 1 forks source link

root-to-parquet throws errors for invalid values of command line arguments #104

Closed nikoladze closed 2 months ago

nikoladze commented 2 months ago

Thanks for this useful package and the nice talk at the pyhep today!

Steps to reproduce:

pipx install hepconvert

Seems this gave me version 1.3.7 (looking at _version.py in the venv)

Example root file

import uproot
import numpy as np
with uproot.recreate("test.root") as f:
    f["tree1"] = {"b1": np.array([1, 2, 3])}
    f["tree2"] = {"b1": np.array([4, 5, 6])}

Then running on the commandline

hepconvert root-to-parquet test.root test.parquet

Gives

Usage: hepconvert root-to-parquet [OPTIONS] IN_FILE OUT_FILE
Try 'hepconvert root-to-parquet -h' for help.

Error: Invalid value for '-s' / '--step-size': '100 MB' is not a valid integer.

Manually specifying -s 100000 works, but a similar error pops up when i specify the tree name:

hepconvert root-to-parquet -s 100000 -t test1 test.root test.parquet

Gives

Error: Invalid value for '-t' / '--tree': 'test1' is not a valid boolean.
zbilodea commented 2 months ago

Thanks for pointing this out! Added some workarounds so should work now, turns out the CLI package is less flexible than I realized...