import OpenPNM
mgr = OpenPNM.Base.Workspace()
mgr.loglevel = 60


class OrdinaryPercolationTest:
    def setup_test(self):
        self.net = OpenPNM.Network.Cubic(shape=[5, 5, 5])
        self.geo = OpenPNM.Geometry.Toray090(network=self.net,
                                             pores=self.net.Ps,
                                             throats=self.net.Ts)
        self.phase = OpenPNM.Phases.Water(network=self.net)
        self.phys = OpenPNM.Physics.Standard(network=self.net,
                                             pores=self.net.Ps,
                                             throats=self.net.Ts)

import OpenPNM as op
import scipy as sp
mgr = op.Base.Workspace()
mgr.loglevel = 60


class OrdinaryPercolationTest:
    def setup_test(self):
        self.net = op.Network.Cubic(shape=[5, 5, 5])
        self.geo = op.Geometry.Toray090(network=self.net,
                                        pores=self.net.Ps,
                                        throats=self.net.Ts)
        self.phase = op.Phases.Water(network=self.net)
        self.phys = op.Physics.Standard(network=self.net,
                                        pores=self.net.Ps,
                                        throats=self.net.Ts)
        self.OP = op.Algorithms.OrdinaryPercolation(network=self.net,
                                                    invading_phase=self.phase)
        Ps = self.net.pores(labels=['bottom_boundary'])
        self.OP.run(inlets=Ps)
        self.OP.return_results(Pc=7000)
        lpf = self.OP.evaluate_late_pore_filling(Pc=8000)
        assert sp.size(lpf) == self.net.Np

Add unit test for late pore filling
Add unit test for late pore filling

- import OpenPNM
+ import OpenPNM as op
+ import scipy as sp
- mgr = OpenPNM.Base.Workspace()
+ mgr = op.Base.Workspace()
  mgr.loglevel = 60
  
  
  class OrdinaryPercolationTest:
      def setup_test(self):
-         self.net = OpenPNM.Network.Cubic(shape=[5, 5, 5])
+         self.net = op.Network.Cubic(shape=[5, 5, 5])
-         self.geo = OpenPNM.Geometry.Toray090(network=self.net,
+         self.geo = op.Geometry.Toray090(network=self.net,
-                                              pores=self.net.Ps,
+                                         pores=self.net.Ps,
-                                              throats=self.net.Ts)
+                                         throats=self.net.Ts)
-         self.phase = OpenPNM.Phases.Water(network=self.net)
+         self.phase = op.Phases.Water(network=self.net)
-         self.phys = OpenPNM.Physics.Standard(network=self.net,
+         self.phys = op.Physics.Standard(network=self.net,
-                                              pores=self.net.Ps,
+                                         pores=self.net.Ps,
-                                              throats=self.net.Ts)
+                                         throats=self.net.Ts)
+         self.OP = op.Algorithms.OrdinaryPercolation(network=self.net,
+                                                     invading_phase=self.phase)
+         Ps = self.net.pores(labels=['bottom_boundary'])
+         self.OP.run(inlets=Ps)
+         self.OP.return_results(Pc=7000)
+         lpf = self.OP.evaluate_late_pore_filling(Pc=8000)
+         assert sp.size(lpf) == self.net.Np
  
Add unit test for late pore filling
## Code Before:
import OpenPNM
mgr = OpenPNM.Base.Workspace()
mgr.loglevel = 60


class OrdinaryPercolationTest:
    def setup_test(self):
        self.net = OpenPNM.Network.Cubic(shape=[5, 5, 5])
        self.geo = OpenPNM.Geometry.Toray090(network=self.net,
                                             pores=self.net.Ps,
                                             throats=self.net.Ts)
        self.phase = OpenPNM.Phases.Water(network=self.net)
        self.phys = OpenPNM.Physics.Standard(network=self.net,
                                             pores=self.net.Ps,
                                             throats=self.net.Ts)

## Instruction:
Add unit test for late pore filling
## Code After:
import OpenPNM as op
import scipy as sp
mgr = op.Base.Workspace()
mgr.loglevel = 60


class OrdinaryPercolationTest:
    def setup_test(self):
        self.net = op.Network.Cubic(shape=[5, 5, 5])
        self.geo = op.Geometry.Toray090(network=self.net,
                                        pores=self.net.Ps,
                                        throats=self.net.Ts)
        self.phase = op.Phases.Water(network=self.net)
        self.phys = op.Physics.Standard(network=self.net,
                                        pores=self.net.Ps,
                                        throats=self.net.Ts)
        self.OP = op.Algorithms.OrdinaryPercolation(network=self.net,
                                                    invading_phase=self.phase)
        Ps = self.net.pores(labels=['bottom_boundary'])
        self.OP.run(inlets=Ps)
        self.OP.return_results(Pc=7000)
        lpf = self.OP.evaluate_late_pore_filling(Pc=8000)
        assert sp.size(lpf) == self.net.Np
