Skip to content

Commit

Permalink
Fix: Use assign_parameters_from_slice as inner method for `assign_p…
Browse files Browse the repository at this point in the history
…arameters_sequence`
  • Loading branch information
raynelfss committed Aug 6, 2024
1 parent 8d7c7a9 commit 6eead5e
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions crates/circuit/src/circuit_data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -859,20 +859,7 @@ impl CircuitData {
.iter()?
.map(|ob| Param::extract_no_coerce(&ob?))
.collect::<PyResult<Vec<_>>>()?;
if values.len() != self.param_table.num_parameters() {
return Err(PyValueError::new_err(concat!(
"Mismatching number of values and parameters. For partial binding ",
"please pass a dictionary of {parameter: value} pairs."
)));
}
let mut old_table = std::mem::take(&mut self.param_table);
self.assign_parameters_inner(
sequence.py(),
values
.into_iter()
.zip(old_table.drain_ordered())
.map(|(value, (param_ob, uses))| (param_ob, value, uses)),
)
self.assign_parameters_from_slice(sequence.py(), &values)
}
}

Expand Down

0 comments on commit 6eead5e

Please sign in to comment.