Skip to content

Commit

Permalink
Slight bug fix in grid_search method
Browse files Browse the repository at this point in the history
  • Loading branch information
Richert committed Jul 10, 2019
1 parent 5558ac2 commit d138255
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pyrates/utility/grid_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -1086,7 +1086,10 @@ def adapt_circuit(circuit: CircuitIR, params: dict, param_map: dict) -> CircuitI
circuit.nodes[node]['node'].op_graph.nodes[op]['variables'][var_name]['value'] = float(val)
else:
for op in circuit.nodes[node]['node'].op_graph.nodes:
op['variables'][var]['value'] = float(val)
try:
circuit.nodes[node]['node'].op_graph.nodes[op]['variables'][var]['value'] = float(val)
except KeyError:
pass

# change variable values on edges
edges = param_map[key]['edges'] if 'edges' in param_map[key] else []
Expand Down

0 comments on commit d138255

Please sign in to comment.