Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xrootd file globbing only works for some file + object path specifications #1066

Closed
lgray opened this issue Dec 14, 2023 · 0 comments · Fixed by #1067
Closed

xrootd file globbing only works for some file + object path specifications #1066

lgray opened this issue Dec 14, 2023 · 0 comments · Fixed by #1067
Labels
bug (unverified) The problem described would be a bug, but needs to be triaged

Comments

@lgray
Copy link
Contributor

lgray commented Dec 14, 2023

uproot version: 5.2.0rc5

dict-style file + object path globbing works fine:

>>> import uproot
>>> events = uproot.dask({"root://cmsdcadisk.fnal.gov//dcache/uscmsdisk/store/data/Run2023C/EGamma0/NANOAOD/PromptNanoAODv11p9_v1-v1/*/*.root":"Events"}, open_files=False)
>>> events.Muon_pt
dask.awkward<Muon-pt, npartitions=71>

however, in-string style does not:

>>> events = uproot.dask("root://cmsdcadisk.fnal.gov//dcache/uscmsdisk/store/data/Run2023C/EGamma0/NANOAOD/PromptNanoAODv11p9_v1-v1/*/*.root:Events", open_files=False)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/srv/.env/lib/python3.10/site-packages/uproot/_dask.py", line 164, in dask
    files = uproot._util.regularize_files(files, steps_allowed=True, **options)
  File "/srv/.env/lib/python3.10/site-packages/uproot/_util.py", line 944, in regularize_files
    raise _file_not_found(files)
FileNotFoundError: file not found

    'root://cmsdcadisk.fnal.gov//dcache/uscmsdisk/store/data/Run2023C/EGamma0/NANOAOD/PromptNanoAODv11p9_v1-v1/*/*.root:Events'

Files may be specified as:
   * str/bytes: relative or absolute filesystem path or URL, without any colons
         other than Windows drive letter or URL schema.
         Examples: "rel/file.root", "C:\abs\file.root", "http://where/what.root"
   * str/bytes: same with an object-within-ROOT path, separated by a colon.
         Example: "rel/file.root:tdirectory/ttree"
   * pathlib.Path: always interpreted as a filesystem path or URL only (no
         object-within-ROOT path), regardless of whether there are any colons.
         Examples: Path("rel:/file.root"), Path("/abs/path:stuff.root")

Functions that accept many files (uproot.iterate, etc.) also allow:
   * glob syntax in str/bytes and pathlib.Path.
         Examples: Path("rel/*.root"), "/abs/*.root:tdirectory/ttree"
   * dict: keys are filesystem paths, values are objects-within-ROOT paths.
         Example: {"/data_v1/*.root": "ttree_v1", "/data_v2/*.root": "ttree_v2"}
   * already-open TTree objects.
   * iterables of the above.

@lgray lgray added the bug (unverified) The problem described would be a bug, but needs to be triaged label Dec 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug (unverified) The problem described would be a bug, but needs to be triaged
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant