:py:mod:`orcanet.misc` ====================== .. py:module:: orcanet.misc .. autoapi-nested-parse:: Odds and ends. .. !! processed by numpydoc !! Module Contents --------------- Functions ~~~~~~~~~ .. autoapisummary:: orcanet.misc.get_register orcanet.misc.from_register orcanet.misc.dict_to_recarray orcanet.misc.to_ndarray orcanet.misc.find_file .. py:function:: get_register() E.g. for storing orcanet layer blocks as custom objects. .. !! processed by numpydoc !! .. py:function:: from_register(toml_entry, register) Get an initilized object via a toml entry. Used for loading orcanet built-in sample modifiers etc. :Parameters: **toml_entry** : str or dict or list The 'sample_modifier' given in the config toml. E.g., to initialize "obj_name" from register, these are possible formats: "obj_name" ["obj_name", True] ["obj_name", {"setting_1": True}] {"name": "obj_name", "setting_1": True} **register** : dict Maps class names to class references. .. !! processed by numpydoc !! .. py:function:: dict_to_recarray(array_dict) Convert a dict with np arrays to a 2d recarray. Column names are derived from the dict keys. :Parameters: **array_dict** : dict Keys: string Values: ND arrays, same length and number of dimensions. All dimensions expect first will get flattened. :Returns: The recarray. .. .. !! processed by numpydoc !! .. py:function:: to_ndarray(x, dtype='float32') Turn recarray to ndarray. .. !! processed by numpydoc !! .. py:function:: find_file(directory, filename) Look for file in given directoy. Error if there are multiple. .. !! processed by numpydoc !!