Repository: PMEAL/OpenPNM
Pull request #1750 (2020-11-10 14:01:09)

Fixed class names with underscore and method names with uppercase letters
Class names should be camel-cased, and method names should be lower-cased snake-cased.


Patch:
diff --git a/.github/workflows/ci-macos.yml b/.github/workflows/ci-macos.yml
index 88487dc2f..f9b98dc25 100644
--- a/.github/workflows/ci-macos.yml
+++ b/.github/workflows/ci-macos.yml
@@ -36,7 +36,7 @@ jobs:
           key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{ hashFiles('**/conda_requirements.txt') }}
 
       - name: Set up conda
-        uses: goanpeca/setup-miniconda@v1
+        uses: conda-incubator/setup-miniconda@v2
         with:
           auto-update-conda: true
           python-version: ${{ matrix.python-version }}
diff --git a/.github/workflows/ci-min.yml b/.github/workflows/ci-min.yml
index c827fe356..650ae41f1 100644
--- a/.github/workflows/ci-min.yml
+++ b/.github/workflows/ci-min.yml
@@ -36,7 +36,7 @@ jobs:
           key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{ hashFiles('**/conda_requirements.txt') }}
 
       - name: Set up conda
-        uses: goanpeca/setup-miniconda@v1
+        uses: conda-incubator/setup-miniconda@v2
         with:
           auto-update-conda: true
           python-version: ${{ matrix.python-version }}
diff --git a/.github/workflows/ci-ubuntu.yml b/.github/workflows/ci-ubuntu.yml
index 1d886e35f..5f8051bd2 100644
--- a/.github/workflows/ci-ubuntu.yml
+++ b/.github/workflows/ci-ubuntu.yml
@@ -36,7 +36,7 @@ jobs:
           key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{ hashFiles('**/conda_requirements.txt') }}
 
       - name: Set up conda
-        uses: goanpeca/setup-miniconda@v1
+        uses: conda-incubator/setup-miniconda@v2
         with:
           auto-update-conda: true
           python-version: ${{ matrix.python-version }}
diff --git a/.github/workflows/ci-windows.yml b/.github/workflows/ci-windows.yml
index 509c07a32..105a4e416 100644
--- a/.github/workflows/ci-windows.yml
+++ b/.github/workflows/ci-windows.yml
@@ -36,7 +36,7 @@ jobs:
           key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{ hashFiles('**/conda_requirements.txt') }}
 
       - name: Set up conda
-        uses: goanpeca/setup-miniconda@v1
+        uses: conda-incubator/setup-miniconda@v2
         with:
           auto-update-conda: true
           python-version: ${{ matrix.python-version }}
diff --git a/.github/workflows/examples.yml b/.github/workflows/examples.yml
index 186ca9d29..5c0c6b469 100644
--- a/.github/workflows/examples.yml
+++ b/.github/workflows/examples.yml
@@ -35,7 +35,7 @@ jobs:
           key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{ hashFiles('**/conda_requirements.txt') }}
 
       - name: Set up conda
-        uses: goanpeca/setup-miniconda@v1
+        uses: conda-incubator/setup-miniconda@v2
         with:
           auto-update-conda: true
           python-version: ${{ matrix.python-version }}
diff --git a/openpnm/__init__.py b/openpnm/__init__.py
index b81be460f..a214c9a40 100644
--- a/openpnm/__init__.py
+++ b/openpnm/__init__.py
@@ -56,11 +56,11 @@ from .__version__ import __version__
 
 from . import core
 from . import utils
-from . import models
 from . import network
 from . import geometry
 from . import phases
 from . import physics
+from . import models
 from . import algorithms
 from . import materials
 from . import topotools
diff --git a/openpnm/geometry/Boundary_2D.py b/openpnm/geometry/Boundary2D.py
similarity index 95%
rename from openpnm/geometry/Boundary_2D.py
rename to openpnm/geometry/Boundary2D.py
index 09babcaab..406ce1e64 100644
--- a/openpnm/geometry/Boundary_2D.py
+++ b/openpnm/geometry/Boundary2D.py
@@ -1,4 +1,3 @@
-# -*- coding: utf-8 -*-
 """
 ===============================================================================
 Boundary -- Subclass of GenericGeometry for Boundary Pores
@@ -11,7 +10,7 @@ from openpnm.models import misc as mm
 from openpnm.geometry import GenericGeometry
 
 
-class Boundary_2D(GenericGeometry):
+class Boundary2D(GenericGeometry):
     r"""
     Boundary subclass of GenericGeometry.
 
