orcanet.misc
Odds and ends.
Module Contents
Functions
E.g. for storing orcanet layer blocks as custom objects. |
|
|
Get an initilized object via a toml entry. |
|
Convert a dict with np arrays to a 2d recarray. |
|
Turn recarray to ndarray. |
|
Look for file in given directoy. Error if there are multiple. |
- orcanet.misc.from_register(toml_entry, register)[source]
Get an initilized object via a toml entry. Used for loading orcanet built-in sample modifiers etc.
- Parameters
- toml_entrystr 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}
- registerdict
Maps class names to class references.
- orcanet.misc.dict_to_recarray(array_dict)[source]
Convert a dict with np arrays to a 2d recarray. Column names are derived from the dict keys.
- Parameters
- array_dictdict
Keys: string Values: ND arrays, same length and number of dimensions.
All dimensions expect first will get flattened.
- Returns
- The recarray.