Skip to content

Commit

Permalink
Don't start a dask client as a kwarg
Browse files Browse the repository at this point in the history
  • Loading branch information
e-koch committed Jan 5, 2024
1 parent 9acfecd commit 0394f06
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion spectral_cube/cube_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -926,7 +926,7 @@ def mosaic_cubes(cubes, spectral_block_size=100, combine_header_kwargs={},
fail_if_cube_dropped=False,
fail_if_channel_empty=True,
return_footprint=False,
client=Client(),
client=None,
**kwargs):
'''
This function reprojects cubes onto a common grid and combines them to a single field.
Expand Down Expand Up @@ -1268,6 +1268,10 @@ def two_closest_channels(cube, channel):
# theory; the previous would treat each cube in serial)
datas = [cube._get_filled_data() for cube in scubes]
wcses = [cube.wcs for cube in scubes]

if client is None:
client = Client()

with client:
datas = client.gather(datas)
hdus = list(zip(datas, wcses))
Expand Down

0 comments on commit 0394f06

Please sign in to comment.