Skip to content
This repository was archived by the owner on Jun 21, 2022. It is now read-only.

Commit e854fee

Browse files
committed
yes, #36 is fixed; new version 2.5.9
1 parent 020f729 commit e854fee

File tree

5 files changed

+12
-11
lines changed

5 files changed

+12
-11
lines changed

uproot/rootio.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ def read(source, *args, **options):
172172
out = ROOTDirectory(mykey.fName, context, keys)
173173
out.fVersion, out.fDatimeC, out.fDatimeM, out.fNbytesKeys, out.fNbytesName, out.fSeekDir, out.fSeekParent, out.fSeekKeys = fVersion, fDatimeC, fDatimeM, fNbytesKeys, fNbytesName, fSeekDir, fSeekParent, fSeekKeys
174174
out._headerkey = headerkey
175+
out.source = source
175176
return out
176177

177178
finally:

uproot/source/chunked.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ def __init__(self, path, chunkbytes, limitbytes):
4141
self.path = path
4242
self._chunkbytes = chunkbytes
4343
if limitbytes is None:
44-
self._cache = uproot.cache.memorycache.ThreadSafeDict()
44+
self.cache = uproot.cache.memorycache.ThreadSafeDict()
4545
else:
46-
self._cache = uproot.cache.memorycache.ThreadSafeMemoryCache(limitbytes)
46+
self.cache = uproot.cache.memorycache.ThreadSafeMemoryCache(limitbytes)
4747
self._source = None
4848

4949
def parent(self):
@@ -81,10 +81,10 @@ def data(self, start, stop, dtype=None):
8181

8282
for chunkindex in range(chunkstart, chunkstop):
8383
try:
84-
chunk = self._cache[chunkindex]
84+
chunk = self.cache[chunkindex]
8585
except KeyError:
8686
self._open()
87-
chunk = self._cache[chunkindex] = self._read(chunkindex)
87+
chunk = self.cache[chunkindex] = self._read(chunkindex)
8888

8989
cstart = 0
9090
cstop = self._chunkbytes

uproot/source/file.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,10 @@ def threadlocal(self):
5656
out = FileSource.__new__(self.__class__)
5757
out.path = self.path
5858
out._chunkbytes = self._chunkbytes
59-
if isinstance(self._cache, (uproot.cache.memorycache.ThreadSafeMemoryCache, uproot.cache.memorycache.ThreadSafeDict)):
60-
out._cache = self._cache
59+
if isinstance(self.cache, (uproot.cache.memorycache.ThreadSafeMemoryCache, uproot.cache.memorycache.ThreadSafeDict)):
60+
out.cache = self.cache
6161
else:
62-
out._cache = {}
62+
out.cache = {}
6363
out._source = None # local file connections are *not shared* among threads (they're *not* thread-safe)
6464
return out
6565

uproot/source/xrootd.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,10 @@ def threadlocal(self):
7171
out = XRootDSource.__new__(self.__class__)
7272
out.path = self.path
7373
out._chunkbytes = self._chunkbytes
74-
if isinstance(self._cache, (uproot.cache.memorycache.ThreadSafeMemoryCache, uproot.cache.memorycache.ThreadSafeDict)):
75-
out._cache = self._cache
74+
if isinstance(self.cache, (uproot.cache.memorycache.ThreadSafeMemoryCache, uproot.cache.memorycache.ThreadSafeDict)):
75+
out.cache = self.cache
7676
else:
77-
out._cache = {}
77+
out.cache = {}
7878
out._source = self._source # XRootD connections are *shared* among threads (I'm assuming they're thread-safe)
7979
return out
8080

uproot/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030

3131
import re
3232

33-
__version__ = "2.5.8"
33+
__version__ = "2.5.9"
3434
version = __version__
3535
version_info = tuple(re.split(r"[-\.]", __version__))
3636

0 commit comments

Comments
 (0)