Repository navigation
fix: quote dump source, clean CLI errors, single-slash node paths - #325
Conversation
henryiii
left a comment
There was a problem hiding this comment.
🤖 AI text below 🤖
Please reuse the node opened by browse when constructing UprootTree. The new with open_node(spec): pass closes the file after validation, then the tree opens it again. I counted two calls to uproot.open for the same file during one successful local browse invocation. For a file on a network mount, this repeats the open and metadata reads before the tree is usable. Passing the open node to the tree would keep the early CLI error and let the TUI close the file on exit.
2bd9cf8 to
52cb0c3
Compare
|
🤖 AI text below 🤖 Fixed. |
21cf455 to
d4af63c
Compare
- Dump & Quit writes the file path and the keys with repr(), so a backslash or a quote in a name gives valid Python. - tree, plot and browse show a short error for a file that does not open, a key that is not found, or an object that is not plottable. plot closes the file after use. browse opens a local spec once before the TUI starts, to find these errors. - A child of the top node has the path "/key", not "//key". The TUI callers do not strip slashes now. Refs #322 Assisted-by: ClaudeCode:claude-opus-5-5
Refs #322 Assisted-by: ClaudeCode:claude-opus-5-5
browse gives the node it opened to the TUI and closes it after the app exits. Before, it opened the file to find errors, closed it, and the tree opened it again. Refs #322 Assisted-by: ClaudeCode:claude-opus-5-5
Refs #322 Assisted-by: ClaudeCode:claude-opus-5-5
Refs #322 Assisted-by: ClaudeCode:claude-opus-5-5
Refs #322 Assisted-by: ClaudeCode:claude-opus-5-5
d4af63c to
ca65478
Compare
🤖 AI text below 🤖
Items 4, 5 and 6 of #322.
uproot.open(...)andfile[...]userepr()for the path and the keys. A Windows path or a key with a quote now gives valid Python. Test expectations change to the'...'quote style.tree,plotandbrowseraise aclick.ClickExceptionwhen a file does not open (OSError,ValueError), a key is not found (KeyError), or the object is not plottable (or empty). The message includes the original error. Other errors still show a traceback.plotopens the node withwith, so the file closes.browseopens a local spec before the TUI starts and gives the node to the app (newrootargument ofBrowserandUprootTree), so the file opens one time and closes after the app exits. A remote spec still opens in the TUI./key, not//key._below_root,_plot_label,JumpScreen._labeland_path_headerdo not strip extra slashes now. A new_is_belowhelper makes the jump prefix test correct for the top node (/).Refs #322