refactor(graph-print): improve format_param output and add tests#281
Open
sebffischer wants to merge 1 commit into
Open
refactor(graph-print): improve format_param output and add tests#281sebffischer wants to merge 1 commit into
sebffischer wants to merge 1 commit into
Conversation
Distinguish top-level NULL/empty from nested NULL, show empty atomic vectors as typeof(0), quote character values, and fall back to deparse()/<class> for generic objects. Add unit snapshots covering each branch. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
Author
|
@dfalbel can you please check the CUDA runner? It keeps failing for some reason for some time |
Contributor
|
I have restarted the machine! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
format_param()now handles a few more cases more usefully: top-levelNULLandlist()still print as empty, but aNULLinside a list renders asNULLinstead of silently vanishing. Empty atomic vectors render asinteger(0)/character(0)/logical(0)rather than"". Character values are quoted (\"abc\",c(\"a\", \"b\")). Unknown objects fall back todeparse(x, nlines = 1)or<class>instead of<any>.format_param_value()helper so the top-level empty-case check stays informat_param().format_paramintests/testthat/test-graph-print.Rcovering empty cases, atomic scalars/vectors, empty atomic vectors, named/unnamed lists, nestedNULL, nested lists, dtyperepr, and the graph[n -> m]summary.Test plan
devtools::test(filter = \"graph-print\")— 16 tests pass.tests/testthat/_snaps/graph-print.md.🤖 Generated with Claude Code