-
Notifications
You must be signed in to change notification settings - Fork 15
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
Distinguish directedness of author networks and edge-construction algorithm #137
Changes from 5 commits
4fc59a0
1e4fe10
7747d61
5cfc5ae
49b4946
70b3c82
1a61ab2
eebdfc8
ebae9f8
9d2ab4b
c66321e
fd0b07d
53cae32
38e7c5d
549ad60
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -470,8 +470,12 @@ Updates to the parameters can be done by calling `NetworkConf$update.variables(. | |
* **Note**: The author--artifact relation in bipartite and multi networks is configured by `artifact.relation`! | ||
* possible values: [*`"mail"`*, `"cochange"`, `"issue"`] | ||
- `author.directed` | ||
* The (time-based) directedness of edges in an author network | ||
* The directedness of edges in an author network | ||
* [`TRUE`, *`FALSE`*] | ||
- `respect.temporal.order` | ||
* Denotes whether the temporal order of activities shall be respected when constructing author networks. When respecting the temporal order, there will be only one edge for the later of two corresponding events between two authors. Otherwise, there will be mutual edges. (For instance, when constructing author networks with relation mail, there will be only an edge for an answer in a mail thread to the autors of every previous e-mail in this mail thread if the temporal order is respected. If the temporal order is not respected, there is an edge for every answer to all the authors of the previous e-mails in the mail thread, but also an edge for every previously sent e-mail from its author to the author of each subsequent mail in this mail thread.) | ||
* **Note**: If no value is speficied (i.e., `NA` is used), the value of `author.directed` is used for determining whether to respect the temporal order during edge construction. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
* [`TRUE`, `FALSE`, *`NA`*] | ||
- `author.all.authors` | ||
* Denotes whether all available authors (from all analyses and data sources) shall be added to the network as a basis | ||
* **Note**: Depending on the chosen author relation, there may be isolates then | ||
|
@@ -484,8 +488,8 @@ Updates to the parameters can be done by calling `NetworkConf$update.variables(. | |
* **Note**: Additionally, this relation configures also the author--artifact relation in bipartite and multi networks! | ||
* possible values: [*`"cochange"`*, `"callgraph"`, `"mail"`, `"issue"`] | ||
- `artifact.directed` | ||
* The (time-based) directedness of edges in an artifact network | ||
* **Note**: This parameter does not take effect for now, as the co-change relation is always undirected, while the call-graph relation is always directed. | ||
* The directedness of edges in an artifact network | ||
* **Note**: This parameter does not take effect for now, as the `cochange` relation is always undirected, while the `callgraph` relation is always directed. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would just neglect that (at least for now), as there will be edges, at least, for the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would like to mention all relations, especially, since there is the full list of relations listed right above (under There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is ok, I just added a sentence for the other relations there. |
||
* [`TRUE`, *`FALSE`*] | ||
- `edge.attributes` | ||
* The list of edge-attribute names and information | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,7 @@ | |
## Copyright 2017 by Christian Hechtl <[email protected]> | ||
## Copyright 2017 by Felix Prasse <[email protected]> | ||
## Copyright 2018 by Barbara Eckl <[email protected]> | ||
## Copyright 2018 by Thomas Bock <[email protected]> | ||
## All Rights Reserved. | ||
|
||
|
||
|
@@ -238,6 +239,47 @@ test_that("Network construction of the undirected author-cochange network", { | |
expect_true(igraph::identical_graphs(network.built, network.expected)) | ||
}) | ||
|
||
test_that("Network construction of the undirected but temorally ordered author-cochange network", { | ||
|
||
## configurations | ||
proj.conf = ProjectConf$new(CF.DATA, CF.SELECTION.PROCESS, CASESTUDY, ARTIFACT) | ||
proj.conf$update.value("artifact.filter.base", FALSE) | ||
net.conf = NetworkConf$new() | ||
net.conf$update.values(updated.values = list(author.relation = "cochange", respect.temporal.order = TRUE)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you please additionally set |
||
|
||
## construct objects | ||
proj.data = ProjectData$new(project.conf = proj.conf) | ||
network.builder = NetworkBuilder$new(project.data = proj.data, network.conf = net.conf) | ||
|
||
## build network | ||
network.built = network.builder$get.author.network() | ||
|
||
## vertex attributes | ||
authors = data.frame(name = c("Björn", "Olaf", "Karl", "Thomas"), | ||
kind = TYPE.AUTHOR, | ||
type = TYPE.AUTHOR) | ||
|
||
## edge attributes | ||
data = data.frame(comb.1. = c("Olaf", "Karl", "Thomas", "Thomas"), | ||
comb.2. = c("Björn", "Olaf", "Olaf", "Karl"), | ||
date = get.date.from.string(c("2016-07-12 16:00:45", "2016-07-12 16:06:10", | ||
"2016-07-12 16:06:32", "2016-07-12 16:06:32")), | ||
artifact.type = "Feature", | ||
hash = c("5a5ec9675e98187e1e92561e1888aa6f04faa338", "1143db502761379c2bfcecc2007fc34282e7ee61", | ||
"0a1a5c523d835459c42f33e863623138555e2526", "0a1a5c523d835459c42f33e863623138555e2526"), | ||
file = c("test.c", "test3.c", "test2.c", "test2.c"), | ||
artifact = c("A", "Base_Feature", "Base_Feature", "Base_Feature"), | ||
weight = 1, | ||
type = TYPE.EDGES.INTRA, | ||
relation = "cochange" | ||
) | ||
|
||
## build expected network | ||
network.expected = igraph::graph.data.frame(data, directed = FALSE, vertices = authors) | ||
|
||
expect_true(igraph::identical_graphs(network.built, network.expected)) | ||
}) | ||
|
||
test_that("Network construction of the directed author-cochange network", { | ||
|
||
## configurations | ||
|
@@ -279,6 +321,52 @@ test_that("Network construction of the directed author-cochange network", { | |
expect_true(igraph::identical_graphs(network.built, network.expected)) | ||
}) | ||
|
||
test_that("Network construction of the directed author-cochange network without respecting temporal order", { | ||
|
||
## configurations | ||
proj.conf = ProjectConf$new(CF.DATA, CF.SELECTION.PROCESS, CASESTUDY, ARTIFACT) | ||
proj.conf$update.value("artifact.filter.base", FALSE) | ||
net.conf = NetworkConf$new() | ||
net.conf$update.values(updated.values = list(author.relation = "cochange", author.directed = TRUE, | ||
respect.temporal.order = FALSE)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The indentation is wrong here. |
||
|
||
## construct objects | ||
proj.data = ProjectData$new(project.conf = proj.conf) | ||
network.builder = NetworkBuilder$new(project.data = proj.data, network.conf = net.conf) | ||
|
||
## build network | ||
network.built = network.builder$get.author.network() | ||
|
||
## vertex attributes | ||
authors = data.frame(name = c("Björn", "Olaf", "Karl", "Thomas"), | ||
kind = TYPE.AUTHOR, | ||
type = TYPE.AUTHOR) | ||
|
||
## edge attributes | ||
data = data.frame(comb.1. = c("Björn", "Björn", "Olaf", "Olaf", "Olaf", "Olaf", "Karl", "Karl"), | ||
comb.2. = c("Olaf", "Olaf", "Karl", "Karl", "Thomas", "Thomas", "Thomas", "Thomas"), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unfortunately, the easy fix for issue #6 will not be as easy as expected... 😞 The network constructed here is – sadly – wrong! The idea was that, in a network ignoring the temporal order of events (i.e.,
Okay, how do we solve this? In the last hours, I debugged this and prepared a patch in the end. Unfortunately, this temporarily breaks some network tests with issue data because the order of edges is messed up. Please add the patch to your branch and fix the tests. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh, now I know what I did forget to do. Before opening this PR, I wanted to check something but did not remember any more what I had wanted to check. When I have read your comment, I remembered again, that I wanted to check for the edge directions again. I am sorry for that. Moreover, it was not intended that it is your job to spend hours on debugging that. I would just have been fine with a review comment like "the edge directions are wrong here, please debug that". I will have a look at your patch tomorrow and also will fix the other tests. That's the least I can do. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I guess, everybody knows that feeling. 😁
Sorry for the misleading formulation. For the patch, I needed only some short time, I just spent some further time on debugging what was happening inside
You are welcome. Keep me posted. |
||
date = get.date.from.string(c("2016-07-12 15:58:59", "2016-07-12 16:00:45", "2016-07-12 16:05:41", | ||
"2016-07-12 16:06:10", "2016-07-12 16:05:41", "2016-07-12 16:06:32", | ||
"2016-07-12 16:06:10", "2016-07-12 16:06:32")), | ||
artifact.type = "Feature", | ||
hash = c("72c8dd25d3dd6d18f46e2b26a5f5b1e2e8dc28d0", "5a5ec9675e98187e1e92561e1888aa6f04faa338", | ||
"3a0ed78458b3976243db6829f63eba3eead26774", "1143db502761379c2bfcecc2007fc34282e7ee61", | ||
"3a0ed78458b3976243db6829f63eba3eead26774", "0a1a5c523d835459c42f33e863623138555e2526", | ||
"1143db502761379c2bfcecc2007fc34282e7ee61", "0a1a5c523d835459c42f33e863623138555e2526"), | ||
file = c("test.c", "test.c", "test2.c", "test3.c", "test2.c", "test2.c", "test3.c", "test2.c"), | ||
artifact = c("A", "A", "Base_Feature", "Base_Feature", "Base_Feature", "Base_Feature", | ||
"Base_Feature", "Base_Feature"), | ||
weight = 1, | ||
type = TYPE.EDGES.INTRA, | ||
relation = "cochange" | ||
) | ||
|
||
## build expected network | ||
network.expected = igraph::graph.data.frame(data, directed = TRUE, vertices = authors) | ||
|
||
expect_true(igraph::identical_graphs(network.built, network.expected)) | ||
}) | ||
|
||
test_that("Network construction of the undirected simplified author-cochange network", { | ||
|
||
## configurations | ||
|
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 like this description, but it seems a bit long for this list. What do you think about moving most of this description to the subsection
Relations
in the SectionNetwork construction
(or a new subsection)? There, we would have enough space to also insert the table from issue #6 (or an equivalent illustration).Alternatively, we could introduce an
**Example**
item as forskip.threshold
. 😉 Although, I think that a new section as suggested above would be more appropriate as the matter is quite important.Additionally:
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.
Adding all the information regarding network construction would overload the
Relations
section. Therefore, I would add a new section after theRelations
section, namedDifferent edge-construction algorithms for author networks
. There we can add also the table from issue #6.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 like the heading for the new subsection, although, I would remove the "Different".