Skip to content

🐛 🧪 fix test bug #12

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

Merged
merged 1 commit into from
Jul 10, 2025
Merged

🐛 🧪 fix test bug #12

merged 1 commit into from
Jul 10, 2025

Conversation

clorton
Copy link
Contributor

@clorton clorton commented Jul 10, 2025

A couple of typos in tests.

@clorton clorton requested review from gilesjohnr and Copilot July 10, 2025 00:12
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Fixes typos in test code where baseline parameters were referenced incorrectly.

  • Use baseline$beta_j0_hum instead of model$params$beta_j0_hum
  • Correct b1 assignments to use baseline$b_1_j in two test blocks

@@ -14,14 +14,14 @@ testthat::test_that("beta_j_seasonality matches", {
time_names <- seq(as.Date(model$params$date_start), as.Date(model$params$date_stop), 1)
location_names <- model$params$location_name

beta_j0_hum <- model$params$beta_j0_hum
beta_j0_hum <- baseline$beta_j0_hum
Copy link
Preview

Copilot AI Jul 10, 2025

Choose a reason for hiding this comment

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

The test was previously pulling beta_j0_hum from model$params which is incorrect; it should reference baseline$beta_j0_hum as intended.

Copilot uses AI. Check for mistakes.

beta_jt_hum_model <- model$patches$beta_jt_human
beta_jt_hum_expected <- matrix(NA_real_, nrow = length(time_names), ncol = length(location_names))

# Baseline Fourier seasonality terms
a1 <- baseline$a_1_j
a2 <- baseline$a_2_j
b1 <- baseline$a_1_j
b1 <- baseline$b_1_j
Copy link
Preview

Copilot AI Jul 10, 2025

Choose a reason for hiding this comment

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

Fixed a typo where b1 was assigned from baseline$a_1_j; it should use baseline$b_1_j to match the model definition.

Copilot uses AI. Check for mistakes.

@@ -388,7 +388,7 @@ testthat::test_that("spatial hazard calculations match", {

a1 <- baseline$a_1_j
a2 <- baseline$a_2_j
b1 <- baseline$a_1_j
b1 <- baseline$b_1_j
Copy link
Preview

Copilot AI Jul 10, 2025

Choose a reason for hiding this comment

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

Similarly, this b1 assignment in the spatial hazard test was pulling from a_1_j by mistake; updated to baseline$b_1_j.

Copilot uses AI. Check for mistakes.

@gilesjohnr gilesjohnr merged commit a489834 into main Jul 10, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants