diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 945f8c515..26e432def 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -23,7 +23,7 @@ repos: - id: black - repo: https://github.com/charliermarsh/ruff-pre-commit - rev: "v0.0.265" + rev: "v0.0.270" hooks: - id: ruff args: ["--fix", "--show-fixes"] diff --git a/src/uproot/behaviors/TAxis.py b/src/uproot/behaviors/TAxis.py index 64374356e..4b1015278 100644 --- a/src/uproot/behaviors/TAxis.py +++ b/src/uproot/behaviors/TAxis.py @@ -183,7 +183,7 @@ def labels(self, flow=False): if fLabels is not None and len(fLabels) == fNbins: out = [str(x) for x in fLabels] if flow: - return ["underflow", *out] + ["overflow"] + return ["underflow", *out, "overflow"] else: return out else: diff --git a/src/uproot/reading.py b/src/uproot/reading.py index 11ce20944..7cbbb09f5 100644 --- a/src/uproot/reading.py +++ b/src/uproot/reading.py @@ -1484,7 +1484,7 @@ def object_path(self): See :ref:`uproot.reading.ReadOnlyDirectory.path` for the path as a tuple of strings. """ - return "/".join(("", *self._path) + ("",)).replace("//", "/") + return "/".join(("", *self._path, "")).replace("//", "/") @property def file_path(self): diff --git a/src/uproot/writing/_cascadetree.py b/src/uproot/writing/_cascadetree.py index 5601429fc..e05dd45d5 100644 --- a/src/uproot/writing/_cascadetree.py +++ b/src/uproot/writing/_cascadetree.py @@ -983,8 +983,36 @@ def write_anew(self, sink): leaf_title_length = (1 if len(leaf_title) < 255 else 5) + len(leaf_title) leaf_header = numpy.array( - [64, 0, 0, 76, 0, 1, 64, 0, 0, 54, 0, 2, 64, 0] - + [0, 30, 0, 1, 0, 1, 0, 0, 0, 0, 3, 0, 0, 0], + [ + 64, + 0, + 0, + 76, + 0, + 1, + 64, + 0, + 0, + 54, + 0, + 2, + 64, + 0, + 0, + 30, + 0, + 1, + 0, + 1, + 0, + 0, + 0, + 0, + 3, + 0, + 0, + 0, + ], numpy.uint8, ) tmp = leaf_header[0:4].view(">u4") diff --git a/src/uproot/writing/writable.py b/src/uproot/writing/writable.py index 3082f0f9f..dd8f6c2a2 100644 --- a/src/uproot/writing/writable.py +++ b/src/uproot/writing/writable.py @@ -534,7 +534,7 @@ def object_path(self): Path of directory names to this subdirectory as a single string, delimited by slashes. """ - return "/".join(("", *self._path) + ("",)).replace("//", "/") + return "/".join(("", *self._path, "")).replace("//", "/") @property def file_path(self): @@ -1651,7 +1651,7 @@ def object_path(self): Path of directory names to this TTree as a single string, delimited by slashes. """ - return "/".join(("", *self._path) + ("",)).replace("//", "/") + return "/".join(("", *self._path, "")).replace("//", "/") @property def file_path(self): @@ -1994,7 +1994,7 @@ def object_path(self): Path of directory names to this RNTuple as a single string, delimited by slashes. """ - return "/".join(("", *self._path) + ("",)).replace("//", "/") + return "/".join(("", *self._path, "")).replace("//", "/") @property def file_path(self):