Skip to content

[WAVE 1] Test printing OCPs without controls#1069

Open
mickaelbegon wants to merge 1 commit into
pyomeca:masterfrom
mickaelbegon:codex/fix-637-print-control-type-none
Open

[WAVE 1] Test printing OCPs without controls#1069
mickaelbegon wants to merge 1 commit into
pyomeca:masterfrom
mickaelbegon:codex/fix-637-print-control-type-none

Conversation

@mickaelbegon

@mickaelbegon mickaelbegon commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add a focused regression test for ocp.print() with no control variables
  • cover both console output and Graphviz graph preparation
  • update the dormant ControlType.NONE fixture to the current dynamics signature
  • make the fixture honor its n_phase argument so the regression stays lightweight

Context

The production printing code now skips empty control collections correctly, so the historical crash is no longer reproducible. However, the existing no-control test returned before constructing its OCP and could not protect this behavior. This PR restores a small executable path specifically for the reported issue.

Validation

  • MPLCONFIGDIR=/private/tmp/bioptim-mpl-637 python -m pytest tests/shard6/test_controltype_none.py::test_print_control_type_none -q (1 passed)
  • git diff --check

Closes #637


This change is Reviewable

@mickaelbegon mickaelbegon changed the title Test printing OCPs without controls [WAVE 1] Test printing OCPs without controls Jul 22, 2026
@mickaelbegon

Copy link
Copy Markdown
Contributor Author

Wave 1 preparation update: this PR does not touch plotting code. Its shared Matplotlib failure is addressed by prerequisite #1081; it will remain draft until that prerequisite lands and CI is rerun.

@mickaelbegon
mickaelbegon force-pushed the codex/fix-637-print-control-type-none branch from be0f093 to fcd3159 Compare July 23, 2026 13:43
@mickaelbegon
mickaelbegon marked this pull request as ready for review July 23, 2026 13:46
@codecov

codecov Bot commented Jul 23, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 77.26%. Comparing base (5ed90c1) to head (fcd3159).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1069   +/-   ##
=======================================
  Coverage   77.26%   77.26%           
=======================================
  Files         196      196           
  Lines       21506    21506           
=======================================
  Hits        16616    16616           
  Misses       4890     4890           
Flag Coverage Δ
unittests 77.26% <ø> (ø)

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.

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.

ocp.print() with ControlType.NONE

1 participant