Skip to content

[WAVE 1] Fix example content search paths - #1068

Merged
pariterre merged 3 commits into
pyomeca:masterfrom
mickaelbegon:codex/fix-810-example-content-search
Jul 26, 2026
Merged

[WAVE 1] Fix example content search paths#1068
pariterre merged 3 commits into
pyomeca:masterfrom
mickaelbegon:codex/fix-810-example-content-search

Conversation

@mickaelbegon

@mickaelbegon mickaelbegon commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Summary

  • preserve example subdirectories while flattening the launcher tree
  • resolve content-search files from bioptim/examples instead of the process working directory
  • add a regression test that validates every declared example path

Root cause

Content search combined os.getcwd() with only the top-level example category. Launching python -m bioptim.examples outside the examples directory therefore produced invalid paths, and nested toy_examples/... directories were discarded while flattening the tree.

Validation

  • QT_QPA_PLATFORM=offscreen MPLCONFIGDIR=/private/tmp/bioptim-mpl-810 python -m pytest tests/shard1/test__run_examples.py::test_example_paths_are_preserved_when_flattening -q (1 passed)
  • git diff --check

Closes #810


This change is Reviewable

@mickaelbegon mickaelbegon changed the title Fix example content search paths [WAVE 1] Fix example content search paths Jul 22, 2026
@mickaelbegon

mickaelbegon commented Jul 22, 2026

Copy link
Copy Markdown
Contributor Author

Wave 1 preparation update: the Linux Qt import crash introduced by the new regression test is fixed in commit 1b3ac38 (focused test passes locally). Full CI still depends on the shared Matplotlib prerequisite #1081.

@mickaelbegon
mickaelbegon force-pushed the codex/fix-810-example-content-search branch from 1b3ac38 to 69400b0 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

❌ Patch coverage is 91.66667% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 77.86%. Comparing base (5ed90c1) to head (66ad492).
⚠️ Report is 5 commits behind head on master.

Files with missing lines Patch % Lines
bioptim/examples/__main__.py 91.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1068      +/-   ##
==========================================
+ Coverage   77.26%   77.86%   +0.60%     
==========================================
  Files         196      196              
  Lines       21506    21503       -3     
==========================================
+ Hits        16616    16743     +127     
+ Misses       4890     4760     -130     
Flag Coverage Δ
unittests 77.86% <91.66%> (+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

CI follow-up after commit 66ad492:

  • the Windows shard 1 path-separator failure is fixed;
  • codecov/patch and codecov/project now pass;
  • the two targeted example-search tests pass locally on macOS;
  • all 23 PR checks are green.

The added content-search test calls filterByContent with an isolated example tree, so the changed search-path logic is now exercised without requiring a visible Qt window.

@pariterre pariterre left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

@pariterre reviewed 2 files and all commit messages, and made 1 comment.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on mickaelbegon).

@pariterre
pariterre merged commit 45a24e3 into pyomeca:master Jul 26, 2026
24 checks passed
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.

pyQt examples - error with Content search

2 participants