Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

[Python] pathlib: Improve compatibility with python

未关闭
#20,482 2 条评论 1 个 reaction 已指派 1 人 在 GitHub 查看

维护者通常 1 天内回复

@vepadulano 已经在做这个了。

开始于 2025年11月24日。

评估

这个 Issue 还没有评估数据。

描述

in:Python Interface new feature
Check duplicate issues.
  • Checked for duplicates
Description

I see all over the place problems when I try to use ROOT with python. This time I see that there is no support for Path objects.

Reproducer
import ROOT
from pathlib import Path
import numpy as np

root_file = ROOT.TFile("example_data.root", "RECREATE")
tree      = ROOT.TTree("myTree", "Example Tree")

x = np.zeros(1, dtype=float)
y = np.zeros(1, dtype=float)
z = np.zeros(1, dtype=float)

tree.Branch("x", x, "x/D")
tree.Branch("y", y, "y/D")
tree.Branch("z", z, "z/D")

for i in range(10):
    x[0] = i
    y[0] = i * 2 + np.random.normal(0, 1)
    z[0] = x[0]**2 + y[0]
    tree.Fill()

tree.Write()
root_file.Close()

file_path = Path("example_data.root")

df = ROOT.RDataFrame("myTree", file_path)
ROOT version

6.36.04

Installation method

mamba

Operating system

almalinux 9

Additional context

Any good out there uses Path, not strings when handling paths.

主要语言
C++
星标
3.3k
派生
1.6k
平均合并
2 天 14 小时
30 天内合并 PR
192

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

root-project/root 的其他 Issue

查看 root-project/root 的全部 Issue

相似的 Issue

更多 C++ Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。