Skip to content

Commit

Permalink
fix arg order
Browse files Browse the repository at this point in the history
  • Loading branch information
zingale committed Sep 8, 2024
1 parent 7778d30 commit b607e2a
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 13 deletions.
5 changes: 3 additions & 2 deletions pyro/advection/tests/test_advection.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import pyro.advection.simulation as sn
from pyro.advection.problems import test
import pyro.advection.simulation as sim
from pyro.util import runparams


Expand All @@ -19,7 +20,7 @@ def setup_method(self):
self.rp.params["mesh.ny"] = 8
self.rp.params["particles.do_particles"] = 0

self.sim = sn.Simulation("advection", "test", self.rp)
self.sim = sim.Simulation("advection", "test", test.init_data, self.rp)
self.sim.initialize()

def teardown_method(self):
Expand Down
4 changes: 2 additions & 2 deletions pyro/advection_nonuniform/tests/test_advection_nonuniform.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import pyro.advection_nonuniform.problems.test as test
from pyro.advection_nonuniform.problems import test
import pyro.advection_nonuniform.simulation as sim
from pyro.util import runparams

Expand All @@ -20,7 +20,7 @@ def setup_method(self):
self.rp.params["mesh.ny"] = 8
self.rp.params["particles.do_particles"] = 0

self.sim = sim.Simulation("advection_nonuniform", "test", self.rp, test.init_data)
self.sim = sim.Simulation("advection_nonuniform", "test", test.init_data, self.rp)
self.sim.initialize()

def teardown_method(self):
Expand Down
6 changes: 3 additions & 3 deletions pyro/compressible/tests/test_compressible.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def setup_method(self):
self.rp.params["eos.gamma"] = 1.4
self.rp.params["compressible.grav"] = 1.0

self.sim = sim.Simulation("compressible", "test", self.rp, test.init_data)
self.sim = sim.Simulation("compressible", "test", test.init_data, self.rp)
self.sim.initialize()

def teardown_method(self):
Expand All @@ -46,13 +46,13 @@ def test_prim(self):

# U -> q
gamma = self.sim.cc_data.get_aux("gamma")
q = sn.cons_to_prim(self.sim.cc_data.data, gamma, self.sim.ivars, self.sim.cc_data.grid)
q = sim.cons_to_prim(self.sim.cc_data.data, gamma, self.sim.ivars, self.sim.cc_data.grid)

assert q[:, :, self.sim.ivars.ip].min() == pytest.approx(1.0) and \
q[:, :, self.sim.ivars.ip].max() == pytest.approx(1.0)

# q -> U
U = sn.prim_to_cons(q, gamma, self.sim.ivars, self.sim.cc_data.grid)
U = sim.prim_to_cons(q, gamma, self.sim.ivars, self.sim.cc_data.grid)
assert_array_equal(U, self.sim.cc_data.data)

def test_derives(self):
Expand Down
4 changes: 2 additions & 2 deletions pyro/compressible_rk/tests/test_compressible_rk.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import pyro.compressible_rk.problems.test as test
from pyro.compressible_rk.problems import test
import pyro.compressible_rk.simulation as sim
from pyro.util import runparams

Expand All @@ -23,7 +23,7 @@ def setup_method(self):
self.rp.params["eos.gamma"] = 1.4
self.rp.params["compressible.grav"] = 1.0

self.sim = sim.Simulation("compressible", "test", self.rp, test.init_data)
self.sim = sim.Simulation("compressible", "test", test.init_data, self.rp)
self.sim.initialize()

def teardown_method(self):
Expand Down
4 changes: 2 additions & 2 deletions pyro/diffusion/tests/test_diffusion.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import pyro.diffusion.problems.test as test
from pyro.diffusion.problems import test
import pyro.diffusion.simulation as sim
from pyro.util import runparams

Expand All @@ -20,7 +20,7 @@ def setup_method(self):
self.rp.params["mesh.nx"] = 8
self.rp.params["mesh.ny"] = 8

self.sim = sim.Simulation("diffusion", "test", self.rp, test.init_data)
self.sim = sim.Simulation("diffusion", "test", test.init_data, self.rp)
self.sim.initialize()

def teardown_method(self):
Expand Down
4 changes: 2 additions & 2 deletions pyro/swe/tests/test_swe.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import numpy as np
from numpy.testing import assert_array_equal

import pyro.swe.problems.test as test
from pyro.swe.problems import test
import pyro.swe.simulation as sim
from pyro.util import runparams

Expand All @@ -25,7 +25,7 @@ def setup_method(self):

self.rp.params["swe.grav"] = 1.0

self.sim = sim.Simulation("swe", "test", self.rp, test.init_data)
self.sim = sim.Simulation("swe", "test", test.init_data, self.rp)
self.sim.initialize()

def teardown_method(self):
Expand Down

0 comments on commit b607e2a

Please sign in to comment.