utils#

Utilities and helper classes/functions#

This module contains two very important classes (Project and Workspace) as well as a number of helper classes.

Functions

check_data_health(obj)

Checks the health of pore and throat data arrays.

check_network_health(network)

This method checks the topological health of the network

dict_to_struct(d)

Converts a dictionary of numpy arrays to a numpy struct

flat_list(input_list)

Given a list of nested lists of arbitrary depth, returns a single level or 'flat' list.

get_mixture_model_args(phase[, composition, ...])

This is used in tests to run models generically

get_printable_labels(item[, suffix, hr])

This function is used by the __str__ methods on all classes to get a nicely formatted list of labels on the object.

get_printable_props(item[, suffix, hr])

This function is used by the __str__ methods on all classes to get a nicely formatted list of properties on the object.

ignore_warnings([warning])

Decorator for catching warnings.

is_symmetric(a[, rtol])

Is a a symmetric matrix?

is_transient(algorithms)

is_valid_propname(propname)

Checks if propname is a valid OpenPNM propname, i.e. starts with 'pore.' or 'throat.'.

methods_to_table(obj)

Converts a methods on an object to a ReST compatible table

models_to_table(obj[, params])

Converts a all the models on an object to a ReST compatible table

sanitize_dict(input_dict)

Given a nested dictionary, ensures that all nested dicts are normal Python dicts.

struct_to_dict(s)

Converts a numpy struct array into a dictionary using the struct labels as keys

Classes

Docorator

OpenPNM's customized docstring processor.

HealthDict

This class adds a 'health' check to a standard dictionary.

NestedDict

Brief explanation of 'NestedDict'

PrintableDict

Simple subclass of dict that has nicer printing.

PrintableList

Simple subclass of list that has nice printing.

Project

This class provides a container for all OpenPNM objects in a given simulation.

SettingsAttr

A custom data class that holds settings for objects.

TypedList

A list that enforces all elements have the same type.

TypedMixin

Based class for enforcing types on lists and sets.

TypedSet

A set that enforces all elements have the same type.

Workspace

The Workspace object provides the highest level of adminstrative control over active OpenPNM sessions.