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

catch_module_not_found(function)

A decorator that wraps the passed in function and catches ModuleNotFound exception.

flat_list(input_list)

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

ignore_warnings([warning])

Decorator for catching warnings.

is_symmetric(a[, rtol])

Is a a symmetric matrix?

is_valid_propname(propname)

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

methods_to_table(obj)

Brief explanation of 'methods_to_table'

models_to_table(obj[, params])

Converts a ModelsDict object to a ReST compatible table

prettify_logger_message(msg)

Prettifies logger messages by breaking them up into multi lines

remove_prop_deep(obj, propname)

Hierarchically deletes the given propname and its children

sanitize_dict(input_dict)

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

tic()

Homemade version of matlab tic and toc function, tic starts or resets the clock, toc reports the time since the last call of tic.

toc([quiet])

Homemade version of matlab tic and toc function, tic starts or resets the clock, toc reports the time since the last call of tic.

unique_list(input_list)

For a given list (of points) remove any duplicates

Classes

Docorator

Brief explanation of 'Docorator'

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 hold settings for objects.

SubDict

Brief explanation of 'SubDict'

TypedList

A list that enforces all elements have the same type.

TypedMixin

Brief explanation of 'TypedMixin'

TypedSet

Brief explanation of 'TypedSet'

Workspace

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

Modules

openpnm.utils.misc