refactor: snake_case attr-comb options & arguments, soft-deprecate dotted names - #2742
refactor: snake_case attr-comb options & arguments, soft-deprecate dotted names#2742schochastics wants to merge 5 commits into
Conversation
|
This is how benchmark results would change (along with a 95% confidence interval in relative change) if 1453158 is merged into feat-attrib_comb:
|
1453158 to
2f878f3
Compare
|
This is how benchmark results would change (along with a 95% confidence interval in relative change) if 2f878f3 is merged into main:
|
|
This is how benchmark results would change (along with a 95% confidence interval in relative change) if ba22989 is merged into main:
|
…tted names Rename the attribute-combination options and arguments to snake_case: `edge.attr.comb` -> `edge_attr_combine` and `vertex.attr.comb` -> `vertex_attr_combine`, both as igraph options and as arguments to `simplify()`, `as_undirected()`, and `contract()`. The dotted argument names keep working behind `...` under a single soft-deprecation, via generated ARG_HANDLE blocks driven by the new tools/migrations/attr-comb.R registry file. Dotted option names are soft-deprecated with a warning shim. Also point the stale schema references in sibling registry files and helper comments at tools/migrations/README.md, where the schema documentation lives since the registry was split into per-topic files. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016M32izVHZPfxAqemAe4BrX
ba22989 to
c5de7bb
Compare
Resolve the R/par.R conflict by keeping main's migrated igraph_opt(x, ..., default = NULL) signature and generated ARG_HANDLE block, followed by this branch's dotted-name aliasing (igraph_normalize_par_name()). Declare the compose() dotted -> snake_case argument rename in tools/migrations/operators.R so the regenerated block recovers graph.attr.comb/vertex.attr.comb/edge.attr.comb into the new *_combine arguments; regenerated with tools/generate-migrations.R (idempotent on the second run) and formatted with air. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016M32izVHZPfxAqemAe4BrX
|
This is how benchmark results would change (along with a 95% confidence interval in relative change) if c3cf816 is merged into main:
|
krlmlr
left a comment
There was a problem hiding this comment.
Thanks! Almost good to merge. The one snapshot flagged could be just a symptom of a pattern across the codebase.
|
Needs conflict resolution. |
Resolve the conflicts against the migration infrastructure that moved under this branch while it was open: - #2812 removed the `migrate_recover_args()` runtime helper, so the ARG_HANDLE blocks are now self-contained. Accept the deletion of R/migrate-args.R and regenerate all 231 blocks. - #2784 requires migrated (`new`) defaults to be constant expressions. Express the attr-comb defaults as `NULL` in tools/migrations/attr-comb.R and tools/migrations/operators.R and resolve them in the bodies, as main already does for the dotted names. - main migrated `simplify()`, `as_undirected()`, `contract()` and `compose()` in the meantime; re-apply the snake_case rename on top of main's versions rather than the pre-migration ones. Also address the review feedback on the tests/testthat/_snaps/conversion.md snapshot, where `as.undirected()` emitted two deprecations the caller had not triggered: - The deprecated wrappers `as.undirected()` and `contract.vertices()` read the dotted igraph option and forwarded the dotted argument name, tripping both the option alias and the argument migration on their own behalf. Keep their public dotted arguments and read/forward the canonical names. - `igraph_opt()` / `igraph_options()` never actually emitted the option alias deprecation: `deprecate_soft()` takes its `user_env` from `caller_env(2)`, which resolved to a frame inside igraph and marked every use as indirect. Thread the real caller down to `igraph_normalize_par_name()`. - `graph.attr.comb` was missing from `.igraph.pars.aliases`, so reading the option under its old name returned NULL instead of the renamed value. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
This is how benchmark results would change (along with a 95% confidence interval in relative change) if ec159bd is merged into main:
|
Split out from #2676 per review feedback ("I'd like to review the par code in a separate PR"). #2676 kept the original dotted option/argument names; this PR carries the naming refactor on its own so it can be reviewed in isolation.
What this does
vertex.attr.comb→vertex_attr_combine,edge.attr.comb→edge_attr_combine, and the newgraph.attr.comb→graph_attr_combine. Reading/setting the old dotted keys still works via back-compatible aliasing inigraph_opt()/igraph_options(), emitting a singlelifecycle::deprecate_soft()warning (R/par.R).simplify(),as_undirected()andcontract()gain snake_caseedge_attr_combine/vertex_attr_combinearguments via the argument-migration infrastructure (registry entries intools/migrations/attr-comb.R, spliced byRscript tools/generate-migrations.R; schema intools/migrations/README.md); the dotted names keep working and soft-deprecate.union()/intersection()/compose()/disjoint_union()use the snake_case*_combineargument names.types-RR.yaml), regenerated*_impldefaults, and the affected tests/snapshots.tools/migrations.Rschema references in sibling registry files and helper comments attools/migrations/README.md, where the schema documentation lives since the registry split (refactor(migrations): split the registry into per-topic files #2779).Base branch
#2676 has merged, so this PR is based on
mainand rebased into a single commit on top of it; the attr-comb migration entries live in their own registry filetools/migrations/attr-comb.Rso that the open per-topic migration PRs can append toconversion.R,community.R, etc. without conflicting here.