Serial execution

unified_map.multivariate.serial.for_loop(function, argument_list)

Apply a multivariate function to a list of arguments in a serial fashion.

Uses Python’s built-in for statement.

Parameters:
  • function – A callable object that accepts more than one argument
  • argument_list – An iterable object of input argument collections
Returns:

List of output results

Example

>>> def add(x, y, z):
...     return x+y+z
...
>>> for_loop(add, [(1, 2, 3), (10, 20, 30)])
[6, 60]

References

unified_map.multivariate.serial.generator_expression(function, argument_list)

Apply a multivariate function to a list of arguments in a serial fashion.

Uses Python’s built-in generator expressions.

Parameters:
  • function – A callable object that accepts more than one argument
  • argument_list – An iterable object of input argument collections
Returns:

List of output results

Example

>>> def add(x, y, z):
...     return x+y+z
...
>>> generator_expression(add, [(1, 2, 3), (10, 20, 30)])
[6, 60]

References

unified_map.multivariate.serial.generator_function(function, argument_list)

Apply a multivariate function to a list of arguments in a serial fashion.

Uses Python’s built-in generator function syntax to return a generator iterator.

Parameters:
  • function – A callable object that accepts more than one argument
  • argument_list – An iterable object of input argument collections
Returns:

List of output results

Example

>>> def add(x, y, z):
...     return x+y+z
...
>>> generator_function(add, [(1, 2, 3), (10, 20, 30)])
[6, 60]

References

unified_map.multivariate.serial.list_comprehension(function, argument_list)

Apply a multivariate function to a list of arguments in a serial fashion.

Uses Python’s built-in list comprehension.

Parameters:
  • function – A callable object that accepts more than one argument
  • argument_list – An iterable object of input argument collections
Returns:

List of output results

Example

>>> def add(x, y, z):
...     return x+y+z
...
>>> list_comprehension(add, [(1, 2, 3), (10, 20, 30)])
[6, 60]

References

unified_map.multivariate.serial.map(function, argument_list)

Apply a multivariate function to a list of arguments in a serial fashion.

Uses Python’s built-in map() and zip() functions.

Parameters:
  • function – A callable object that accepts more than one argument
  • argument_list – An iterable object of input argument collections
Returns:

List of output results

Example

>>> def add(x, y, z):
...     return x+y+z
...
>>> map(add, [(1, 2, 3), (10, 20, 30)])
[6, 60]

References

unified_map.multivariate.serial.starmap(function, argument_list)

Apply a multivariate function to a list of arguments in a serial fashion.

Uses the starmap() function from itertools in Python’s standard library.

Parameters:
  • function – A callable object that accepts more than one argument
  • argument_list – An iterable object of input argument collections
Returns:

List of output results

Example

>>> def add(x, y, z):
...     return x+y+z
...
>>> starmap(add, [(1, 2, 3), (10, 20, 30)])
[6, 60]

References