Skip to content

Conversation

@Balandat
Copy link
Contributor

@Balandat Balandat commented Feb 9, 2026

Summary:
Add Self type annotation from typing module to methods that return self
or cloned instances of the same class. This enables better type inference
for subclasses and improves IDE support.

Files changed:

  • ax/core/base_trial.py - run(), stop(), complete(), mark_*() methods
  • ax/core/batch_trial.py - mark_arm_abandoned()
  • ax/core/experiment.py - add_tracking_metric(), update_tracking_metric(), etc.
  • ax/core/multi_type_experiment.py - add_trial_type(), update_runner(), metric methods
  • ax/core/arm.py - clone()
  • ax/core/objective.py - clone() on Objective, MultiObjective, ScalarizedObjective
  • ax/core/optimization_config.py - clone()
  • ax/core/runner.py - clone()
  • ax/core/parameter.py - clone() abstract method

Reviewed By: saitcakmak

Differential Revision: D91648885

Summary:
Add Self type annotation from typing module to methods that return self
or cloned instances of the same class. This enables better type inference
for subclasses and improves IDE support.

Files changed:
- ax/core/base_trial.py - run(), stop(), complete(), mark_*() methods
- ax/core/batch_trial.py - mark_arm_abandoned()
- ax/core/experiment.py - add_tracking_metric(), update_tracking_metric(), etc.
- ax/core/multi_type_experiment.py - add_trial_type(), update_runner(), metric methods
- ax/core/arm.py - clone()
- ax/core/objective.py - clone() on Objective, MultiObjective, ScalarizedObjective
- ax/core/optimization_config.py - clone()
- ax/core/runner.py - clone()
- ax/core/parameter.py - clone() abstract method

Reviewed By: saitcakmak

Differential Revision: D91648885
@meta-cla meta-cla bot added the CLA Signed Do not delete this pull request or issue due to inactivity. label Feb 9, 2026
@codecov-commenter
Copy link

Codecov Report

❌ Patch coverage is 97.50000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 96.75%. Comparing base (8812057) to head (1ededc9).

Files with missing lines Patch % Lines
ax/core/multi_type_experiment.py 85.71% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4870      +/-   ##
==========================================
- Coverage   96.76%   96.75%   -0.01%     
==========================================
  Files         591      591              
  Lines       61879    61884       +5     
==========================================
+ Hits        59875    59878       +3     
- Misses       2004     2006       +2     

☔ 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.

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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants