def _find_master(self): ctrl = Controller() master = [] for item in ctrl.keys(): if ctrl[item].models is self: master.append(ctrl[item]) if len(master) > 1: raise Exception( 'More than one master found! This model dictionary has been associated with multiple objects. To use the same dictionary multiple times use the copy method.' ) return master[0]
""" =============================================================================== GenericNetwork: Abstract class to construct pore networks =============================================================================== """ import itertools import scipy as sp import scipy.sparse as sprs import scipy.spatial as sptl import OpenPNM.Utilities.misc as misc from OpenPNM.Utilities import topology from OpenPNM.Base import Core, Controller, Tools, logging logger = logging.getLogger(__name__) ctrl = Controller() topo = topology() class GenericNetwork(Core): r""" GenericNetwork - Base class to construct pore networks Parameters ---------- name : string Unique name for Network object """ def __init__(self, **kwargs): super().__init__(**kwargs)