<commit_before>import scipy as _sp


def poisson_conductance(target, pore_diffusivity, throat_diffusivity,
                        throat_equivalent_area, throat_conduit_lengths):
    r"""
    Calculate the generic conductance (could be mass, thermal, or
    electrical conductance) of conduits in network, where a conduit is
    ( 1/2 pore - full throat - 1/2 pore ) based on the areas

    Parameters
    ----------
    target : OpenPNM Object
        The object which this model is associated with. This controls the
        length of the calculated array, and also provides access to other
        necessary properties.

    pore_diffusivity : string
        Dictionary key of the pore diffusivity values

    throat_diffusivity : string
        Dictionary key of the throat diffusivity values

    throat_equivalent_area : string
        Dictionary key of the throat equivalent area values

    throat_conduit_lengths : string
        Dictionary key of the throat conduit lengths

    Notes
    -----
    (1) This function requires that all the necessary phase properties already
    be calculated.

    (2) This function calculates the specified property for the *entire*
    network then extracts the values for the appropriate throats at the end.

    """
    network = target.project.network
    throats = network.map_throats(throats=target.Ts, origin=target)
    phase = target.project.find_phase(target)
    geom = target.project.find_geometry(target)
    cn = network['throat.conns'][throats]
    # Getting equivalent areas
    A1 = geom[throat_equivalent_area+'.pore1']
    At = geom[throat_equivalent_area+'.throat']
    A2 = geom[throat_equivalent_area+'.pore2']
    # Getting conduit lengths
    L1 = geom[throat_conduit_lengths+'.pore1']
    Lt = geom[throat_conduit_lengths+'.throat']
    L2 = geom[throat_conduit_lengths+'.pore2']
    # Interpolate pore phase property values to throats
    try:
        Dt = phase[throat_diffusivity]
    except KeyError:
        Dt = phase.interpolate_data(propname=pore_diffusivity)<commit_msg>Made poisson_conductance to use look up data on network rather than geom<commit_after>import scipy as _sp


def poisson_conductance(target, pore_diffusivity, throat_diffusivity,
                        throat_equivalent_area, throat_conduit_lengths):
    r"""
    Calculate the generic conductance (could be mass, thermal, or
    electrical conductance) of conduits in network, where a conduit is
    ( 1/2 pore - full throat - 1/2 pore ) based on the areas

    Parameters
    ----------
    target : OpenPNM Object
        The object which this model is associated with. This controls the
        length of the calculated array, and also provides access to other
        necessary properties.

    pore_diffusivity : string
        Dictionary key of the pore diffusivity values

    throat_diffusivity : string
        Dictionary key of the throat diffusivity values

    throat_equivalent_area : string
        Dictionary key of the throat equivalent area values

    throat_conduit_lengths : string
        Dictionary key of the throat conduit lengths

    Notes
    -----
    (1) This function requires that all the necessary phase properties already
    be calculated.

    (2) This function calculates the specified property for the *entire*
    network then extracts the values for the appropriate throats at the end.

    """
    network = target.project.network
    throats = network.map_throats(throats=target.Ts, origin=target)
    phase = target.project.find_phase(target)
    cn = network['throat.conns'][throats]
    # Getting equivalent areas
    A1 = network[throat_equivalent_area+'.pore1'][throats]
    At = network[throat_equivalent_area+'.throat'][throats]
    A2 = network[throat_equivalent_area+'.pore2'][throats]
    # Getting conduit lengths
    L1 = network[throat_conduit_lengths+'.pore1'][throats]
    Lt = network[throat_conduit_lengths+'.throat'][throats]
    L2 = network[throat_conduit_lengths+'.pore2'][throats]
    # Interpolate pore phase property values to throats
    try:
        Dt = phase[throat_diffusivity]
    except KeyError:
        Dt = phase.interpolate_data(propname=pore_diffusivity)
{'fraction_non_alphanumeric': 0.06960057402535279, 'fraction_numerical': 0.006696962449174839, 'mean_word_length': 3.237082066869301, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4415659', 'n_tokens_mistral': 1255, 'n_tokens_neox': 1163, 'n_words': 376}