<commit_before>import pytest
import numpy as np
import openpnm as op
mgr = op.Workspace()


class OrdinaryPercolationTest:

    def setup_class(self):
        self.net = op.network.Cubic(shape=[5, 5, 5], spacing=0.0005)
        self.geo = op.geometry.SpheresAndCylinders(network=self.net,
                                             pores=self.net.Ps,
                                             throats=self.net.Ts)
        self.water = op.phase.Water(network=self.net)
        self.air = op.phase.Air(network=self.net)
        self.phys = op.physics.GenericPhysics(network=self.net,
                                              phase=self.water,
                                              geometry=self.geo)
        mod = op.models.physics.capillary_pressure.washburn
        self.phys.add_model(propname='throat.entry_pressure',
                            model=mod)

    def test_set_inlets_overwrite(self):
        self.alg = op.algorithms.OrdinaryPercolation(network=self.net,
                                                     phase=self.water)

        self.alg.set_inlets(pores=self.net.pores('top'))
        assert np.sum(self.alg['pore.inlets']) == 25

        self.alg.set_inlets(pores=self.net.pores('bottom'))
        assert np.sum(self.alg['pore.inlets']) == 50

        self.alg.set_inlets(pores=self.net.pores('top'), overwrite=True)
        assert np.sum(self.alg['pore.inlets']) == 25

        self.alg.set_inlets(pores=[], overwrite=True)
        assert np.sum(self.alg['pore.inlets']) == 0

    def test_set_inlets_conflicting_with_outlets(self):<commit_msg>getting op tests to work<commit_after>import pytest
import numpy as np
import openpnm as op
mgr = op.Workspace()


class OrdinaryPercolationTest:

    def setup_class(self):
        self.net = op.network.Cubic(shape=[5, 5, 5], spacing=0.0005)
        self.net.add_model_collection(op.models.collections.geometry.spheres_and_cylinders)
        self.net.regenerate_models()
        self.water = op.phase.Water(network=self.net)
        self.water.add_model_collection(op.models.collections.physics.standard)
        self.water.regenerate_models()
        self.air = op.phase.Air(network=self.net)
        mod = op.models.physics.capillary_pressure.washburn

    def test_set_inlets_overwrite(self):
        self.alg = op.algorithms.OrdinaryPercolation(network=self.net,
                                                     phase=self.water)

        self.alg.set_inlets(pores=self.net.pores('top'))
        assert np.sum(self.alg['pore.inlets']) == 25

        self.alg.set_inlets(pores=self.net.pores('bottom'))
        assert np.sum(self.alg['pore.inlets']) == 50

        self.alg.set_inlets(pores=self.net.pores('top'), overwrite=True)
        assert np.sum(self.alg['pore.inlets']) == 25

        self.alg.set_inlets(pores=[], overwrite=True)
        assert np.sum(self.alg['pore.inlets']) == 0

    def test_set_inlets_conflicting_with_outlets(self):
{'fraction_non_alphanumeric': 0.12440516655336506, 'fraction_numerical': 0.010197144799456152, 'mean_word_length': 2.291946308724832, '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': 12, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7313743', 'n_tokens_mistral': 978, 'n_tokens_neox': 920, 'n_words': 121}