-
-
Notifications
You must be signed in to change notification settings - Fork 203
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
feat: Split sample_bipartite()
into two functions for the G(n, m) a…
#1692
base: main
Are you sure you want to change the base?
Conversation
Current Aviator status
This pull request is currently open (not queued). How to mergeTo merge this PR, comment
See the real-time status of this PR on the
Aviator webapp.
Use the Aviator Chrome Extension
to see the status of your PR within GitHub.
|
on.exit( .Call(R_igraph_finalizer) ) | ||
# Function call | ||
res <- .Call(R_igraph_bipartite_game_gnp, n1, n2, p, directed, mode) | ||
res <- set_vertex_attr(res$graph, "type", value = res$types) |
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.
@Antonov548 I mean this line in this and the other function. Furthermore there should be NO
if (igraph_opt("add.vertex.names") && is_named(graph)) {
names(res) <- vertex_attr(graph, "name")
}
Thanks!
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.
Hello @maelle
I just took a look how to update generation to match with existing code. It is just first time we setting vertex attribute in generated interface.
I think I understand why names(res$types) <- vertex_attr(graph, "name", V(graph))
is not needed, but do we really need to set_vertex_attr()
? I just trying to understand it in order to decide how to update stimulus part.
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.
Hi @Antonov548 maybe we could add set_vertex_attr()
in the not automatic code. Let me discuss this with @krlmlr and @schochastics and then I'll update this thread (within the next few weeks). Thank you.
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.
maybe we could add
set_vertex_attr()
in the not automatic code.
Good. To be honest I think not automatic code maybe it better place for setting up the attributes. I will wait for the decision.
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.
If we change in the template, how many functions will be affected?
@Antonov548: Can you please adapt the template and run the generation? We can revert later if needed.
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.
Thanks, let's iterate again.
on.exit( .Call(R_igraph_finalizer) ) | ||
# Function call | ||
res <- .Call(R_igraph_bipartite_game_gnp, n1, n2, p, directed, mode) | ||
res <- set_vertex_attr(res$graph, "type", value = res$types) |
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.
If we change in the template, how many functions will be affected?
@Antonov548: Can you please adapt the template and run the generation? We can revert later if needed.
R/games.R
Outdated
} | ||
|
||
utils::globalVariables("type") |
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 looks odd.
Co-authored-by: Kirill Müller <[email protected]>
) | ||
bipartite_gnm(...) | ||
} else { | ||
cli::cli_abort( |
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 would be the case where the user passes sthg else than NULL
, "gnp" or gnm"."
A few comments here need addressing. |
…nd G(n, p) case
Fix #630
@Antonov548 could you please help me update Stimulus to get the functions as they are now in aaa-auto.R?