Skip to content

test: Add tests for isomorphisms() and subgraph_isomorphisms()#1225

Merged
aviator-app[bot] merged 1 commit intomainfrom
f-iso-tests
Feb 8, 2024
Merged

test: Add tests for isomorphisms() and subgraph_isomorphisms()#1225
aviator-app[bot] merged 1 commit intomainfrom
f-iso-tests

Conversation

@krlmlr
Copy link
Copy Markdown
Contributor

@krlmlr krlmlr commented Feb 8, 2024

Follow-up to #1219.

@aviator-app
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
@aviator-app aviator-app bot deleted the f-iso-tests branch February 8, 2024 22:47
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 8, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants