project_to_dict#

project_to_dict(project, categorize_by=['name'], flatten=False, element=None, delim=' | ')[source]#

Returns a single dictionary object containing data from the given OpenPNM project, with the keys organized differently depending on optional arguments.

Parameters:
  • project (list) – An OpenPNM project object

  • categorize_by (str or list[str]) –

    Indicates how the dictionaries should be organized. The list can contain any, all or none of the following strings:

    ’object’ : If specified the dictionary keys will be stored under a general level corresponding to their type (e.g. ‘network/net_01/pore.all’).

    ’name’ : If specified, then the data arrays are additionally categorized by their name. This is enabled by default.

    ’data’ : If specified the data arrays are additionally categorized by label and property to separate boolean from numeric data.

    ’element’ : If specified the data arrays are additionally categorized by pore and throat, meaning that the propnames are no longer prepended by a ‘pore.’ or ‘throat.’

Returns:

  • A dictionary with the data stored in a hierarchical data structure, the

  • actual format of which depends on the arguments to the function.