:py:mod:`gnn_tracking.utils.dictionaries`
=========================================

.. py:module:: gnn_tracking.utils.dictionaries


Module Contents
---------------


Functions
~~~~~~~~~

.. autoapisummary::

   gnn_tracking.utils.dictionaries.add_key_prefix
   gnn_tracking.utils.dictionaries.add_key_suffix
   gnn_tracking.utils.dictionaries.subdict_with_prefix_stripped
   gnn_tracking.utils.dictionaries.expand_grid
   gnn_tracking.utils.dictionaries.pivot_record_list
   gnn_tracking.utils.dictionaries.to_floats
   gnn_tracking.utils.dictionaries.separate_init_kwargs



Attributes
~~~~~~~~~~

.. autoapisummary::

   gnn_tracking.utils.dictionaries._P


.. py:data:: _P

   

.. py:function:: add_key_prefix(dct: dict[str, _P], prefix: str = '') -> dict[str, _P]

   Return a copy of the dictionary with the prefix added to all keys.


.. py:function:: add_key_suffix(dct: dict[str, _P], suffix: str = '') -> dict[str, _P]

   Return a copy of the dictionary with the suffix added to all keys.


.. py:function:: subdict_with_prefix_stripped(dct: dict[str, _P], prefix: str = '') -> dict[str, _P]

   Return a copy of the dictionary for all keys that start with prefix
   and with the prefix removed from all keys.


.. py:function:: expand_grid(grid: dict[str, Sequence], fixed: Optional[dict[str, Sequence]] = None) -> list[dict[str, Any]]

   Expands a grid of parameters into a list of configurations.


.. py:function:: pivot_record_list(records: list[dict]) -> dict

   Transform list of key value pairs into dict of lists.


.. py:function:: to_floats(inpt: Any) -> Any

   Convert all tensors in a datastructure to floats.
   Works on single tensors, lists, or dictionaries, nested or not.


.. py:function:: separate_init_kwargs(kwargs: dict, cls: type) -> tuple[dict, dict]


