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

refactor: Remove tuple option for Type[AcquisitionFunction], as this … #715

Merged
merged 7 commits into from
Jun 15, 2023

Conversation

mseeger
Copy link
Collaborator

@mseeger mseeger commented Jun 14, 2023

…can be done by partial

Follow-up on recent PR by Jacek: Use of partial is more elegant.


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@mseeger mseeger requested a review from jgolebiowski June 14, 2023 19:31
@codecov
Copy link

codecov bot commented Jun 14, 2023

Codecov Report

Patch coverage: 83.33% and project coverage change: -0.04 ⚠️

Comparison is base (8e369d0) 65.15% compared to head (0bf973b) 65.11%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #715      +/-   ##
==========================================
- Coverage   65.15%   65.11%   -0.04%     
==========================================
  Files         427      427              
  Lines       28690    28692       +2     
==========================================
- Hits        18692    18683       -9     
- Misses       9998    10009      +11     
Impacted Files Coverage Δ
...mizer/schedulers/searchers/dyhpo/dyhpo_searcher.py 88.65% <ø> (ø)
tst/schedulers/test_schedulers_api.py 94.80% <ø> (ø)
...imizer/schedulers/searchers/gp_searcher_factory.py 83.06% <50.00%> (+0.05%) ⬆️
...ective/multi_surrogate_multi_objective_searcher.py 71.79% <100.00%> (ø)
...archers/bayesopt/tuning_algorithms/base_classes.py 85.00% <100.00%> (+0.47%) ⬆️
...esopt/tuning_algorithms/bo_algorithm_components.py 90.50% <100.00%> (-0.06%) ⬇️
...mizer/schedulers/searchers/model_based_searcher.py 81.16% <100.00%> (-0.07%) ⬇️
...rs/searchers/sklearn/sklearn_surrogate_searcher.py 75.00% <100.00%> (ø)

... and 9 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Collaborator

@jgolebiowski jgolebiowski left a comment

Choose a reason for hiding this comment

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

Very nice change, thanks for doing it. One comment I have is that I beliebve the right typing is actually: Callable[[Any], ScoringFunction] since we pass a constructor which will generate an instance of the ScoringFunction

@@ -75,7 +75,7 @@ def __init__(
estimators: Dict[str, Estimator],
mode: Optional[List[str]] = None,
points_to_evaluate: Optional[List[Dict[str, Any]]] = None,
scoring_class_and_args: Optional[ScoringClassAndArgs] = None,
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think the right typing is actually: Callable[[Any], ScoringFunction] since we are passing a constructor to the scoring function not an instance of the scoring function

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I see, good point



Copy link
Collaborator

Choose a reason for hiding this comment

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

NIT: ScoringFunctionConstructor

Copy link
Collaborator

@jgolebiowski jgolebiowski left a comment

Choose a reason for hiding this comment

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

Could we change ScoringFunctionCreator to ScoringFunctionConstructor. In most cases what is passed is actually the vanilla constructor and it will make it clearer.

Copy link
Collaborator

@jgolebiowski jgolebiowski left a comment

Choose a reason for hiding this comment

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

LGTM

@mseeger mseeger merged commit c89054a into main Jun 15, 2023
@mseeger mseeger deleted the use_partial branch June 15, 2023 12:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants