Uproot.dask fails to open files with names like myfile.root.1
#1097
Replies: 4 comments
-
@gordonwatts thanks for reporting this! I suspect this will follow from recent changes to our file name handling. @lobis any clues? :) |
Beta Was this translation helpful? Give feedback.
-
Yes, this is expected behaviour that was added at some point in the 5.2.0 release. There should be a mention in the release notes but I haven't checked (at least there was a PR with this). We chose to only support files ending in You can always use the |
Beta Was this translation helpful? Give feedback.
-
That's right: the colon syntax has been hard to maintain, so Uproot 5.2.x simplified it. I used to keep a list of Issues and Discussions about it, but it's more than a dozen now. Page 19 of this talk shows a screenshot of all those issues and an analysis of user code, which demonstrates that people do use it and we can't get rid of it. So now we only support I'm going to make this a Discussion because it's not a work-item but it would be useful for others to (hopefully) find if they run into it. |
Beta Was this translation helpful? Give feedback.
-
Thanks! This makes sense. I like the dictionary approach better as well. I just couldn't understand why it was failing. Perhaps a possible addition could be if you find a colon in the filename that doesn't have root next to it and the file doesn't exist, that the My impression from the docs is that you lose functionality when you do this - you can't chunk a file automatically any longer with this dictionary syntax. Is that right? I'd like to do something like tell I am specifically referring to this line in the |
Beta Was this translation helpful? Give feedback.
-
Reproducing:
You need a small root file - like
myfile.root
. I'm going to assume the tree inmyfile.root
you want to open is calledmytree
:myfile.root
tomyfile.root.1
import uproot
uproot.dask('myfile.root.1:mytree')
Why would you name a file like this?
The ATLAS production system often names files with the
.1
for whatever reason. As a result, I often find myself accessing files with names like that.Workaround
Use the dictionary specification method:
uproot.dask({ 'myfile.root.1': 'mytree'})
Beta Was this translation helpful? Give feedback.
All reactions