Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type annotations -- mark some parameters as immutable; copy immutable arguments that may be mutated #3213

Closed
wants to merge 1 commit into from

Conversation

esantorella
Copy link
Contributor

Summary:
Context:

I ran into some of these while adding a benchmark and decided to fix the annotations rather than adding pyre-ignores

This PR:

  • Marks BenchmarkProblem.status_quo_params as immutable
  • Marks SurrogateTestFunction.outcome_names as immutable
  • Copies parameters when they are passed to ObservationFeatures so they will not be mutated by transforms
  • Marks parameters passed to Arm as immutable
  • Marks parameters as immutalbe in various search space functions
  • Removes unused ignores

Differential Revision: D67624124

… arguments that may be mutated

Summary:
Context:

I ran into some of these while adding a benchmark and decided to fix the annotations rather than adding pyre-ignores

This PR:
* Marks `BenchmarkProblem.status_quo_params` as immutable
* Marks `SurrogateTestFunction.outcome_names` as immutable
* Copies parameters when they are passed to `ObservationFeatures` so they will not be mutated by transforms
* Marks `parameters` passed to `Arm` as immutable
* Marks parameters as immutalbe in various search space functions
* Removes unused ignores

Differential Revision: D67624124
@facebook-github-bot facebook-github-bot added CLA Signed Do not delete this pull request or issue due to inactivity. fb-exported labels Dec 24, 2024
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D67624124

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.87%. Comparing base (c561e7a) to head (fbc27fe).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3213   +/-   ##
=======================================
  Coverage   95.87%   95.87%           
=======================================
  Files         513      513           
  Lines       51636    51636           
=======================================
  Hits        49505    49505           
  Misses       2131     2131           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@facebook-github-bot
Copy link
Contributor

This pull request has been merged in 6607582.

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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants