Skip to content

Commit

Permalink
fix things that brokw test
Browse files Browse the repository at this point in the history
  • Loading branch information
MaceKuailv committed Nov 18, 2024
1 parent 71eacb3 commit b2739e9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion budget/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# To close budget on particles

The way to close tracer budget on Lagrangian particles is relatively easy. Please referred to the functions in eulerian_budget and lagrangian_budget. So far, I have not gotten the time to make an illustrative example, but the api references are ready to go.
The way to close tracer budget on Lagrangian particles is relatively easy. Please referred to the functions in eulerian_budget and lagrangian_budget. So far, I have not gotten the time to make an illustrative example, but the api references are ready to go.

If you would like to use this functionality but have some difficulties, please email me (Wenrui Jiang) at [email protected]. I am happy to share my code, explain things, and potentially corroborate on your project.

Expand Down
16 changes: 8 additions & 8 deletions tests/test_eulerian_budget.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
import xarray as xr

from seaduck.eulerian_budget import (
_superbee_fluxlimiter,
bolus_vel_from_psi,
buffer_x_periodic,
buffer_x_withface,
buffer_y_periodic,
buffer_y_withface,
buffer_z_nearest_withoutface,
buffer_z_nearest,
second_order_flux_limiter_x,
second_order_flux_limiter_y,
second_order_flux_limiter_z_withoutface,
superbee_fluxlimiter,
second_order_flux_limiter_z,
third_order_DST_x,
third_order_DST_y,
third_order_upwind_z,
Expand Down Expand Up @@ -50,7 +50,7 @@ def test_bolus_calc(grid, od):

def test_superbee():
cr = np.array([-1, 0.25, 0.5, 1, 2, 100])
res = superbee_fluxlimiter(cr)
res = _superbee_fluxlimiter(cr)
assert np.allclose(res, np.array([0.0, 0.5, 1.0, 1.0, 2.0, 2.0]))


Expand All @@ -73,8 +73,8 @@ def test_buffer_y_periodic(random_4d, lm, rm):


@pytest.mark.parametrize(["lm", "rm"], [(0, 2), (2, 1), (1, 0)])
def test_buffer_z_nearest_withoutface(random_4d, lm, rm):
buffer = buffer_z_nearest_withoutface(random_4d, lm, rm)
def test_buffer_z_nearest(random_4d, lm, rm):
buffer = buffer_z_nearest(random_4d, lm, rm)
if rm != 0:
assert np.allclose(buffer[..., -1, :, :], random_4d[..., -1, :, :])
if lm != 0:
Expand All @@ -100,10 +100,10 @@ def test_second_order_flux_limiter_y(random_4d):
assert ans.dtype == "float64"


def test_second_order_flux_limiter_z_withoutface(random_4d):
def test_second_order_flux_limiter_z(random_4d):
np.random.seed(401)
w_cfl = np.random.random((3, 4, 5, 4)) * 2 - 1
ans = second_order_flux_limiter_z_withoutface(random_4d, w_cfl)
ans = second_order_flux_limiter_z(random_4d, w_cfl)
assert ans.shape == w_cfl.shape
assert ans.dtype == "float64"

Expand Down

0 comments on commit b2739e9

Please sign in to comment.