Skip to content

Commit 4886011

Browse files
committed
Update variable naming in tests
1 parent 553f1fc commit 4886011

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

parcels/xgrid.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def __init__(self, grid: xgcm.Grid, mesh="flat"):
4040
self.xgcm_grid = grid
4141
self.mesh = mesh
4242

43-
# ! Not ideal... Triggers computation on a throwaway item. If adapter is still needed in codebase, and this is prohibitively expensive, perhaps store GridAdapter on Field object instead of Grid
43+
# ! Not ideal... Triggers computation on a throwaway item. Keeping for now for v3 compat, will be removed in v4.
4444
self.lonlat_minmax = np.array(
4545
[
4646
np.nanmin(self.xgcm_grid._ds["lon"]),

tests/v4/test_xgrid.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ def assert_equal(actual, expected):
3939

4040
@pytest.mark.parametrize("ds, attr, expected", test_cases)
4141
def test_xgrid_properties_ground_truth(ds, attr, expected):
42-
adapter = XGrid(xgcm.Grid(ds, periodic=False))
43-
actual = getattr(adapter, attr)
42+
grid = XGrid(xgcm.Grid(ds, periodic=False))
43+
actual = getattr(grid, attr)
4444
assert_equal(actual, expected)
4545

4646

@@ -61,16 +61,16 @@ def test_xgrid_properties_ground_truth(ds, attr, expected):
6161
)
6262
@pytest.mark.parametrize("ds", datasets.values())
6363
def test_xgrid_against_old(ds, attr):
64-
adapter = XGrid(xgcm.Grid(ds, periodic=False))
64+
grid = XGrid(xgcm.Grid(ds, periodic=False))
6565

66-
grid = OldGrid.create_grid(
66+
old_grid = OldGrid.create_grid(
6767
lon=ds.lon.values,
6868
lat=ds.lat.values,
6969
depth=ds.depth.values,
7070
time=ds.time.values.astype("float64") / 1e9,
7171
time_origin=TimeConverter(ds.time.values[0]),
7272
mesh="spherical",
7373
)
74-
actual = getattr(adapter, attr)
75-
expected = getattr(grid, attr)
74+
actual = getattr(grid, attr)
75+
expected = getattr(old_grid, attr)
7676
assert_equal(actual, expected)

0 commit comments

Comments
 (0)