Skip to content

Commit

Permalink
tests: Don't pass nz to the interface in case it's not required.
Browse files Browse the repository at this point in the history
  • Loading branch information
Sbte committed Sep 16, 2024
1 parent 175fce7 commit 6775316
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
3 changes: 1 addition & 2 deletions tests/jada_fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,9 @@ def num_evs():
@pytest.fixture(scope='module')
def scipy_interface(nx):
ny = nx
nz = 1

parameters = {}
interface = Interface(parameters, nx, ny, nz)
interface = Interface(parameters, nx, ny)

return interface

Expand Down
14 changes: 5 additions & 9 deletions tests/test_continuation.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from transiflow.interface import create


def Interface(parameters, nx, ny, nz, dim=None, dof=None, backend="SciPy"):
def Interface(parameters, nx, ny, nz=1, dim=None, dof=None, backend="SciPy"):
try:
return create(parameters, nx, ny, nz, dim, dof, backend=backend)
except ImportError:
Expand Down Expand Up @@ -97,10 +97,9 @@ def test_continuation_ldc_2D_stretched(backend, nx=8):
numpy.random.seed(1234)

ny = nx
nz = 1

parameters = {'Grid Stretching': True}
interface = Interface(parameters, nx, ny, nz, backend=backend)
interface = Interface(parameters, nx, ny, backend=backend)

x = interface.discretization.get_coordinate_vector(0, 1, nx)
y = interface.discretization.get_coordinate_vector(0, 1, ny)
Expand Down Expand Up @@ -175,15 +174,14 @@ def test_continuation_rayleigh_benard(backend, nx=8):
numpy.random.seed(1234)

ny = nx
nz = 1

parameters = {'Problem Type': 'Rayleigh-Benard',
'Prandtl Number': 10,
'Biot Number': 1,
'X-max': 10,
'Bordered Solver': True}

interface = Interface(parameters, nx, ny, nz, backend=backend)
interface = Interface(parameters, nx, ny, backend=backend)
continuation = Continuation(interface)

x0 = interface.vector()
Expand Down Expand Up @@ -363,14 +361,13 @@ def test_continuation_double_gyre(backend, nx=8):
numpy.random.seed(1234)

ny = nx
nz = 1

parameters = {'Problem Type': 'Double Gyre',
'Reynolds Number': 16,
'Rossby Parameter': 1000,
'Wind Stress Parameter': 0}

interface = Interface(parameters, nx, ny, nz, backend=backend)
interface = Interface(parameters, nx, ny, backend=backend)
continuation = Continuation(interface)

x0 = interface.vector()
Expand Down Expand Up @@ -402,14 +399,13 @@ def test_continuation_amoc(backend, nx=16):
numpy.random.seed(1234)

ny = nx // 2
nz = 1

parameters = {'Problem Type': 'AMOC',
'Rayleigh Number': 4e4,
'Prandtl Number': 2.25,
'X-max': 5}

interface = Interface(parameters, nx, ny, nz, backend=backend)
interface = Interface(parameters, nx, ny, backend=backend)
continuation = Continuation(interface)

x0 = interface.vector()
Expand Down

0 comments on commit 6775316

Please sign in to comment.