Skip to content

Commit

Permalink
Corrected manynet dependencies and net_ naming in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jhollway committed Jun 23, 2024
1 parent 1daea5a commit 8137de6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions R/model_tests.R
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ test_random <- function(.data, FUN, ...,
} else {
obsd <- FUN(.data)
}
n <- manynet::network_dims(.data)
d <- network_density(.data)
n <- manynet::net_dims(.data)
d <- manynet::net_density(.data)
oplan <- future::plan(strategy)
on.exit(future::plan(oplan), add = TRUE)
rands <- furrr::future_map(1:times, manynet::generate_random, n = n, p = d,
Expand Down Expand Up @@ -90,8 +90,8 @@ test_permutation <- function(.data, FUN, ...,
} else {
obsd <- FUN(.data)
}
n <- manynet::network_dims(.data)
d <- network_density(.data)
n <- manynet::net_dims(.data)
d <- manynet::net_density(.data)
oplan <- future::plan(strategy)
on.exit(future::plan(oplan), add = TRUE)
rands <- furrr::future_map(1:times,
Expand Down
8 changes: 4 additions & 4 deletions tests/testthat/test-model_tests.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
marvel_friends <- manynet::to_giant(manynet::to_unsigned(manynet::ison_marvel_relationships)) %>%
manynet::to_subgraph(PowerOrigin == "Human")
cugtest <- test_random(marvel_friends,
network_heterophily,
manynet::net_heterophily,
attribute = "Attractive",
times = 200)
cugtest2 <- test_random(marvel_friends,
network_betweenness,
manynet::net_betweenness,
times = 200)
cugtest3 <- test_random(ison_southern_women,
network_equivalency,
manynet::net_equivalency,
times = 200)

test_that("test_random works", {
Expand Down Expand Up @@ -42,7 +42,7 @@ marvel_friends <- manynet::to_unsigned(manynet::ison_marvel_relationships)
marvel_friends <- manynet::to_giant(marvel_friends)
marvel_friends <- manynet::to_subgraph(marvel_friends, PowerOrigin == "Human")
qaptest <- test_permutation(marvel_friends,
network_heterophily,
manynet::net_heterophily,
attribute = "Attractive",
times = 200)
test_that("test_permutation works", {
Expand Down

0 comments on commit 8137de6

Please sign in to comment.