Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Aug 18, 2023
1 parent 549a58e commit 214269a
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions xesmf/tests/test_frontend.py
Original file line number Diff line number Diff line change
Expand Up @@ -628,19 +628,23 @@ def test_dask_output_chunks():
def test_para_weight_gen():
# Generating weights in serial
regridder = xe.Regridder(ds_in, ds_out, 'conservative')
para_regridder = xe.Regridder(ds_in, ds_out_chunked, 'conservative',parallel=True)
para_regridder = xe.Regridder(ds_in, ds_out_chunked, 'conservative', parallel=True)

# weights should be identical between serial and parallel
assert all(regridder.w.data.data == para_regridder.w.data.data)

# Ensure para weight gen works with locstream_in as well
reggrider_locs = xe.Regridder(ds_locs, ds_out_chunked, 'nearest_s2d', locstream_in=True)
para_regridder_locs = xe.Regridder(ds_locs, ds_out_chunked, 'nearest_s2d',parallel=True, locstream_in=True)
para_regridder_locs = xe.Regridder(
ds_locs, ds_out_chunked, 'nearest_s2d', parallel=True, locstream_in=True
)
assert all(reggrider_locs.w.data.data == para_regridder_locs.w.data.data)

# Same as above with locstream_out
regridder_locs = xe.Regridder(ds_in, ds_locs, 'nearest_s2d', locstream_out=True)
para_regridder_locs = xe.Regridder(ds_in, ds_locs_chunked, 'nearest_s2d', parallel=True, locstream_out=True)
para_regridder_locs = xe.Regridder(
ds_in, ds_locs_chunked, 'nearest_s2d', parallel=True, locstream_out=True
)
assert all(regridder_locs.w.data.data == para_regridder_locs.w.data.data)


Expand Down

0 comments on commit 214269a

Please sign in to comment.