@@ -59,7 +58,7 @@ class Boundary_2D(GenericGeometry):
         super().__init__(**kwargs)
 
         self.add_model(propname='pore.area',
-                       model=gm.pore_area.circle)
+                       model=gm.pore_cross_sectional_area.circle)
 
         self.add_model(propname='pore.volume',
                        model=mm.constant, value=0.0)
@@ -88,7 +87,7 @@ class Boundary_2D(GenericGeometry):
                        model=gm.throat_length.conduit_lengths)
 
         self.add_model(propname='throat.area',
-                       model=gm.throat_area.rectangle)
+                       model=gm.throat_cross_sectional_area.rectangle)
 
         self.add_model(propname='pore.area',
                        model=mm.from_neighbor_throats,
diff --git a/openpnm/geometry/StickAndBall_2D.py b/openpnm/geometry/StickAndBall2D.py
similarity index 97%
rename from openpnm/geometry/StickAndBall_2D.py
rename to openpnm/geometry/StickAndBall2D.py
index 3b5ffd133..4eda15110 100644
--- a/openpnm/geometry/StickAndBall_2D.py
+++ b/openpnm/geometry/StickAndBall2D.py
@@ -2,7 +2,7 @@ import openpnm.models as mods
 from openpnm.geometry import GenericGeometry
 
 
-class StickAndBall_2D(GenericGeometry):
+class StickAndBall2D(GenericGeometry):
     r"""
     2D Stick and Ball subclass of GenericGeometry.  This subclass is meant as a
     basic default geometry to get started quickly.
@@ -45,10 +45,10 @@ class StickAndBall_2D(GenericGeometry):
     >>> pn = op.network.CubicDual(shape=[5, 5, 5])
     >>> Ps = pn.pores('primary')
     >>> Ts = pn.throats('primary')
-    >>> geo1 = op.geometry.StickAndBall_2D(network=pn, pores=Ps, throats=Ts)
+    >>> geo1 = op.geometry.StickAndBall2D(network=pn, pores=Ps, throats=Ts)
     >>> Ps = pn.pores('secondary')
     >>> Ts = pn.throats(['secondary', 'interconnect'])
-    >>> geo2 = op.geometry.StickAndBall_2D(network=pn, pores=Ps, throats=Ts)
+    >>> geo2 = op.geometry.StickAndBall2D(network=pn, pores=Ps, throats=Ts)
 
     Now override the 'pore.diameter' values on the ``geo2`` object:
 
@@ -188,7 +188,7 @@ class StickAndBall_2D(GenericGeometry):
                        prop2='pore.seed')
 
         self.add_model(propname='pore.area',
-                       model=mods.geometry.pore_area.circle,
+                       model=mods.geometry.pore_cross_sectional_area.circle,
                        pore_diameter='pore.diameter')
 
         self.add_model(propname='pore.volume',
@@ -224,7 +224,7 @@ class StickAndBall_2D(GenericGeometry):
                        throat_length='throat.length')
 
         self.add_model(propname='throat.area',
-                       model=mods.geometry.throat_area.rectangle,
+                       model=mods.geometry.throat_cross_sectional_area.rectangle,
                        throat_diameter='throat.diameter')
 
         self.add_model(propname='throat.conduit_lengths',
diff --git a/openpnm/geometry/__init__.py b/openpnm/geometry/__init__.py
index 81c155093..60a2351e5 100644
--- a/openpnm/geometry/__init__.py
+++ b/openpnm/geometry/__init__.py
@@ -90,7 +90,7 @@ that change can be cascaded to all dependent properties ('pore.diameter').
 """
 from .GenericGeometry import GenericGeometry
 from .StickAndBall import StickAndBall
-from .StickAndBall_2D import StickAndBall_2D
+from .StickAndBall2D import StickAndBall2D
 from .Boundary import Boundary
-from .Boundary_2D import Boundary_2D
+from .Boundary2D import Boundary2D
 from .Imported import Imported
diff --git a/openpnm/models/physics/diffusive_conductance.py b/openpnm/models/physics/diffusive_conductance.py
index 1f24e9904..459570db9 100644
--- a/openpnm/models/physics/diffusive_conductance.py
+++ b/openpnm/models/physics/diffusive_conductance.py
@@ -101,14 +101,14 @@ def ordinary_diffusion(
     return (1/gt/SFt + 1/g1/SF1 + 1/g2/SF2)**(-1)
 
 
-def ordinary_diffusion_2D(
+def ordinary_diffusion_2d(
     target,
-    pore_diameter='pore.diameter',
-    throat_diameter='throat.diameter',
-    pore_diffusivity='pore.diffusivity',
-    throat_diffusivity='throat.diffusivity',
-    conduit_lengths='throat.conduit_lengths',
-    conduit_shape_factors='throat.poisson_shape_factors'
+    pore_diameter="pore.diameter",
+    throat_diameter="throat.diameter",
+    pore_diffusivity="pore.diffusivity",
+    throat_diffusivity="throat.diffusivity",
+    conduit_lengths="throat.conduit_lengths",
+    conduit_shape_factors="throat.poisson_shape_factors",
 ):
     r"""
     Calculate the diffusive conductance of conduits in network, where a
diff --git a/openpnm/models/physics/flow_shape_factors.py b/openpnm/models/physics/flow_shape_factors.py
index 314c118d7..56d039298 100644
--- a/openpnm/models/physics/flow_shape_factors.py
+++ b/openpnm/models/physics/flow_shape_factors.py
@@ -1,6 +1,7 @@
 r"""
 
 .. autofunction:: openpnm.models.physics.flow_shape_factors.ball_and_stick
+.. autofunction:: openpnm.models.physics.flow_shape_factors.ball_and_stick_2d
 .. autofunction:: openpnm.models.physics.flow_shape_factors.conical_frustum_and_stick
 
 """
@@ -186,11 +187,14 @@ def conical_frustum_and_stick(target, pore_area='pore.area',
     return {'pore1': SF1, 'throat': SFt, 'pore2': SF2}
 
 
-def ball_and_stick_2D(target, pore_area='pore.area',
-                      throat_area='throat.area',
-                      pore_diameter='pore.diameter',
-                      throat_diameter='throat.diameter',
-                      conduit_lengths='throat.conduit_lengths'):
+def ball_and_stick_2d(
+    target,
+    pore_area="pore.area",
+    throat_area="throat.area",
+    pore_diameter="pore.diameter",
+    throat_diameter="throat.diameter",
+    conduit_lengths="throat.conduit_lengths",
+):
     r"""
     Calculate conduit shape factors for hydraulic conductance, assuming
     pores and throats are circles (balls) and rectangles (sticks).
diff --git a/openpnm/models/physics/hydraulic_conductance.py b/openpnm/models/physics/hydraulic_conductance.py
index 9e27b9209..50278bfc6 100644
--- a/openpnm/models/physics/hydraulic_conductance.py
+++ b/openpnm/models/physics/hydraulic_conductance.py
@@ -1,7 +1,7 @@
 r"""
 
 .. autofunction:: openpnm.models.physics.hydraulic_conductance.hagen_poiseuille
-.. autofunction:: openpnm.models.physics.hydraulic_conductance.hagen_poiseuille_2D
+.. autofunction:: openpnm.models.physics.hydraulic_conductance.hagen_poiseuille_2d
 .. autofunction:: openpnm.models.physics.hydraulic_conductance.hagen_poiseuille_power_law
 
 """
@@ -103,7 +103,7 @@ def hagen_poiseuille(
     return (1/gt/SFt + 1/g1/SF1 + 1/g2/SF2) ** (-1)
 
 
-def hagen_poiseuille_2D(
+def hagen_poiseuille_2d(
     target,
     pore_diameter="pore.diameter",
     throat_diameter="throat.diameter",
diff --git a/openpnm/models/physics/ionic_conductance.py b/openpnm/models/physics/ionic_conductance.py
index 66413827c..8fddb3001 100644
--- a/openpnm/models/physics/ionic_conductance.py
+++ b/openpnm/models/physics/ionic_conductance.py
@@ -137,7 +137,7 @@ def poisson(target,
     return g
 
 
-def poisson_2D(target,
+def poisson_2d(target,
                pore_diameter='pore.diameter',
                throat_diameter='throat.diameter',
                pore_diffusivity='pore.diffusivity',
@@ -333,7 +333,7 @@ def laplace(target,
                    conduit_shape_factors=conduit_shape_factors)
 
 
-def laplace_2D(target,
+def laplace_2d(target,
                pore_diameter='pore.diameter',
                throat_diameter='throat.diameter',
                pore_diffusivity='pore.diffusivity',
@@ -610,7 +610,7 @@ def electroneutrality(target,
     return g
 
 
-def electroneutrality_2D(target,
+def electroneutrality_2d(target,
                          pore_diameter='pore.diameter',
                          throat_diameter='throat.diameter',
                          pore_diffusivity='pore.diffusivity',
diff --git a/openpnm/models/physics/poisson_shape_factors.py b/openpnm/models/physics/poisson_shape_factors.py
index 90cefa527..a969cef77 100644
--- a/openpnm/models/physics/poisson_shape_factors.py
+++ b/openpnm/models/physics/poisson_shape_factors.py
@@ -1,6 +1,7 @@
 r"""
 
 .. autofunction:: openpnm.models.physics.poisson_shape_factors.ball_and_stick
+.. autofunction:: openpnm.models.physics.poisson_shape_factors.ball_and_stick_2d
 .. autofunction:: openpnm.models.physics.poisson_shape_factors.conical_frustum_and_stick
 
 """
@@ -182,11 +183,14 @@ def conical_frustum_and_stick(target, pore_area='pore.area',
     return {'pore1': SF1, 'throat': SFt, 'pore2': SF2}
 
 
-def ball_and_stick_2D(target, pore_area='pore.area',
-                      throat_area='throat.area',
-                      pore_diameter='pore.diameter',
-                      throat_diameter='throat.diameter',
-                      conduit_lengths='throat.conduit_lengths'):
+def ball_and_stick_2d(
+    target,
+    pore_area="pore.area",
+    throat_area="throat.area",
+    pore_diameter="pore.diameter",
+    throat_diameter="throat.diameter",
+    conduit_lengths="throat.conduit_lengths",
+):
     r"""
     Calculate conduit shape factors for throat conductance associated with
     diffusion-like physics (ex. thermal/diffusive/electrical conductance),
@@ -252,11 +256,12 @@ def ball_and_stick_2D(target, pore_area='pore.area',
     # INFO: This is needed since area could also be zero, which confuses NumPy
     m1, m2, mt = [Li != 0 for Li in [L1, L2, Lt]]
     SF1[~m1] = SF2[~m2] = SFt[~mt] = 1
-    F1[m1] = (0.5 * _atanh(2*L1/_sqrt(D1**2 - 4*L1**2)))[m1]
-    F2[m2] = (0.5 * _atanh(2*L2/_sqrt(D2**2 - 4*L2**2)))[m2]
-    Ft[mt] = (Lt/At)[mt]
+    F1[m1] = (0.5 * _np.arcsin(2 * L1 / D1))[m1]
+    F2[m2] = (0.5 * _np.arcsin(2 * L2 / D2))[m2]
+    Ft[mt] = (Lt / At)[mt]
     # Calculate conduit shape factors
-    SF1[m1] = (L1 / (A1*F1))[m1]
-    SF2[m2] = (L2 / (A2*F2))[m2]
-    SFt[mt] = (Lt / (At*Ft))[mt]
-    return {'pore1': SF1, 'throat': SFt, 'pore2': SF2}
+    SF1[m1] = (L1 / (A1 * F1))[m1]
+    SF2[m2] = (L2 / (A2 * F2))[m2]
+    SFt[mt] = (Lt / (At * Ft))[mt]
+
+    return {"pore1": SF1, "throat": SFt, "pore2": SF2}
diff --git a/openpnm/physics/Standard_2D.py b/openpnm/physics/Standard2D.py
similarity index 97%
rename from openpnm/physics/Standard_2D.py
rename to openpnm/physics/Standard2D.py
index c3ac0ce84..76282c6d2 100644
--- a/openpnm/physics/Standard_2D.py
+++ b/openpnm/physics/Standard2D.py
@@ -5,7 +5,7 @@ logger = logging.getLogger(__name__)
 ws = Workspace()
 
 
-class Standard_2D(GenericPhysics):
+class Standard2D(GenericPhysics):
     r"""
     Generic class to generate Physics objects for true 2D simulations.
 
@@ -47,11 +47,11 @@ class Standard_2D(GenericPhysics):
                          **kwargs)
 
         self.add_model(propname='throat.flow_shape_factors',
-                       model=mods.flow_shape_factors.ball_and_stick_2D)
+                       model=mods.flow_shape_factors.ball_and_stick_2d)
         self.add_model(propname='throat.hydraulic_conductance',
-                       model=mods.hydraulic_conductance.hagen_poiseuille_2D)
+                       model=mods.hydraulic_conductance.hagen_poiseuille_2d)
         self.add_model(propname='throat.poisson_shape_factors',
-                       model=mods.poisson_shape_factors.ball_and_stick_2D)
+                       model=mods.poisson_shape_factors.ball_and_stick_2d)
         self.add_model(propname='throat.diffusive_conductance',
                        model=mods.diffusive_conductance.ordinary_diffusion)
         self.add_model(propname='throat.entry_pressure',
diff --git a/openpnm/physics/__init__.py b/openpnm/physics/__init__.py
index d1ad3ce6b..938926fd7 100644
--- a/openpnm/physics/__init__.py
+++ b/openpnm/physics/__init__.py
@@ -25,5 +25,5 @@ classes that include common pore-scale physical models
 
 from .GenericPhysics import GenericPhysics
 from .Standard import Standard
-from .Standard_2D import Standard_2D
+from .Standard2D import Standard2D
 from .Classic import Classic


Test patch:
diff --git a/tests/unit/models/physics/DiffusiveConductanceTest.py b/tests/unit/models/physics/DiffusiveConductanceTest.py
index e0f08fc67..c7ec3912c 100644
--- a/tests/unit/models/physics/DiffusiveConductanceTest.py
+++ b/tests/unit/models/physics/DiffusiveConductanceTest.py
@@ -1,8 +1,6 @@
 import numpy as np
-import scipy as sp
 import openpnm as op
 from numpy.testing import assert_allclose
-from numpy.testing import assert_approx_equal
 
 
 class DiffusiveConductanceTest:
@@ -11,12 +9,12 @@ class DiffusiveConductanceTest:
         self.geo = op.geometry.GenericGeometry(network=self.net,
                                                pores=self.net.Ps,
                                                throats=self.net.Ts)
-        self.geo['pore.diameter'] = 1
+        self.geo['pore.diameter'] = 1.
         self.geo['throat.diameter'] = 0.5
-        self.geo['pore.area'] = 1
-        self.geo['throat.area'] = 1
+        self.geo['pore.area'] = 1.
+        self.geo['throat.area'] = 1.
         self.phase = op.phases.GenericPhase(network=self.net)
-        self.phase['pore.diffusivity'] = 1
+        self.phase['pore.diffusivity'] = 1.3
         self.phase['pore.molecular_weight'] = 0.029
         self.phase['pore.temperature'] = 345
         self.phys = op.physics.GenericPhysics(network=self.net,
@@ -28,33 +26,38 @@ class DiffusiveConductanceTest:
         self.geo['throat.conduit_lengths.throat'] = 0.6
         self.geo['throat.conduit_lengths.pore2'] = 0.25
         mod = op.models.physics.diffusive_conductance.ordinary_diffusion
-        self.phys.add_model(propname='throat.o_diffusive_conductance',
-                            model=mod)
-        self.phys.regenerate_models()
+        self.phys.add_model(propname='throat.o_diffusive_conductance', model=mod)
         actual = self.phys['throat.o_diffusive_conductance'].mean()
-        assert_approx_equal(actual, desired=1.0)
+        assert_allclose(actual, desired=1.3)
+
+    def test_ordinary_diffusion_2d(self):
+        self.geo['throat.conduit_lengths.pore1'] = 0.15
+        self.geo['throat.conduit_lengths.throat'] = 0.6
+        self.geo['throat.conduit_lengths.pore2'] = 0.25
+        mod = op.models.physics.diffusive_conductance.ordinary_diffusion_2d
+        self.phys.add_model(propname='throat.o_diffusive_conductance', model=mod)
+        actual = self.phys['throat.o_diffusive_conductance'].mean()
+        assert_allclose(actual, desired=0.8125)
 
     def test_ordinary_diffusion_with_zero_length_throats(self):
         self.geo['throat.conduit_lengths.pore1'] = 0.15
         self.geo['throat.conduit_lengths.throat'] = 0.0
         self.geo['throat.conduit_lengths.pore2'] = 0.25
         mod = op.models.physics.diffusive_conductance.ordinary_diffusion
-        self.phys.add_model(propname='throat.o_diffusive_conductance',
-                            model=mod)
+        self.phys.add_model(propname='throat.o_diffusive_conductance', model=mod)
         self.phys.regenerate_models()
         actual = self.phys['throat.o_diffusive_conductance'].mean()
-        assert_approx_equal(actual, desired=2.5)
+        assert_allclose(actual, desired=2.5 * 1.3)
 
     def test_mixed_diffusion(self):
         self.geo['throat.conduit_lengths.pore1'] = 0.15
         self.geo['throat.conduit_lengths.throat'] = 0.6
         self.geo['throat.conduit_lengths.pore2'] = 0.25
         mod = op.models.physics.diffusive_conductance.mixed_diffusion
-        self.phys.add_model(propname='throat.m_diffusive_conductance',
-                            model=mod)
+        self.phys.add_model(propname='throat.m_diffusive_conductance', model=mod)
         self.phys.regenerate_models()
         actual = self.phys['throat.m_diffusive_conductance'].mean()
-        assert_approx_equal(actual, desired=0.9905265161584661)
+        assert_allclose(actual, desired=1.284035187705028)
 
     def test_multiphase_diffusion(self):
         np.random.seed(50)
@@ -81,7 +84,7 @@ class DiffusiveConductanceTest:
         # Columns 1, 2 of conductance must be equal except for interface throat
         assert_allclose(g[:, 0][[0, 1, 3, 4]], g[:, 1][[0, 1, 3, 4]])
         # G12 and G21 at interface must differ (ratio must be K_water_air)
-        assert_allclose(g[2, 0]/g[2, 1], 1/K_water_air)
+        assert_allclose(g[2, 0] / g[2, 1], 1 / K_water_air)
         assert_allclose(g.mean(), 2.139269316e-7)
 
     def test_taylor_aris_diffusion(self):
@@ -98,8 +101,7 @@ class DiffusiveConductanceTest:
             self.phys['throat.ta_diffusive_conductance'].mean(),
             self.phys['throat.ta_diffusive_conductance'].max(),
             self.phys['throat.ta_diffusive_conductance'].min()])
-        desired = np.array([1.03744, 1.10782, 1.00017])
-        actual = np.around(actual, decimals=5)
+        desired = np.array([1.32879664, 1.38293965, 1.3001327])
         assert_allclose(actual, desired)
 
     def test_classic_ordinary_diffusion(self):
@@ -112,8 +114,7 @@ class DiffusiveConductanceTest:
                                               geometry=self.geo)
         mod = op.models.physics.diffusive_conductance.classic_ordinary_diffusion
         self.phys.add_model(propname='throat.conductance', model=mod)
-        assert np.allclose(a=self.phys['throat.conductance'][0],
-                           b=0.00084552)
+        assert np.allclose(a=self.phys['throat.conductance'][0], b=0.00084552)
 
     def test_classic_ordinary_diffusion_with_zero_length_throats(self):
         self.geo['pore.diameter'] = 1.0
@@ -125,8 +126,7 @@ class DiffusiveConductanceTest:
                                               geometry=self.geo)
         mod = op.models.physics.diffusive_conductance.classic_ordinary_diffusion
         self.phys.add_model(propname='throat.conductance', model=mod)
-        assert np.allclose(a=self.phys['throat.conductance'][0],
-                           b=0.00084552)
+        assert np.allclose(a=self.phys['throat.conductance'][0], b=0.00084552)
 
 
 if __name__ == '__main__':
@@ -136,5 +136,5 @@ if __name__ == '__main__':
     t.setup_class()
     for item in t.__dir__():
         if item.startswith('test'):
-            print('running test: '+item)
+            print(f'Running test: {item}')
             t.__getattribute__(item)()
diff --git a/tests/unit/models/physics/HydraulicConductanceTest.py b/tests/unit/models/physics/HydraulicConductanceTest.py
index 61748416b..a7983fc59 100644
--- a/tests/unit/models/physics/HydraulicConductanceTest.py
+++ b/tests/unit/models/physics/HydraulicConductanceTest.py
@@ -1,6 +1,6 @@
 import openpnm as op
 import numpy as _np
-from numpy.testing import assert_approx_equal
+from numpy.testing import assert_allclose
 
 
 class HydraulicConductanceTest:
@@ -30,16 +30,16 @@ class HydraulicConductanceTest:
         mod = op.models.physics.hydraulic_conductance.hagen_poiseuille
         self.phys.add_model(propname='throat.hydraulic_conductance', model=mod)
         actual = self.phys['throat.hydraulic_conductance'].mean()
-        assert_approx_equal(actual, desired=1421.0262776)
+        assert_allclose(actual, desired=1421.0262776)
 
-    def test_hagen_poiseuille_2D(self):
+    def test_hagen_poiseuille_2d(self):
         self.geo['throat.conduit_lengths.pore1'] = 0.25
         self.geo['throat.conduit_lengths.throat'] = 0.6
         self.geo['throat.conduit_lengths.pore2'] = 0.15
-        mod = op.models.physics.hydraulic_conductance.hagen_poiseuille_2D
+        mod = op.models.physics.hydraulic_conductance.hagen_poiseuille_2d
         self.phys.add_model(propname='throat.hydraulic_conductance', model=mod)
         actual = self.phys['throat.hydraulic_conductance'].mean()
-        assert_approx_equal(actual, desired=1602.564)
+        assert_allclose(actual, desired=1602.564)
 
     def test_hagen_poiseuille_zero_length_throat(self):
         self.geo['throat.conduit_lengths.pore1'] = 0.25
@@ -49,7 +49,7 @@ class HydraulicConductanceTest:
         self.phys.add_model(propname='throat.hydraulic_conductance',
                             model=mod)
         actual = self.phys['throat.hydraulic_conductance'].mean()
-        assert_approx_equal(actual, desired=9947.1839)
+        assert_allclose(actual, desired=9947.1839)
 
     def test_classic_hagen_poiseuille(self):
         self.geo['pore.diameter'] = 1.0
@@ -72,14 +72,14 @@ class HydraulicConductanceTest:
                                               phase=self.phase,
                                               geometry=self.geo)
         mod = op.models.physics.hydraulic_conductance.valvatne_blunt
-        sf = _np.sqrt(3)/36.0
-        self.geo['pore.shape_factor'] = _np.ones(self.geo.Np)*sf
-        self.geo['throat.shape_factor'] = _np.ones(self.geo.Nt)*sf
+        sf = _np.sqrt(3) / 36.0
+        self.geo['pore.shape_factor'] = _np.ones(self.geo.Np) * sf
+        self.geo['throat.shape_factor'] = _np.ones(self.geo.Nt) * sf
         self.phys.add_model(propname='throat.valvatne_conductance', model=mod)
         actual = self.phys['throat.valvatne_conductance'].mean()
         desired = 1030.9826  # This is the old value
         desired = 7216.8783  # This is what it gets now
-        assert_approx_equal(actual, desired=desired)
+        assert_allclose(actual, desired=desired)
 
 
 if __name__ == '__main__':
@@ -89,5 +89,5 @@ if __name__ == '__main__':
     t.setup_class()
     for item in t.__dir__():
         if item.startswith('test'):
-            print('running test: '+item)
+            print(f'Running test: {item}')
             t.__getattribute__(item)()
diff --git a/tests/unit/network/CubicTest.py b/tests/unit/network/CubicTest.py
index 1692992bf..5aaa271f7 100644
--- a/tests/unit/network/CubicTest.py
+++ b/tests/unit/network/CubicTest.py
@@ -60,7 +60,7 @@ class CubicTest:
         net = op.network.Cubic(shape=[200, 200, 1], spacing=1e-9)
         assert np.allclose(net.shape, [200, 200, 1])
 
-    def test_spacing_3D_rotated(self):
+    def test_spacing_3d_rotated(self):
         net = op.network.Cubic(shape=[5, 5, 5], spacing=[1, 1, 1])
         theta = 0.1
         R = np.array([[1, 0, 0],
@@ -69,7 +69,7 @@ class CubicTest:
         net['pore.coords'] = net['pore.coords'] @ R.T
         assert np.allclose(net.spacing, [1, 1, 1])
 
-    def test_spacing_3D_rotated_uneven(self):
+    def test_spacing_3d_rotated_uneven(self):
         net = op.network.Cubic(shape=[3, 4, 5], spacing=[1, 2, 3])
         theta = 0.1
         R = np.array([[1, 0, 0],
@@ -78,7 +78,7 @@ class CubicTest:
         net['pore.coords'] = np.tensordot(net['pore.coords'], R, axes=(1, 1))
         assert np.allclose(net.spacing, [1, 2, 3])
 
-    def test_spacing_2D_sheared(self):
+    def test_spacing_2d_sheared(self):
         net = op.network.Cubic(shape=[5, 5, 1], spacing=1)
         S = np.array([[1, 1, 0],
                       [0, 1, 0],
@@ -86,7 +86,7 @@ class CubicTest:
         net['pore.coords'] = (S@net['pore.coords'].T).T
         assert np.allclose(net.spacing, [1, 2**0.5, 0])
 
-    def test_spacing_2D_sheared_uneven(self):
+    def test_spacing_2d_sheared_uneven(self):
         net = op.network.Cubic(shape=[5, 5, 1], spacing=[1, 2])
         S = np.array([[1, 1, 0],
                       [0, 1, 0],
@@ -94,7 +94,7 @@ class CubicTest:
         net['pore.coords'] = (S@net['pore.coords'].T).T
         assert np.allclose(net.spacing, [1.0, 2*(2**0.5), 0.0])
 
-    def test_spacing_3D_sheared(self):
+    def test_spacing_3d_sheared(self):
         net = op.network.Cubic(shape=[5, 5, 3], spacing=1)
         S = np.array([[1, 1, 0],
                       [0, 1, 0],
@@ -102,7 +102,7 @@ class CubicTest:
         net['pore.coords'] = (S@net['pore.coords'].T).T
         assert np.allclose(net.spacing, [1.0, 2**0.5, 1.0])
 
-    def test_spacing_3D_sheared_uneven(self):
+    def test_spacing_3d_sheared_uneven(self):
         net = op.network.Cubic(shape=[3, 4, 5], spacing=[1, 2, 3])
         S = np.array([[1, 1, 0],
                       [0, 1, 0],
@@ -240,5 +240,5 @@ if __name__ == '__main__':
     self = t
     for item in t.__dir__():
         if item.startswith('test'):
-            print('running test: '+item)
+            print(f'Running test: {item}')
             t.__getattribute__(item)()
diff --git a/tests/unit/network/LabelTest.py b/tests/unit/network/LabelTest.py
index 1625cd65e..9a372cee9 100644
--- a/tests/unit/network/LabelTest.py
+++ b/tests/unit/network/LabelTest.py
@@ -30,7 +30,7 @@ class LabelTest:
         assert net.num_pores('left') == 16
         assert net.num_pores(['left', 'top'], mode='xnor') == 4
 
-    def test_cubic_2D(self):
+    def test_cubic_2d(self):
         net = op.network.Cubic(shape=[5, 5, 1])
         assert 'pore.top' not in net.labels()
         assert 'pore.bottom' not in net.labels()
@@ -52,5 +52,5 @@ if __name__ == '__main__':
     self = t
     for item in t.__dir__():
         if item.startswith('test'):
-            print('running test: '+item)
+            print(f'Running test: {item}')
             t.__getattribute__(item)()
diff --git a/tests/unit/network/VoronoiTest.py b/tests/unit/network/VoronoiTest.py
index ac0674877..4b2df0acb 100644
--- a/tests/unit/network/VoronoiTest.py
+++ b/tests/unit/network/VoronoiTest.py
@@ -18,7 +18,7 @@ class VoronoiTest:
         net = op.network.Voronoi(points=points, shape=[1, 1, 1])
         assert net.Np > 30
 
-    def test_voronoi_2D(self):
+    def test_voronoi_2d(self):
         net = op.network.Voronoi(num_points=30, shape=[1, 1, 0])
         assert net.Np > 30
 
@@ -30,5 +30,5 @@ if __name__ == '__main__':
     self = t
     for item in t.__dir__():
         if item.startswith('test'):
-            print('running test: '+item)
+            print(f'Running test: {item}')
             t.__getattribute__(item)()
diff --git a/tests/unit/topotools/TopotoolsTest.py b/tests/unit/topotools/TopotoolsTest.py
index cfb5266f5..19988d121 100644
--- a/tests/unit/topotools/TopotoolsTest.py
+++ b/tests/unit/topotools/TopotoolsTest.py
@@ -184,7 +184,7 @@ class TopotoolsTest:
         assert isinstance(pn['pore.test_vals'], np.ndarray)
         assert ('pore.' + geo2.name) in pn.keys()
 
-    def test_subdivide_3D(self):
+    def test_subdivide_3d(self):
         net = op.network.Cubic(shape=[3, 3, 3])
         assert net.Np == 27
         assert net.Nt == 54
@@ -194,7 +194,7 @@ class TopotoolsTest:
         assert net.Np == 27 - 1 + 125
         assert net.Nt == 54 - 6 + 300 + 25 * 6
 
-    def test_subdivide_2D(self):
+    def test_subdivide_2d(self):
         net = op.network.Cubic(shape=[1, 3, 3])
         assert net.Np == 9
         assert net.Nt == 12