<commit_before>import openpnm as op
import scipy as sp
mgr = op.Workspace()


class MercuryIntrusionTest:

    def setup_class(self):
        self.net = op.network.Cubic(shape=[15, 15, 15], spacing=0.0005)
        self.geo = op.geometry.StickAndBall(network=self.net,
                                            pores=self.net.Ps,
                                            throats=self.net.Ts)

    def test_run(self):
        mip = op.algorithms.metrics.MercuryIntrusion(network=self.net)
        assert mip['pore.invasion_sequence'].max() > 2
        assert mip['throat.invasion_sequence'].max() > 2

    def test_pcsnwp_data(self):
        mip = op.algorithms.metrics.MercuryIntrusion(network=self.net)
        mip.pc_data = [1e1, 1e3, 1e5, 1e6]
        mip.snwp_data = [0.0, 0.1, 0.5, 0.9]
        assert sp.all(mip.pc_data == [1e1, 1e3, 1e5, 1e6])
        assert sp.all(mip.snwp_data == [0.0, 0.1, 0.5, 0.9])

    def test_plot_data(self):
        mip = op.algorithms.metrics.MercuryIntrusion(network=self.net)
        mip.pc_data = [1e1, 1e3, 1e5, 1e6]
        mip.snwp_data = [0.0, 0.1, 0.5, 0.9]
        fig = mip.plot_intrusion_curve()


if __name__ == '__main__':

    t = MercuryIntrusionTest()
    t.setup_class()
    self = t
    for item in t.__dir__():
        if item.startswith('test'):
            print('running test: '+item)
            t.__getattribute__(item)()<commit_msg>Updated MIP test to call run<commit_after>import openpnm as op
import scipy as sp
mgr = op.Workspace()


class MercuryIntrusionTest:

    def setup_class(self):
        self.net = op.network.Cubic(shape=[15, 15, 15], spacing=0.0005)
        self.geo = op.geometry.StickAndBall(network=self.net,
                                            pores=self.net.Ps,
                                            throats=self.net.Ts)

    def test_run(self):
        mip = op.algorithms.metrics.MercuryIntrusion(network=self.net)
        mip.run()
        assert mip['pore.invasion_sequence'].max() > 2
        assert mip['throat.invasion_sequence'].max() > 2

    def test_pcsnwp_data(self):
        mip = op.algorithms.metrics.MercuryIntrusion(network=self.net)
        mip.run()
        mip.pc_data = [1e1, 1e3, 1e5, 1e6]
        mip.snwp_data = [0.0, 0.1, 0.5, 0.9]
        assert sp.all(mip.pc_data == [1e1, 1e3, 1e5, 1e6])
        assert sp.all(mip.snwp_data == [0.0, 0.1, 0.5, 0.9])

    def test_plot_data(self):
        mip = op.algorithms.metrics.MercuryIntrusion(network=self.net)
        mip.run()
        mip.pc_data = [1e1, 1e3, 1e5, 1e6]
        mip.snwp_data = [0.0, 0.1, 0.5, 0.9]
        fig = mip.plot_intrusion_curve()


if __name__ == '__main__':

    t = MercuryIntrusionTest()
    t.setup_class()
    self = t
    for item in t.__dir__():
        if item.startswith('test'):
            print('running test: '+item)
            t.__getattribute__(item)()
{'fraction_non_alphanumeric': 0.1365700314355571, 'fraction_numerical': 0.04261264407963675, 'mean_word_length': 2.147252747252747, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3745330', 'n_tokens_mistral': 1146, 'n_tokens_neox': 1055, 'n_words': 193}