Skip to content

Test superinf#180

Open
WongDWai wants to merge 17 commits into
mainfrom
test-superinf
Open

Test superinf#180
WongDWai wants to merge 17 commits into
mainfrom
test-superinf

Conversation

@WongDWai

@WongDWai WongDWai commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator

issues #175 #176 #177, unit tests for simARG

Comment thread R/InnerTree.R
public = list(
initialize = function(outer, prefix='P', p.index=1) {
private$inner.log <- data.frame(
time=numeric(), # time of event

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

please restore these inline comments

Comment thread R/InnerTree.R

# accessor functions
get.log = function() { private$inner.log },
set.log = function(new.log) { private$inner.log <- new.log },

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

please specify that this is for testing purposes

Comment thread R/InnerTree.R
name=paste(private$prefix, private$p.index, sep="_"),
end.time=time,
)
private$p.index <- private$p.index + 1 # increment counter

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

again please restore inline comment

Comment thread R/InnerTree.R


#' Modify Pathogen names in the inner tree event log to make them unique.
#' This makes it easier to label single nodes (transmission, migration events)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

restore

Comment thread R/Pathogen.R
cat(" Parent:", self$get.parent()$get.name(), "\n")
children <- sapply(self$get.children(), function(child) child$get.name())
cat(" Children:", children, "\n")
cat(" Parents:", sapply(self$get.parents(), function(p) p$get.name()), "\n")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I would prefer these to be listed on the same line (whitespace separated)

Comment thread R/Pathogen.R Outdated
set.parent = function(parent) { private$parent <- parent },
get.parents = function() { private$parents },
get.parent = function() { private$parents[[1]] },
set.parent = function(parent) { private$parents <- list(parent) },

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

need to handle different input types. What if user passes a character or a list?

Comment thread NAMESPACE Outdated
export(sim.dynamics)
export(sim.inner.tree)
export(sim.outer.tree)
export(plot.OuterTree.with.dynamics)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

there should only be one plot.OuterTree method (which is a generic method). Is it possible to modify the existing method to give the user the option to add dynamics with dynamics=TRUE?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

i.e., tuck additional code into an if statement

Comment thread tests/testthat/test_simARG.R Outdated
expect_true(all(bps == as.integer(bps)))
})

test_that("breakpoint positions are unique", {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I don't think breakpoints have to be unique across recombination events.

Comment thread R/InnerTree.R
#' @export
#' @noRd
print.InnerTree <- function(obj) {
cat("twt InnerTree\n") # bold color!

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We can leave this comment out - no longer using bold type face.

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