-
-
Notifications
You must be signed in to change notification settings - Fork 206
feat: standardize optional vertex parameters to use NULL default
#2436
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
- Change default from `vid=0` to `vid=NULL` in YAML config - Update Stimulus R generator to pass -1 (instead of 0) for optional VERTEX when NULL - Update optional_wrapper_r to properly handle multi-line INCONV blocks - Fix R auto-generated code to wrap length checks inside NULL checks - Fix .Call to pass NULL correctly for optional vertex parameters - Affects: random_spanning_tree, fundamental_cycles, vertex_path_from_edge_path Co-authored-by: krlmlr <[email protected]>
Update sample_spanning_tree function in R/trees.R to use `vid = NULL` as default and update documentation accordingly. Co-authored-by: krlmlr <[email protected]>
NULL default
krlmlr
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot: Merge main, resolve conflicts as needed, and obey updated instructions.
R/aaa-auto.R
Outdated
| R_igraph_fundamental_cycles, | ||
| graph, | ||
| start - 1, | ||
| if (!is.null(start)) start - 1 else NULL, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this logic should leave outside of the call. Above in if (!is.null(start)) { also already make start <- start - 1 and here in .Call just have start - 1 (I understand this means changing the Stimulus config file).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in a788d99. The subtraction now happens in the if (!is.null(start)) { block, and .Call() just passes start directly.
R/aaa-auto.R
Outdated
| R_igraph_random_spanning_tree, | ||
| graph, | ||
| vid - 1 | ||
| if (!is.null(vid)) vid - 1 else NULL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same comment as above
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in a788d99 (same change as for fundamental_cycles_impl).
src/cpp11.dd
Outdated
| cpp11.o: \ | ||
| cpp11.cpp \ | ||
| igraph_types.hpp \ | ||
| /home/runner/work/_temp/Library/cpp11/include/cpp11.hpp \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this seems spurious
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in edbb220. The system headers have been removed from cpp11.dd and rinterface.dd.
|
@copilot: Merge |
Move the `- 1` subtraction for optional VERTEX parameters from .Call() into the INCONV block (inside the NULL check) as requested by @maelle. This improves code clarity by keeping all parameter transformations together. Changes: - Modified Stimulus R generator to add subtraction inside optional_wrapper_r for VERTEX type - Updated CALL handling to pass VERTEX name directly for optional parameters - Regenerated R/aaa-auto.R with cleaner code structure Co-authored-by: krlmlr <[email protected]>
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.