Skip to content

Commit

Permalink
chore: update pre-commit hooks (#893)
Browse files Browse the repository at this point in the history
* chore: update pre-commit hooks

updates:
- [github.com/charliermarsh/ruff-pre-commit: v0.0.265 → v0.0.270](astral-sh/ruff-pre-commit@v0.0.265...v0.0.270)

* style: pre-commit fixes

* Somehow, black didn't manage to push changes.

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Jim Pivarski <[email protected]>
  • Loading branch information
pre-commit-ci[bot] and jpivarski authored Jun 2, 2023
1 parent 366e3dc commit 2d24309
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
2 changes: 1 addition & 1 deletion src/uproot/behaviors/TAxis.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion src/uproot/reading.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
32 changes: 30 additions & 2 deletions src/uproot/writing/_cascadetree.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
6 changes: 3 additions & 3 deletions src/uproot/writing/writable.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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):
Expand Down Expand Up @@ -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):
Expand Down

0 comments on commit 2d24309

Please sign in to comment.