Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
If not provided an address, create a LocalCluster and Client connection.
If not provided an address, other Dask kwargs are accepted and passed down to
the LocalCluster object.
"""
# Warn of future changes to API
warnings.warn(
"In aicsimageio>=4.*, the AICSImage context manager will no longer "
"construct and manage a distributed local dask cluster for you. If this "
"functionality is desired for your work, please switch to explictly "
"calling the `aicsimageio.dask_utils.cluster_and_client` context manager.",
FutureWarning,
)
from . import dask_utils
self._cluster, self._client = dask_utils.spawn_cluster_and_client(
**self._dask_kwargs
)
return self
If not provided an address, create a LocalCluster and Client connection.
If not provided an address, other Dask kwargs are accepted and passed down to
the LocalCluster object.
"""
# Warn of future changes to API
warnings.warn(
"In aicsimageio>=4.*, the AICSImage context manager will no longer "
f"construct and manage a distributed local dask cluster for you. If this "
f"functionality is desired for your work, please switch to explictly "
f"calling the `aicsimageio.dask_utils.cluster_and_client` context manager.",
FutureWarning,
)
from . import dask_utils
self._cluster, self._client = dask_utils.spawn_cluster_and_client(
**self._dask_kwargs
)
return self
def __enter__(self):
"""
If provided an address, create a Dask Client connection.
If not provided an address, create a LocalCluster and Client connection.
If not provided an address, other Dask kwargs are accepted and passed down to
the LocalCluster object.
"""
from .. import dask_utils
self._cluster, self._client = dask_utils.spawn_cluster_and_client(
**self._dask_kwargs
)
return self