Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/ianj-als/pypeline.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/pypeline/helpers/helpers.py')
-rw-r--r--src/pypeline/helpers/helpers.py10
1 files changed, 1 insertions, 9 deletions
diff --git a/src/pypeline/helpers/helpers.py b/src/pypeline/helpers/helpers.py
index d811d44..2fadad0 100644
--- a/src/pypeline/helpers/helpers.py
+++ b/src/pypeline/helpers/helpers.py
@@ -149,15 +149,7 @@ def cons_wire(schema_conv_function):
def cons_dictionary_wire(conversions):
"""Construct a wire that converts between two dictionaries. The keys of the conversions dictionary are keys in the output dictionary, of the preceeding component, whose values will be used to populate a dictionary whose keys are the value of the conversions dictionary.\n\nE.g., output = {'int': 9, 'string': 'hello'}, and conversions = {'int': 'int_two', 'string': 'string_two'}, yields an input dictionary, to the next component, input = {'int_two': 9, 'string_two': 'hello'}."""
- def conversion_function(a):
- c = dict()
- for key in conversions:
- c[conversions[key]] = a[key]
- return c
-
- return cons_wire(lambda a, _: conversion_function(a))
-# Python 2.7 syntax
-# return cons_wire(lambda a, _: {conversions[key]: a[key] for key in conversions})
+ return cons_wire(lambda a, _: {conversions[key]: a[key] for key in conversions})
def cons_split_wire():