edges.tools¶
Various utility functions.
- edges.tools.as_readonly(x: ndarray) ndarray[source]¶
Get a read-only view into an array without copying.
- edges.tools.dct_of_list_to_list_of_dct(dct: dict[str, Sequence]) list[dict][source]¶
Take a dict of key: list pairs and turn it into a list of all combos of dicts.
- Parameters:
dct – A dictionary for which each value is an iterable.
- Returns:
list – A list of dictionaries, each having the same keys as the input
dct, but in which the values are the elements of the original iterables.
Examples
>>> dct_of_list_to_list_of_dct( >>> { 'a': [1, 2], 'b': [3, 4]} [ {"a": 1, "b": 3}, {"a": 1, "b": 4}, {"a": 2, "b": 3}, {"a": 2, "b": 4}, ]
- edges.tools.decibels_to_linear(x: ndarray[tuple[Any, ...], dtype[_ScalarT]]) ndarray[tuple[Any, ...], dtype[float]][source]¶
Convert a number in decibels to linear.
- edges.tools.join_struct_arrays(arrays)[source]¶
Join a list of structured numpy arrays (make new columns).
- edges.tools.linear_to_decibels(x: ndarray[tuple[Any, ...], dtype[_ScalarT]]) ndarray[tuple[Any, ...], dtype[float]][source]¶
Convert a linear number to decibels.