dguest / pandamonium

Command line scripts to parse panda web api
BSD 3-Clause "New" or "Revised" License
27 stars 17 forks source link

panda-shortname doesn't work with period datasets #9

Open kratsg opened 6 years ago

kratsg commented 6 years ago

I expected this to work:

./panda-shortname data16_13TeV:data16_13TeV.periodI.physics_Main.PhysCont.DAOD_SUSY10.grp16_v03_p3372

but it doesn't since the dataset ID is periodI instead of a number (somewhat unexpected but...)

dguest commented 6 years ago

I've done the somewhat useless thing here and added a help wanted label.

matthewfeickert commented 4 years ago

To maybe pick up this Issue again soon:

$ docker run --rm -it -e USER="${USER}" python:3.8 /bin/bash
# python -m pip install --upgrade -q pip setuptools wheel
# pip install -q pandamonium
# pip list
Package      Version
------------ -------
panda-client 1.4.36
pandamonium  0.1.0
pip          20.2.3
setuptools   50.3.0
wheel        0.35.1
# panda-shortname data16_13TeV:data16_13TeV.periodI.physics_Main.PhysCont.DAOD_SUSY10.grp16_v03_p3372
Traceback (most recent call last):
  File "/usr/local/bin/panda-shortname", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.8/site-packages/pandamonium/panda_shortname.py", line 49, in main
    oname = process_name(ds_name, args.remove, args.prefix, args.suffix)
  File "/usr/local/lib/python3.8/site-packages/pandamonium/panda_shortname.py", line 74, in process_name
    assert dsid.isdigit(), "dsid ({}) not a number".format(dsid)
AssertionError: dsid (periodI) not a number

So currently looking at the code

https://github.com/dguest/pandamonium/blob/2c9951664b541199120530dd0df838086f6c4e4f/src/pandamonium/panda_shortname.py#L73-L74

it seems this could be addressed with an or.

This example is also probably good as a unit test.