-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Silence some warnings. #2328
Silence some warnings. #2328
Changes from 14 commits
482ecf6
6b46b15
75cce6c
7518bd7
7186644
1f1ec52
9ac15ef
76f988f
f605d6e
9729f29
cee7e2a
fbdb206
b985127
d9e8024
2c0ed18
a74f4e0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,8 +24,11 @@ | |
|
||
class DaskTestCase(TestCase): | ||
def assertLazyAnd(self, expected, actual, test): | ||
with dask.set_options(get=dask.get): | ||
|
||
with (dask.config.set(get=dask.get) if hasattr(dask, 'config') | ||
else dask.set_options(get=dask.get)): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is this just a version check? Generally, I prefer to see a version comparison so we can more obviously clean these things up when older versions are no longer supported. (Same comment below) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ya it's basically a version check. I've made it an explicit version check now. |
||
test(actual, expected) | ||
|
||
if isinstance(actual, Dataset): | ||
for k, v in actual.variables.items(): | ||
if k in actual.dims: | ||
|
@@ -196,11 +199,13 @@ def test_missing_methods(self): | |
except NotImplementedError as err: | ||
assert 'dask' in str(err) | ||
|
||
@pytest.mark.filterwarnings('ignore::PendingDeprecationWarning') | ||
def test_univariate_ufunc(self): | ||
u = self.eager_var | ||
v = self.lazy_var | ||
self.assertLazyAndAllClose(np.sin(u), xu.sin(v)) | ||
|
||
@pytest.mark.filterwarnings('ignore::PendingDeprecationWarning') | ||
def test_bivariate_ufunc(self): | ||
u = self.eager_var | ||
v = self.lazy_var | ||
|
@@ -421,6 +426,7 @@ def duplicate_and_merge(array): | |
actual = duplicate_and_merge(self.lazy_array) | ||
self.assertLazyAndEqual(expected, actual) | ||
|
||
@pytest.mark.filterwarnings('ignore::PendingDeprecationWarning') | ||
def test_ufuncs(self): | ||
u = self.eager_array | ||
v = self.lazy_array | ||
|
@@ -821,7 +827,8 @@ def test_basic_compute(): | |
dask.multiprocessing.get, | ||
dask.local.get_sync, | ||
None]: | ||
with dask.set_options(get=get): | ||
with (dask.config.set(get=get) if hasattr(dask, 'config') | ||
else dask.set_options(get=get)): | ||
ds.compute() | ||
ds.foo.compute() | ||
ds.foo.variable.compute() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is really nice! way better than using filterwarnings manually :)