Skip to content

macos_online_fix#1047

Merged
pariterre merged 6 commits into
pyomeca:masterfrom
mickaelbegon:online_mac
Jun 3, 2026
Merged

macos_online_fix#1047
pariterre merged 6 commits into
pyomeca:masterfrom
mickaelbegon:online_mac

Conversation

@mickaelbegon

@mickaelbegon mickaelbegon commented Apr 9, 2026

Copy link
Copy Markdown
Contributor

All Submissions:

  • Have you followed the guidelines in our Contributing document [docs/contribution.md]?
  • Have you checked to ensure there aren't other open [Pull Requests] for the same update/change?
  • Have you opened/linked the issue related to your pull request?
  • Have you used the tag [WIP] for on-going changes, and removed it when the pull request was ready?
  • When ready to merge, have you sent a comment pinging @pariterre in it?

New Feature Submissions:

  1. Does your submission pass the tests (if not please explain why this is intended)?
  2. Did you write a proper documentation (docstrings and ReadMe)
  3. Have you linted your code locally prior to submission (using the command: black . -l120 --exclude "external/*")?

Changes to Core Features:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new examples for your core changes, as applicable?
  • Have you written new tests for your core changes, as applicable?

This PR enables online_optim on macOS by switching OnlineOptim.DEFAULT to MULTIPROCESS_SERVER instead of disabling online plotting entirely.

It also fixes the supporting issues that showed up during macOS validation:

  • recreate the TCP client socket after failed connect attempts
  • auto-pick a free port for the auto-started plotting server
  • keep MULTIPROCESS explicitly unsupported on macOS
  • skip the final basic_ocp animation cleanly when bioviz is not installed
  • ignore all-NaN line data when computing online plot bounds

I split the change into two commits:

  1. c9811420 Enable macOS online plotting via multiprocess server
  2. 2b17fb3e Harden macOS plotting example fallbacks

This change is Reviewable

@codecov

codecov Bot commented Jun 2, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 78.12500% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 77.21%. Comparing base (e8723c9) to head (a01ed91).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
bioptim/gui/online_callback_server.py 60.00% 4 Missing ⚠️
bioptim/gui/online_callback_multiprocess_server.py 70.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1047      +/-   ##
==========================================
+ Coverage   77.00%   77.21%   +0.21%     
==========================================
  Files         192      192              
  Lines       21127    21148      +21     
==========================================
+ Hits        16269    16330      +61     
+ Misses       4858     4818      -40     
Flag Coverage Δ
unittests 77.21% <78.12%> (+0.21%) ⬆️

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.

pariterre
pariterre previously approved these changes Jun 3, 2026

@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 10 files and all commit messages, and made 2 comments.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on mickaelbegon).


bioptim/examples/getting_started/basic_ocp.py line 192 at r2 (raw file):

            print("Animation skipped because bioviz is not installed.")
        else:
            raise

I don't understand the benefit of this check as it already fails like so when bioviz is not installed.. I think commenting is better...
(Changes are already done)

@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 1 file and all commit messages, and made 1 comment.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on mickaelbegon).

@pariterre pariterre merged commit d780a4d into pyomeca:master Jun 3, 2026
23 of 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.

2 participants