Skip to content

Fix analysis/plotly and ax/plot for scalarized objectives/constraints#5068

Closed
saitcakmak wants to merge 1 commit intofacebook:mainfrom
saitcakmak:export-D97123687
Closed

Fix analysis/plotly and ax/plot for scalarized objectives/constraints#5068
saitcakmak wants to merge 1 commit intofacebook:mainfrom
saitcakmak:export-D97123687

Conversation

@saitcakmak
Copy link
Contributor

Summary:

  • ObjectivePFeasibleFrontierPlot: Add scalarized guard in
    validate_applicable_state and compute since metric_names[0] and
    .minimize are semantically wrong for scalarized objectives.
  • Fix scalarized outcome constraint guard: change
    isinstance(oc, ScalarizedOutcomeConstraint) to
    len(oc.metric_names) > 1 to catch expression-based scalarized
    constraints (not just the deprecated class).
  • _maybe_get_default_minimize_single_metric: Change
    if optimization_config.is_moo_problem: to
    if not objective.is_single_objective: to cover scalarized objectives
    using the same metric_weights logic.

Reviewed By: lena-kashtelyan

Differential Revision: D97123687

Summary:
- `ObjectivePFeasibleFrontierPlot`: Add scalarized guard in
  `validate_applicable_state` and `compute` since `metric_names[0]` and
  `.minimize` are semantically wrong for scalarized objectives.
- Fix scalarized outcome constraint guard: change
  `isinstance(oc, ScalarizedOutcomeConstraint)` to
  `len(oc.metric_names) > 1` to catch expression-based scalarized
  constraints (not just the deprecated class).
- `_maybe_get_default_minimize_single_metric`: Change
  `if optimization_config.is_moo_problem:` to
  `if not objective.is_single_objective:` to cover scalarized objectives
  using the same `metric_weights` logic.

Reviewed By: lena-kashtelyan

Differential Revision: D97123687
@meta-codesync
Copy link

meta-codesync bot commented Mar 19, 2026

@saitcakmak has exported this pull request. If you are a Meta employee, you can view the originating Diff in D97123687.

@meta-cla meta-cla bot added the CLA Signed Do not delete this pull request or issue due to inactivity. label Mar 19, 2026
@codecov-commenter
Copy link

Codecov Report

❌ Patch coverage is 87.50000% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 96.30%. Comparing base (04c9aba) to head (c91be71).

Files with missing lines Patch % Lines
...x/analysis/plotly/objective_p_feasible_frontier.py 85.71% 1 Missing ⚠️
ax/plot/pareto_frontier.py 75.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5068   +/-   ##
=======================================
  Coverage   96.29%   96.30%           
=======================================
  Files         613      613           
  Lines       67232    67238    +6     
=======================================
+ Hits        64742    64752   +10     
+ Misses       2490     2486    -4     

☔ 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@meta-codesync
Copy link

meta-codesync bot commented Mar 19, 2026

This pull request has been merged in 9d15a15.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed Do not delete this pull request or issue due to inactivity. fb-exported Merged meta-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants