Skip to content
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: Add tests for isomorphisms() and subgraph_isomorphisms() #1225

Merged
merged 1 commit into from
Feb 8, 2024

Conversation

krlmlr
Copy link
Contributor

@krlmlr krlmlr commented Feb 8, 2024

Follow-up to #1219.

Copy link
Contributor

aviator-app bot commented Feb 8, 2024

Current Aviator status

Aviator will automatically update this comment as the status of the PR changes.
Comment /aviator refresh to force Aviator to re-examine your PR (or learn about other /aviator commands).

This PR was merged using Aviator.


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.

@krlmlr krlmlr requested a review from szhorvat February 8, 2024 21:22
Comment on lines +45 to +53
test_that("isomorphisms works", {
motif <- make_empty_graph(directed = FALSE) +
vertices("D1", "D2", type = c("type1", "type1")) +
edges("D1", "D2", type = c("type2"))
subgraph_isomorphisms(
target = motif, pattern = motif, method = "vf2",
vertex.color1 = 2:1, vertex.color2 = 1:2
)
})
Copy link
Member

@szhorvat szhorvat Feb 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The type attribute is unused here. It's not useless to test with target and pattern the same, but normally they should be different, and pattern should be smaller.

For example, let target be a make_ring(10,circular=T) and pattern a make_ring(5, circular=F).

Also, the title should say subgraph isomorphism.

Comment on lines +67 to +77
test_that("subgraph_isomorphisms works", {
motif <- make_empty_graph(directed = FALSE) +
vertices("D1", "D2", type = c("type1", "type1")) +
edges("D1", "D2", type = c("type2"))
out <- subgraph_isomorphisms(
target = motif, pattern = motif, method = "vf2",
vertex.color1 = 2:1, vertex.color2 = 1:2
)
expect_length(out, 1)
expect_equal(as.numeric(out[[1]]), 2:1)
})
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is near-identical to the first one, can the redundancy be reduced?

@aviator-app aviator-app bot merged commit 8b1420e into main Feb 8, 2024
14 checks passed
@aviator-app aviator-app bot deleted the f-iso-tests branch February 8, 2024 22:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants