From b2739e96bf81f53bbc368e5ef05533263c7f404c Mon Sep 17 00:00:00 2001 From: Wenrui Jiang Date: Mon, 18 Nov 2024 16:54:50 -0500 Subject: [PATCH] fix things that brokw test --- budget/README.md | 2 +- tests/test_eulerian_budget.py | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/budget/README.md b/budget/README.md index 7ea718f..e0dc4fc 100644 --- a/budget/README.md +++ b/budget/README.md @@ -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 wjiang33@jhu.edu. I am happy to share my code, explain things, and potentially corroborate on your project. diff --git a/tests/test_eulerian_budget.py b/tests/test_eulerian_budget.py index 35ab4ae..da627b1 100644 --- a/tests/test_eulerian_budget.py +++ b/tests/test_eulerian_budget.py @@ -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, @@ -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])) @@ -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: @@ -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"