Skip to content

Fix edge-case validation in nuts_params.list()#531

Open
utkarshpawade wants to merge 2 commits intostan-dev:masterfrom
utkarshpawade:fix/nuts-params-list-edge-cases
Open

Fix edge-case validation in nuts_params.list()#531
utkarshpawade wants to merge 2 commits intostan-dev:masterfrom
utkarshpawade:fix/nuts-params-list-edge-cases

Conversation

@utkarshpawade
Copy link
Copy Markdown
Contributor

Fixes #530

  • Add early validation in nuts_params.list() for empty lists and zero-row matrices with clear error messages
  • Add unit tests for empty list, zero-row matrix, and single-chain input edge cases

Copilot AI review requested due to automatic review settings April 7, 2026 10:43
Copy link
Copy Markdown
Contributor

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

This PR addresses Issue #530 by adding explicit input validation to nuts_params.list() so edge-case inputs (empty lists and zero-row matrices) fail with clear, user-facing errors rather than downstream/internal failures.

Changes:

  • Add early validation in nuts_params.list() for empty list inputs and zero-row matrices.
  • Add unit tests covering empty list, zero-row matrix, and single-chain list behavior.
  • Document the behavioral change in NEWS.md.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
R/bayesplot-extractors.R Adds early input validation and clearer error messages in nuts_params.list().
tests/testthat/test-extractors.R Adds regression tests for new edge-case validations and a single-chain success case.
NEWS.md Notes the new validation behavior in the development changelog.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Apr 7, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.67%. Comparing base (62fce06) to head (6238977).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #531      +/-   ##
==========================================
- Coverage   98.71%   98.67%   -0.04%     
==========================================
  Files          35       35              
  Lines        5903     5907       +4     
==========================================
+ Hits         5827     5829       +2     
- Misses         76       78       +2     

☔ View full report in Codecov by Sentry.
📢 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.

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.

Add input validation for edge cases in nuts_params.list()

3 participants