-
Notifications
You must be signed in to change notification settings - Fork 27
Better parameterization of APOSMM class, plus docstring #1583
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: experimental/jlnav_plus_shuds_asktell
Are you sure you want to change the base?
Conversation
…documenting, and so we don't have to check the existence of settings in kwargso
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## experimental/jlnav_plus_shuds_asktell #1583 +/- ##
=========================================================================
- Coverage 89.95% 89.93% -0.03%
=========================================================================
Files 79 79
Lines 7915 7925 +10
Branches 1176 1178 +2
=========================================================================
+ Hits 7120 7127 +7
- Misses 615 618 +3
Partials 180 180 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
libensemble/gen_classes/aposmm.py
Outdated
gen_specs["user"]["xtol_abs"] = xtol_abs | ||
gen_specs["user"]["ftol_abs"] = ftol_abs | ||
gen_specs["user"]["dist_to_bound_multiple"] = dist_to_bound_multiple | ||
gen_specs["user"]["max_active_runs"] = max_active_runs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FIELDS = [
"initial_sample_size",
"sample_points",
"localopt_method",
"rk_const",
"xtol_abs",
"ftol_abs",
"dist_to_bound_multiple",
"max_active_runs",
]
u = gen_specs.setdefault("user", {})
temp = {}
for k in FIELDS:
val = locals().get(k)
if val is not None:
temp[k] = val
u.update(temp)
or separate required v optional
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe this works but grabbing values from locals()
to prevent redundancy just looks odd to me. I can still implement this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Its just a way to convert a string to a function name. Better than typing them all out right?
… with loop over fields and grabbing the value from locals, as suggested by shuds
No description provided.