Skip to content

Refactor @init alias system to use compile-time substitution#244

Merged
ocots merged 2 commits intomainfrom
243-dev-init-aliases
Mar 16, 2026
Merged

Refactor @init alias system to use compile-time substitution#244
ocots merged 2 commits intomainfrom
243-dev-init-aliases

Conversation

@ocots
Copy link
Copy Markdown
Member

@ocots ocots commented Mar 16, 2026

  • Replace runtime alias execution with parse-time substitution via subs()
  • Enable time-dependent aliases like phi = 2π * t
  • Support accumulated aliases like a = t; s = a
  • Handle literal grid specifications after alias expansion
  • Add strict mode for unrecognized statements
  • Add comprehensive tests for new functionality
  • Align @init alias mechanism with @def implementation

All 157 tests pass successfully.

- Replace runtime alias execution with parse-time substitution via subs()
- Enable time-dependent aliases like phi = 2π * t
- Support accumulated aliases like a = t; s = a
- Handle literal grid specifications after alias expansion
- Add strict mode for unrecognized statements
- Add comprehensive tests for new functionality
- Align @init alias mechanism with @def implementation

All 157 tests pass successfully.
@ocots ocots linked an issue Mar 16, 2026 that may be closed by this pull request
@github-actions github-actions bot requested a review from jbcaillau March 16, 2026 13:47
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 16, 2026

Breakage test results
Date: 2026-03-16 14:16:27

Name Latest Stable
OptimalControl compat: v0.8.9-beta compat: v0.8.9-beta

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 16, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.21%. Comparing base (9304906) to head (d8c9844).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #244      +/-   ##
==========================================
+ Coverage   98.10%   98.21%   +0.10%     
==========================================
  Files           4        4              
  Lines        1057     1062       +5     
==========================================
+ Hits         1037     1043       +6     
+ Misses         20       19       -1     

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

@ocots ocots merged commit 656e242 into main Mar 16, 2026
19 checks passed
@ocots ocots deleted the 243-dev-init-aliases branch March 16, 2026 15:32
@ocots ocots mentioned this pull request Apr 3, 2026
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.

[Dev] init aliases

2 participants