MCPcopy Create free account
hub / github.com/ciphermodelabs/ciphercore / prepare_input_values

Method prepare_input_values

ciphercore-base/src/graphs.rs:3568–3571  ·  view source on GitHub ↗

Rearrange given input values according to the names and the order of the related input nodes. For example, given a graph with the first input node named 'A' and the second one named 'B' and input values `{'B': v, 'A': w}`, this function returns a vector `[w, v]`. # Arguments `values` - hashmap of values keyed by node names # Returns Vector of values arranged by node names # Example ``` # us

(&self, values: HashMap<&str, T>)

Source from the content-addressed store, hash-verified

3566 /// assert_eq!(vec![1,2], ordered_input);
3567 /// ```
3568 pub fn prepare_input_values<T: Clone>(&self, values: HashMap<&str, T>) -> Result<Vec<T>> {
3569 self.get_context()
3570 .prepare_input_values(self.clone(), values)
3571 }
3572}
3573type WeakGraphBodyPointer = Weak<AtomicRefCell<GraphBody>>;
3574

Callers 2

test_named_contextsFunction · 0.80
parallel_random_evaluateFunction · 0.80

Calls 8

cloneMethod · 0.80
is_inputMethod · 0.80
get_contextMethod · 0.45
get_idMethod · 0.45
getMethod · 0.45
get_nodesMethod · 0.45
get_operationMethod · 0.45
pushMethod · 0.45

Tested by 1

test_named_contextsFunction · 0.64