Skip to content

fix: crash when omega fit fails alongside other scale coefficients - #344

Open
juliuspfadt wants to merge 1 commit into
jasp-stats:masterfrom
juliuspfadt:fix/omega-se-missing-on-failure
Open

fix: crash when omega fit fails alongside other scale coefficients#344
juliuspfadt wants to merge 1 commit into
jasp-stats:masterfrom
juliuspfadt:fix/omega-se-missing-on-failure

Conversation

@juliuspfadt

Copy link
Copy Markdown
Collaborator

Summary

  • se (and conf for the PFA path) for scaleOmega was never set when the omega fit failed (CFA Heywood case / non-convergence, or PFA NA), while est/conf always got an entry — the resulting length mismatch crashed dt$se <- unlist(...) in .frequentistScaleTable whenever omega was selected alongside another coefficient (e.g. Alpha).
  • Both failure branches now set se (and conf for PFA) to NA, so the scale table renders the omega row as blank with the existing explanatory footnote instead of crashing.

Fixes jasp-issues#4477.

Test plan

  • Added tests/testthat/reliabilityOmegaHeywood.csv — near-collinear items that force a CFA Heywood-case failure.
  • Added regression tests asserting analysis status stays "complete" and the scale table shows the NA omega row.
  • Full suite: testAll() — 393 pass, 0 fail.

🤖 Generated with Claude Code

@codecov-commenter

codecov-commenter commented Aug 14, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 33.33333% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 86.91%. Comparing base (7b82e4a) to head (66fabac).

Files with missing lines Patch % Lines
R/reliabilityUnidimensionalFrequentist.R 33.33% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #344      +/-   ##
==========================================
+ Coverage   86.79%   86.91%   +0.12%     
==========================================
  Files          14       14              
  Lines        4353     4356       +3     
==========================================
+ Hits         3778     3786       +8     
+ Misses        575      570       -5     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@juliuspfadt
juliuspfadt requested review from FBartos and a lite review from Copilot August 14, 2026 13:53

Copilot AI left a comment

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.

Pull request overview

Fixes a crash in the JASP Reliability frequentist unidimensional analysis when omega computation fails (CFA Heywood/non-convergence or PFA NA) while other scale coefficients are also selected, by ensuring se (and conf for the PFA-failure path) are always populated so the scale table can render NA/blank cells instead of erroring.

Changes:

  • Set out[["se"]][["scaleOmega"]] <- NA for omega CFA-failure and PFA-failure branches (and set conf to c(NA, NA) for PFA failure) to keep result vectors aligned.
  • Added a regression test + minimal dataset reproducing omega CFA failure alongside other coefficients and asserting analysis remains "complete" and the omega row is blank/NA.
  • Documented the fix in NEWS.md.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
R/reliabilityUnidimensionalFrequentist.R Ensure omega failure branches still emit se/conf placeholders so .frequentistScaleTable() can build aligned columns.
tests/testthat/test-reliabilityUnidimensionalFrequentist.R Add regression coverage for omega CFA Heywood-case failure co-occurring with other selected coefficients.
tests/testthat/reliabilityOmegaHeywood.csv New near-collinear test dataset to trigger CFA omega failure deterministically.
NEWS.md Changelog entry for the crash fix (Issue #4477).

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

se (and conf for PFA) never set for scaleOmega on fit failure, breaking
dt$se <- unlist(...) assignment w/ mismatched row count. Fixes #4477.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@juliuspfadt
juliuspfadt force-pushed the fix/omega-se-missing-on-failure branch from 31d6f8c to 66fabac Compare August 17, 2026 12:19
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.

[Bug]: Average Interitem Correlation

3 participants