Skip to content

Fix terminate when and record statements in subscenarios#490

Open
dfremont wants to merge 1 commit into
mainfrom
fix_subscenarios
Open

Fix terminate when and record statements in subscenarios#490
dfremont wants to merge 1 commit into
mainfrom
fix_subscenarios

Conversation

@dfremont

Copy link
Copy Markdown
Collaborator

Description

Fixes terminate when, record,record initial, and record final so that they behave as expected inside modular scenarios. In particular, the records will cover the time interval when the scenario actually runs, so for example record initial in a scenario starting at time step 2 will record the value at that time (rather than not recording anything since it's not time step 0).

Issue Link

Issues reported by @Kv139 -- thanks Kay!

Checklist

  • I have tested the changes locally via pytest and/or other means
  • I have added or updated relevant documentation
  • I have autoformatted the code with black and isort
  • I have added test cases (if applicable)

@dfremont
dfremont requested a review from Eric-Vin July 17, 2026 03:11
@codecov

codecov Bot commented Jul 17, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 86.79245% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 89.86%. Comparing base (8257147) to head (12f60bb).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
src/scenic/core/sensors.py 16.66% 5 Missing ⚠️
src/scenic/core/dynamics/scenarios.py 95.65% 1 Missing ⚠️
src/scenic/syntax/veneer.py 92.30% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #490      +/-   ##
==========================================
- Coverage   89.87%   89.86%   -0.01%     
==========================================
  Files          48       48              
  Lines       13346    13334      -12     
==========================================
- Hits        11995    11983      -12     
  Misses       1351     1351              
Files with missing lines Coverage Δ
src/scenic/core/requirements.py 96.06% <100.00%> (+0.03%) ⬆️
src/scenic/core/simulators.py 95.74% <100.00%> (-0.11%) ⬇️
src/scenic/core/dynamics/scenarios.py 95.37% <95.65%> (+0.55%) ⬆️
src/scenic/syntax/veneer.py 90.19% <92.30%> (+0.37%) ⬆️
src/scenic/core/sensors.py 35.23% <16.66%> (-0.34%) ⬇️

... and 4 files with indirect coverage changes

🚀 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.

1 participant