Skip to content

Fix UndefVarError in merge_nonunique_inputs warning#144

Merged
baggepinnen merged 1 commit into
masterfrom
fix-mergenonunique-warning-undefvar
May 16, 2026
Merged

Fix UndefVarError in merge_nonunique_inputs warning#144
baggepinnen merged 1 commit into
masterfrom
fix-mergenonunique-warning-undefvar

Conversation

@baggepinnen
Copy link
Copy Markdown
Member

Summary

  • The @warn calls in merge_nonunique_inputs interpolated $(u[i]), but u is not defined inside that function. When the warning condition fires (overlapping non-zero entries between B/D columns being merged under the same input name) the result was an UndefVarError, not the documented warning.
  • Use the local inputnames[i] instead, and add a regression test in test_named_systems2.jl.

Test plan

  • New regression test constructs a system with overlapping B columns under a duplicated input name and asserts the warning is emitted (and that merging proceeds without error).
  • Existing test_named_systems2.jl tests still pass locally.

🤖 Generated with Claude Code

The warning strings interpolated `$(u[i])` but `u` is not defined inside
`merge_nonunique_inputs(sys)`. When the warning condition fires (overlapping
non-zero entries between B/D columns merged under the same input name) the
@warn would raise UndefVarError instead of issuing the documented warning.

Use the local `inputnames[i]` instead, and add a regression test that
constructs a system with overlapping B columns under a duplicated input name
and asserts the warning is emitted.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.84%. Comparing base (14a7deb) to head (55dbbdc).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #144   +/-   ##
=======================================
  Coverage   91.84%   91.84%           
=======================================
  Files          20       20           
  Lines        3064     3064           
=======================================
  Hits         2814     2814           
  Misses        250      250           
Flag Coverage Δ
unittests 91.84% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@baggepinnen baggepinnen merged commit 24a2b95 into master May 16, 2026
2 checks passed
@baggepinnen baggepinnen deleted the fix-mergenonunique-warning-undefvar branch May 16, 2026 04:12
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