Skip to content

warning check and test coverage#120

Merged
nautilus69 merged 2 commits into
mainfrom
warning-test-coverage
Mar 6, 2026
Merged

warning check and test coverage#120
nautilus69 merged 2 commits into
mainfrom
warning-test-coverage

Conversation

@nautilus69

Copy link
Copy Markdown
Collaborator

Convert check_simulation errors to warnings and add validate_simulation (#68, #93)

Issue #68: Replace hard errors with warnings in check_simulation to allow
incremental building of simulations. Users can now add simulations without
all building blocks (protocols, formulations) being present upfront.
A new validate_simulation() method provides strict pre-execution validation
that throws errors when required components are missing.

Issue #93: Add comprehensive tests for output selections and observer paths,
including default selections, set/add operations, and snapshot round-trip
preservation.

Changes:

  • R/simulations.R: cli_abort -> cli_warn for missing formulation checks
  • R/snapshot.R: check_simulation() now warns instead of erroring;
    new validate_simulation() method for strict validation before runs
  • tests/testthat/test-simulation.R: convert expect_error to expect_warning
    for check_simulation tests; add 10+ test cases for validate_simulation;
    add 5+ test cases for output selections/observers
  • Updated roxygen docs and test snapshots

This will resolve both #93 and #68

@nautilus69
nautilus69 requested a review from dlefaudeux March 4, 2026 13:22

@dlefaudeux dlefaudeux left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Would be nice if validate_simulation also says the name of the simulation for which there is an issue. Because it will be called before the run_simulations an otherwise it just says that is missing but not for which sim.

@dlefaudeux

Copy link
Copy Markdown
Collaborator

And for #93 I meant that it is supported to use as outputs in the output selection thing that are defined in the Observer building block

@nautilus69
nautilus69 requested a review from dlefaudeux March 4, 2026 15:07
@nautilus69
nautilus69 merged commit a05d890 into main Mar 6, 2026
4 checks passed
@PavelBal
PavelBal deleted the warning-test-coverage branch May 11, 2026 08:54
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.

2 participants