Skip to content

Commit

Permalink
Avoid using f-string
Browse files Browse the repository at this point in the history
  • Loading branch information
c-bata committed Feb 18, 2020
1 parent 6c2a102 commit bb7a950
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cmaes/sampler.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ def _fast_intersection_search_space(
del search_space[param_name]

# Retrieve cache from trial_system_attrs.
json_str= trial.system_attrs.get("cma:search_space", None) # type: str
json_str = trial.system_attrs.get("cma:search_space", None) # type: str
if json_str is None:
continue
json_dict = json.loads(json_str)
Expand Down
4 changes: 3 additions & 1 deletion examples/quadratic_function.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ def main():
x = cma_es.ask()
value = quadratic(x[0], x[1])
solutions.append((x, value))
print(f"#{generation} {value} (x1={x[0]}, x2 = {x[1]})")
print("#{g} {value} (x1={x1}, x2 = {x2})".format(
g=generation, value=value, x1=x[0], x2=x[1],
))
cma_es.tell(solutions)


Expand Down

0 comments on commit bb7a950

Please sign in to comment.