fix: write GML without explicit vertex IDs#2745
Open
LeonidasZhak wants to merge 1 commit into
Open
Conversation
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
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 and asking for a regression test.
Issue or motivation
Writing any graph as GML currently fails unless the caller supplies one ID per vertex. Earlier versions generated node IDs when none were supplied.
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 both interface layers. The added test writes a graph without IDs and reads it back to confirm graph isomorphism.Tests
air format .devtools::check()with CRANlifecycle1.0.5: all 8,185 package tests passed; 0 errors, with three unchanged local warnings from vendored GLPK and unavailablecheckbashismsScope
Explicit IDs, other file formats, GML serialization details, and vendored C sources are unchanged.
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.