forked from JiaweiZhuang/xESMF
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Test against different dask schedulers (JiaweiZhuang#42)
- Loading branch information
1 parent
001d6e9
commit 9e76f18
Showing
4 changed files
with
63 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,3 +44,4 @@ PET0.ESMF_LogFile | |
.cache | ||
.coverage | ||
coverage.xml | ||
dask-worker-space/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import dask | ||
import pytest | ||
|
||
|
||
@pytest.fixture(scope="function") | ||
def threaded_scheduler(): | ||
with dask.config.set(scheduler="threads"): | ||
yield | ||
|
||
|
||
@pytest.fixture(scope="function") | ||
def processes_scheduler(): | ||
with dask.config.set(scheduler="processes"): | ||
yield | ||
|
||
|
||
@pytest.fixture(scope="module") | ||
def distributed_scheduler(): | ||
from dask.distributed import Client, LocalCluster | ||
|
||
cluster = LocalCluster(threads_per_worker=1, n_workers=2, processes=True) | ||
client = Client(cluster) | ||
yield | ||
client.close() | ||
del client | ||
cluster.close() | ||
del cluster |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters