• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

daniel1noble / BACE / 25330902065
91%

Build:
DEFAULT BRANCH: main
Ran 04 May 2026 04:41PM UTC
Jobs 1
Files 15
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

04 May 2026 04:38PM UTC coverage: 67.466% (+0.05%) from 67.412%
25330902065

push

github

daniel1noble
Fix two source bugs in sim_bace + add numerical correctness tests

While writing the numerical-correctness test fixtures (test-numerical
_correctness.R) I tripped over two real source bugs:

1. sim_bace produced a lowercase 'species' column. The rest of BACE
   (bace_imp examples, bundled .rda datasets, ran_phylo_form
   conventions) uses capital 'Species'. This forced anyone feeding
   sim_bace output into bace_imp to rename the column first --
   easy to miss, no helpful error message. Fixed by emitting
   'Species' directly from sim_bace's output assembly.

2. generate_default_beta_matrix(n_predictors = 1) crashed with
   "subscript out of bounds": R's `2:1` ⇒ c(2, 1) quirk fed
   beta_matrix[2, 1] on a 1x1 matrix. Fixed by guarding the inner
   loop behind n_predictors >= 2 and adding an n_predictors < 1
   error.

Both fixes have explicit regression tests in test-simulate.R
(test_that "sim_bace output uses 'Species'" / "generate_default_beta
_matrix handles n_predictors = 1 cleanly").

New file tests/testthat/test-numerical_correctness.R adds 5 tests
that go beyond the existing shape/structure smoke tests to verify
BACE actually recovers known structure under controlled simulation:

  - BACE imputed values correlate with truth on hidden cells when
    phylogenetic signal is high (40 spp, signal=0.8: r > 0.30).
  - BACE outperforms a column-mean baseline (80 spp, signal=0.8,
    averaged over the last 3 imputation runs: bace_rmse < 0.95 *
    baseline_rmse).
  - phylo_signal_summary recovers a known simulated lambda > 0.30
    when signal=0.9 (typical estimate ~ 0.5 at n=60).
  - pool_posteriors produces a well-formed pooled MCMCglmm with
    finite Sol and positive intercept variance.
  - assess_convergence runs successfully on both short (under-
    converged) and long (more-converged) chains -- tracks summary
    stability without insisting on flaky pass/fail thresholds.

All gated with skip_on_cran() so they execute in the GHA workflow
(NOT_CR... (continued)

9 of 9 new or added lines in 2 files covered. (100.0%)

2476 of 3670 relevant lines covered (67.47%)

53.59 hits per line

Jobs
ID Job ID Ran Files Coverage
1 25330902065.1 04 May 2026 04:41PM UTC 15
67.47
GitHub Action Run
Source Files on build 25330902065
  • Tree
  • List 15
  • Changed 2
  • Source Changed 2
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #25330902065
  • ca8265e1 on github
  • Prev Build on main (#25330420143)
  • Next Build on main (#25331293731)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc