Skip to content

Commit

Permalink
Make multi-network construction work with igraph version 2.0.1.1
Browse files Browse the repository at this point in the history
When adding an empty set of artifact vertices to the multi-network,
adding 'no' vertex fails as of igraph 2.0.1.1. This is easily
fixed by checking whether the set of arftiact vertices to add is
empty, and then just don't call the add function if it is empty.

Signed-off-by: Thomas Bock <bockthom@cs.uni-saarland.de>
  • Loading branch information
bockthom committed Feb 9, 2024
1 parent 368e792 commit 5547896
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions util-networks.R
Original file line number Diff line number Diff line change
Expand Up @@ -958,8 +958,10 @@ NetworkBuilder = R6::R6Class("NetworkBuilder",
## to be consistent with bipartite networks
artifacts.to.add.kind[artifacts.to.add.kind == "IssueEvent"] = "Issue"

artifacts.net = artifacts.net + igraph::vertices(artifacts.to.add, type = TYPE.ARTIFACT,
kind = artifacts.to.add.kind)
if (length(artifacts.to.add) > 0) {
artifacts.net = artifacts.net + igraph::vertices(artifacts.to.add, type = TYPE.ARTIFACT,
kind = artifacts.to.add.kind)
}

## check directedness and adapt artifact network if needed
if (igraph::is.directed(authors.net) && !igraph::is.directed(artifacts.net)) {
Expand Down

0 comments on commit 5547896

Please sign in to comment.