module1

This is an example module.

Functions

add(a, b)

Adds two elements.

compute_something(a, b)

Sums a and b.

merge_arrays(a, b)

Merges a list and a tuple.

sum_np_arrays(a, b)

Sums two numpy arrays.

Functions

add(a, b)[source]

Adds two elements.

Parameters
  • a (int or float or str) – First element.

  • b (int or float or str) – Second element.

compute_something(a, b)[source]

Sums a and b.

Parameters
  • a (float) – A brief explanation of a.

  • b (int) – A brief explanation of b.

Returns

The sum of a and b.

Return type

float

Notes

The addition of an int and a float returns a float.

Mathematically, this performs the following operation:

\[c = a + b\]

Warning

The code will not break if you pass two str.

merge_arrays(a, b)[source]

Merges a list and a tuple.

Parameters
  • a (list) – A list.

  • b (tuple) – A tuple.

Returns

The result of merging the list and the tuple.

Return type

list

Notes

Do not forget to respect indentations when changing line.

Deprecated since version 0.1.0: merge_arrays will be removed in pyretem 0.2.0, find out another way of merging arrays.

sum_np_arrays(a, b)[source]

Sums two numpy arrays.

Parameters
Returns

Sum of passed arrays.

Return type

np.array