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 ESSOptimizer #1182

Merged
merged 10 commits into from
Nov 19, 2023
Merged

Refactor ESSOptimizer #1182

merged 10 commits into from
Nov 19, 2023

Conversation

dweindl
Copy link
Member

@dweindl dweindl commented Nov 17, 2023

Fixes two log messages. The rest is just some cleanup and shuffling some code around for readability / reducing duplications.

Fixes an log message. The rest is just shuffling some code around for readability / reducing duplications.
@codecov-commenter
Copy link

codecov-commenter commented Nov 17, 2023

Codecov Report

Attention: 24 lines in your changes are missing coverage. Please review.

Comparison is base (eab62b2) 84.24% compared to head (a18aa88) 84.33%.
Report is 1 commits behind head on develop.

Files Patch % Lines
pypesto/optimize/ess/sacess.py 18.51% 22 Missing ⚠️
pypesto/optimize/ess/function_evaluator.py 66.66% 2 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1182      +/-   ##
===========================================
+ Coverage    84.24%   84.33%   +0.09%     
===========================================
  Files          148      148              
  Lines        11714    11724      +10     
===========================================
+ Hits          9868     9887      +19     
+ Misses        1846     1837       -9     

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

@dweindl dweindl marked this pull request as ready for review November 17, 2023 14:08
Copy link
Collaborator

@PaulJonasJost PaulJonasJost left a comment

Choose a reason for hiding this comment

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

Looks good to me.

Comment on lines +291 to +295
return FunctionEvaluatorMT(
problem=problem,
startpoint_method=startpoint_method,
n_threads=n_threads or 1,
)
Copy link
Collaborator

Choose a reason for hiding this comment

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

So the default is multithread with one thread. Just out of curiosity, why not Multi process with 1?

Copy link
Member Author

Choose a reason for hiding this comment

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

I'd expect it to be more or less the same. The mp part would still create a pool of one, the mt part doesn't do any extra.

refset:
The initial RefSet or ``None`` to auto-generate.
"""
):
Copy link
Collaborator

@PaulJonasJost PaulJonasJost Nov 19, 2023

Choose a reason for hiding this comment

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

A short docstring would still be nice, even if it is an internal _foo function.

Copy link
Collaborator

Choose a reason for hiding this comment

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

or rather a hint that doc is equivalent to minimize?

@@ -328,6 +328,7 @@ def submit_solution(
sender_idx: Index of the worker submitting the results.
elapsed_time_s: Elapsed time since the beginning of the sacess run.
"""
abs_change = fx - self._best_known_fx.value
Copy link
Collaborator

Choose a reason for hiding this comment

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

Naming a bit misleading as you use abs command below. But no idea for better naming, expect perhaps change

Copy link
Member Author

Choose a reason for hiding this comment

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

I think gets relatively clear from the context. change would as ambiguous - (absolute) relative or (absolute) absolute?.

@dweindl dweindl merged commit 4a953cd into ICB-DCM:develop Nov 19, 2023
17 of 18 checks passed
@dweindl dweindl deleted the refactor_ess branch November 21, 2023 15:44
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.

None yet

3 participants