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

Create unit test for join for Vignette 2 #1

Open
hmhummel opened this issue Aug 13, 2024 · 1 comment
Open

Create unit test for join for Vignette 2 #1

hmhummel opened this issue Aug 13, 2024 · 1 comment
Assignees

Comments

@hmhummel
Copy link
Collaborator

hmhummel commented Aug 13, 2024

See issue #2.

I have been able to create join unit tests for Vignettes 1 and #3 because join is called by simplify. However, I have not been able to create the join unit test for Vignette 2 because simplify does not iterate all the way through, although the unit test passes the test_that test.

I created the unit tests for 1 and 3 by running simplify with breakpoints on each vignette (e.g. simplify(P_3_s1 (or s2), topo_3, G_3.unobs, G_3, G_3.obs)) using the browser() function. I added print statements after step 5 in simplify, and printed the J, D, vari, cond, S, M, and O that result after this step. Note that: P$children[[k]]$var = var, P$children[[k]]$cond: = cond, P$sumset[j] = S.

step <- step + 1
    cat("Step", step, "- After topological sorting\n")
    cat("M:", M, "\n")
    cat("O:", O, "\n")
    browser()  # Breakpoint 5: After topological sorting
    
    while (k <= i) {
      step <- step + 1
      cat("Step", step, "- Inside nested while loop before join operation\n")
      cat("P$children[[k]]$var:", P$children[[k]]$var, "\n")
      cat("P$children[[k]]$cond:", P$children[[k]]$cond, "\n")
      cat("P$sumset[j]:", P$sumset[j], "\n")
      browser()  # Breakpoint 6: Before join operation

When I attempt to similarly run simplify with breakpoints for Vignette 2, it only iterates through the first step and skips to step 8 (the last step).

@hmhummel hmhummel self-assigned this Aug 13, 2024
@hmhummel
Copy link
Collaborator Author

hmhummel commented Aug 13, 2024

To address this, I plan to:

  • re-visit the output from causal.effect using expr = FALSE to ensure that the correct input is being used for parse.expression, which calls simplify.
  • update the parse.expression unit test using this input.
  • Then, I can use the output from parse.expression to input into simplify, and update the simplify unit test.
  • I will see if this new input not only passes the test_that unit test, but also iterates correctly through simplify so that I can obtain the inputs for join.

@hmhummel hmhummel changed the title Create unit test for join for Vignette #2 Create unit test for join for Vignette 2 Aug 13, 2024
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

No branches or pull requests

1 participant