-
-
Notifications
You must be signed in to change notification settings - Fork 200
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
test: test-conversion #1539
base: main
Are you sure you want to change the base?
test: test-conversion #1539
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.
|
expect_identical(colnames(I2), c("h", "i", "j", "k", "l")) | ||
}) | ||
|
||
test_that("as_biadjacency_matrix() works -- dense + attribute", { |
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.
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.
The C core will not support adjacency matrices that contain other values than numbers. This means that we either need to drop support for character adjacency matrices, or we need to implement this behaviour in pure R while making sure to match the C core.
There are several things that don't make much sense with non-numerical adjacency matrices. For example, what do you do with multi-edges? How do you combine their character properties? For plain adjacency matrices, what do you do with self-loops in undirected graphs (whose value is normally doubled in the matrix)?
I'm sure we had a discussion about this in the past, and even reached out to someone who used character matrices (very few people do). But I don't remember the decision. We need to search the issue tracker.
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.
Having the string "0"
for non-existent edges makes no sense to make. Numbers should be numbers and strings should be strings—R is not Perl! 😆
If we really want to support string matrices, wouldn't ""
make a lot more sense?
The question of what is the "null strings" also ties into what w do with self-loops and multi-edges. If the multi-edge combiner operation is string concatenation, then the null string is ""
.
These complications illustrate why I don't particularly like the idea of supporting string matrices.
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 suggest aiming to remove string matrix support, and not producing characterization tests for it. Issue: #1542
See also #1540 |
}) | ||
|
||
test_that("as_biadjacency_matrix() works -- dense", { | ||
I <- matrix(sample(0:1, 35, replace = TRUE, prob = c(3, 1)), ncol = 5) |
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.
Minor nitpick: Let's not call this I
, as that's the standard name for the identity matrix. (It was probably called I
because of "incidence" matrix.)
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.
and good to merge once I fix that?
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 part is good, and this is just an aesthetic nitpick that doesn't necessarily need to be fixed. My main comments are in the other thread in this PR, addressing string matrices. Will open an issue for that soon.
No description provided.