Skip to content

Commit

Permalink
FIX: Ensure filemode makes it to grid chunker (#506)
Browse files Browse the repository at this point in the history
  • Loading branch information
bekozi committed Aug 3, 2020
1 parent 3ddedde commit 3f0f994
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/ocgis/ocli.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,8 @@ def chunked_rwg(source, destination, weight, nchunks_dst, merge, esmf_src_type,
# Create the chunked regridding object. This is used for both chunked regridding and a regrid with a spatial subset.
gs = GridChunker(rd_src, rd_dst, nchunks_dst=nchunks_dst, src_grid_resolution=src_resolution, paths=paths,
dst_grid_resolution=dst_resolution, buffer_value=buffer_distance, redistribute=True,
genweights=genweights, esmf_kwargs=esmf_kwargs, use_spatial_decomp='auto', eager=eager)
genweights=genweights, esmf_kwargs=esmf_kwargs, use_spatial_decomp='auto', eager=eager,
filemode=weightfilemode)

# Write subsets and generate weights if requested in the grid splitter.
# TODO: Need a weight only option. If chunks are written, then weights are written...
Expand Down
2 changes: 2 additions & 0 deletions src/ocgis/test/test_ocgis/test_ocli.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,8 @@ def test_system_mock_combinations(self, mRequestDataset, mGridChunker, m_mkdtemp
elif k['nchunks_dst'] == '1':
self.assertEqual(call_args[1]['nchunks_dst'], (1,))

self.assertIn(call_args[1]["filemode"].lower(), ["withaux", "basic"])

actual = call_args[1]['eager']
if k['not_eager'] == '__include__':
self.assertFalse(actual)
Expand Down

0 comments on commit 3f0f994

Please sign in to comment.