-
-
Notifications
You must be signed in to change notification settings - Fork 66
Basis optimization CLI #910
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
base: main
Are you sure you want to change the base?
Changes from 1 commit
1daf5e8
83a6aab
5e99196
fd4469e
be064dd
cb85646
65de7d6
d900425
ec336e9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -30,6 +30,9 @@ | |
|
|
||
| _log = logging.getLogger(__name__) | ||
|
|
||
| # TODO we should have some kind of checks for the bounds, whether they | ||
| # make sense or not. | ||
|
|
||
|
|
||
| def _convert_optimize_result(minimizer, result): | ||
| """Convert optimize result to conform to the scaling procedure performed""" | ||
|
|
@@ -350,15 +353,13 @@ | |
| It uses the pybads package to perform the minimization. | ||
| """ | ||
|
|
||
| def run(self, options={}, get_hard_bounds: Callable = lambda x: x, **kwargs): | ||
| def run(self, options={}, func_hard_bounds: Callable = lambda x: x, **kwargs): | ||
| from pybads.bads import BADS | ||
|
|
||
| bounds = self.normalize_bounds() | ||
| bounds = np.array(bounds) | ||
|
|
||
| bounds[bounds == 0] = 0.5 | ||
|
|
||
| hard_bounds = get_hard_bounds(bounds) | ||
| hard_bounds = func_hard_bounds(bounds) | ||
|
|
||
| with self: | ||
|
|
||
|
|
@@ -374,8 +375,8 @@ | |
| # They do a deep copy of the arguments at the end, when generating the result. | ||
| # This might be a problem if the arguments are not pickleable. E.g. the minimizer function | ||
| # is associated with the minimizer object, which might contain siles. | ||
| try: | ||
| opt = bads.optimize() | ||
| except TypeError: | ||
Check noticeCode scanning / CodeQL Empty except Note
'except' clause does nothing but pass and there is no explanatory comment.
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is there a reason for
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is explained in the comment above, basically their final saving or whatever (I don't remember exactly what it was) uses pickle and it can fail, but I guess we didn't need it because we do our own saving of the optimization. |
||
| pass | ||
|
|
||
|
|
||
Check notice
Code scanning / CodeQL
Unused local variable Note