fix: write GML without explicit vertex IDs - #2745
Conversation
|
LGTM if CI is green |
|
Working on fixing checks on main, let's merge main into this branch when done to get it green. |
SummaryMerged the current Thanks to maintainersThanks for reviewing the fix and for the guidance on when to refresh the branch. Issue or motivationThe branch was seven commits behind Root causeThe previous PR checks ran against the older base at ChangeMerged Tests
ScopeThis update only syncs the PR with |
|
Quick follow-up on the CI gate: the PR is still mergeable and the GML patch is unchanged after the requested Could a maintainer approve or re-run those workflows when convenient? I’m happy to refresh the branch again if the current base requires it. |
Summary
Allow
write_graph(..., format = "gml")to use the GML writer's default vertex IDs whenidis omitted. Fixes #2710.Thanks to maintainers
Thanks for triaging the report, requesting a regression test, refreshing the branch, and re-running the checks.
Issue or motivation
Writing a graph as GML currently fails unless the caller supplies one ID per vertex. Earlier versions generated node IDs when none were supplied, and the C writer still supports that path.
Root cause
Stimulus treated the C writer's nullable
idpointer as a required vector. The generated R wrapper convertedNULLtonumeric(0), so C received an empty vector instead of a null pointer and rejected its length.Change
Mark
idas optional in the Stimulus metadata and regenerate the R/C interface layers. The added regression test writes a graph without IDs and reads it back to confirm graph isomorphism.The branch is now merged through
igraph/rigraph@a52ba87and remains mergeable against the currentmain; the PR diff is still limited to the GML interface metadata, generated wrapper/C interface, and the focused regression test.Tests
air format --check .test-foreign.R: 18 passed, 0 failed, 0 warnings.testthat::test_local(reporter = "check", stop_on_failure = TRUE): 9208 passed, 0 failed, 3 skipped.R CMD build: succeeded, including vignette creation.R CMD check --no-manual: package tests and vignette rebuild passed; local status was2 WARNINGsfrom vendored GLPK/compiler diagnostics, with no errors or notes.rccrun 33739775688, attempt 2: succeeded. Its jobs included the stock-R smoke test, matrix collection, pkgdown build, and R CMD check jobs on macOS, Windows, Windows ARM, Ubuntu, and Ubuntu ARM for R 4.2 through devel. The separate benchmark receive workflow was skipped.Scope
This does not change explicit IDs, other graph writers, GML serialization details, vendored GLPK, unrelated lifecycle/CI behavior, or the igraph C library.
I used AI assistance to help check for issues, refine the code, and run tests.
I'm fine with GPL 2 or later and FDL.