Skip to content

[WAVE 2][RTR] Validate parameter interpolation types - #1067

Open
mickaelbegon wants to merge 2 commits into
pyomeca:masterfrom
mickaelbegon:codex/fix-863-parameter-interpolation-validation
Open

[WAVE 2][RTR] Validate parameter interpolation types#1067
mickaelbegon wants to merge 2 commits into
pyomeca:masterfrom
mickaelbegon:codex/fix-863-parameter-interpolation-validation

Conversation

@mickaelbegon

@mickaelbegon mickaelbegon commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Summary

  • require InterpolationType.CONSTANT for parameter bounds
  • apply the same validation to parameter initial guesses
  • identify the invalid parameter in the error message
  • cover both validation paths in the existing parameter update test

Root cause

Parameters have no shooting-node dimension, but their bounds and initial guesses were accepted with time-dependent interpolation types. In particular, omitting the interpolation for a BoundsList silently selected CONSTANT_WITH_FIRST_AND_LAST_DIFFERENT, which is not meaningful for a parameter.

Validation

  • MPLCONFIGDIR=/private/tmp/bioptim-mpl-863 python -m pytest tests/shard6/test_update_bounds_and_init.py::test_update_bounds_and_init_with_param -q (2 passed)
  • git diff --check

Closes #863


This change is Reviewable

@mickaelbegon mickaelbegon changed the title Validate parameter interpolation types [HOLD] Validate parameter interpolation types Jul 22, 2026
@mickaelbegon
mickaelbegon force-pushed the codex/fix-863-parameter-interpolation-validation branch from 89cb4c3 to a0d1d86 Compare July 26, 2026 22:08
@mickaelbegon mickaelbegon changed the title [HOLD] Validate parameter interpolation types [WAVE 2] Validate parameter interpolation types Jul 26, 2026
@mickaelbegon
mickaelbegon marked this pull request as ready for review July 26, 2026 22:09
@codecov

codecov Bot commented Jul 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 77.86%. Comparing base (89c83a3) to head (27de531).
⚠️ Report is 8 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1067      +/-   ##
==========================================
+ Coverage   77.26%   77.86%   +0.60%     
==========================================
  Files         196      196              
  Lines       21506    21507       +1     
==========================================
+ Hits        16616    16747     +131     
+ Misses       4890     4760     -130     
Flag Coverage Δ
unittests 77.86% <100.00%> (+0.60%) ⬆️

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

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

@mickaelbegon

Copy link
Copy Markdown
Contributor Author

Codex analysis

This PR is part of Wave 2 and is rebased onto current master (e8fbc729). It rejects time-dependent interpolation for parameter bounds and initial guesses, with the invalid parameter named in the error.

CI exposed one related NMPC path: the internal one-cycle Solution builder labeled a parameter as EACH_FRAME. Codex corrected it to CONSTANT, which matches the parameter semantics within a cycle and preserves the public validation requested by #863.

Review isolation: the PR changes the parameter-validation path, the NMPC one-cycle initializer, and its focused test file; it has no source-file overlap with #1062 or #1065.

Validation completed by Codex:

  • macOS, Python 3.14 / CasADi 3.7.2: tests/shard6/test_update_bounds_and_init.py — 47 passed
  • existing NMPC parameter regression — 1 passed
  • GitHub Actions: 23/23 checks passed
  • git diff --check passed

@EveCharbie @pariterre, all local and online checks are green. This PR is ready for review as an independent Wave 2 change.

@mickaelbegon mickaelbegon changed the title [WAVE 2] Validate parameter interpolation types [WAVE 2][RTR] Validate parameter interpolation types Jul 27, 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.

Interpolation types other than constant should raise an error for parameters

1 participant