-
-
Notifications
You must be signed in to change notification settings - Fork 370
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Parallelize the test suite and fix a test polluted bug (#1338)
- Loading branch information
Showing
11 changed files
with
72 additions
and
15 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,14 @@ | ||
from __future__ import annotations | ||
from contextlib import suppress | ||
from datashader.data_libraries.pandas import default | ||
from datashader.core import bypixel | ||
import cudf | ||
|
||
|
||
@bypixel.pipeline.register(cudf.DataFrame) | ||
def cudf_pipeline(df, schema, canvas, glyph, summary, *, antialias=False): | ||
return default(glyph, df, schema, canvas, summary, antialias=antialias, cuda=True) | ||
|
||
|
||
with suppress(ImportError): | ||
import cudf | ||
|
||
cudf_pipeline = bypixel.pipeline.register(cudf.DataFrame)(cudf_pipeline) |
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 |
---|---|---|
@@ -1,9 +1,14 @@ | ||
from __future__ import annotations | ||
from contextlib import suppress | ||
from datashader.data_libraries.dask import dask_pipeline | ||
from datashader.core import bypixel | ||
import dask_cudf | ||
|
||
|
||
@bypixel.pipeline.register(dask_cudf.DataFrame) | ||
def dask_cudf_pipeline(df, schema, canvas, glyph, summary, *, antialias=False): | ||
return dask_pipeline(df, schema, canvas, glyph, summary, antialias=antialias, cuda=True) | ||
|
||
|
||
with suppress(ImportError): | ||
import dask_cudf | ||
|
||
dask_cudf_pipeline = bypixel.pipeline.register(dask_cudf.DataFrame)(dask_cudf_pipeline) |
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
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,3 @@ | ||
import pytest | ||
|
||
pytestmark = pytest.mark.benchmark |
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,34 @@ | ||
CUSTOM_MARKS = ("benchmark",) | ||
|
||
|
||
def pytest_addoption(parser): | ||
for marker in CUSTOM_MARKS: | ||
parser.addoption( | ||
f"--{marker}", | ||
action="store_true", | ||
default=False, | ||
help=f"Run {marker} related tests", | ||
) | ||
|
||
|
||
def pytest_configure(config): | ||
for marker in CUSTOM_MARKS: | ||
config.addinivalue_line("markers", f"{marker}: {marker} test marker") | ||
|
||
|
||
def pytest_collection_modifyitems(config, items): | ||
skipped, selected = [], [] | ||
markers = [m for m in CUSTOM_MARKS if config.getoption(f"--{m}")] | ||
empty = not markers | ||
for item in items: | ||
if empty and any(m in item.keywords for m in CUSTOM_MARKS): | ||
skipped.append(item) | ||
elif empty: | ||
selected.append(item) | ||
elif not empty and any(m in item.keywords for m in markers): | ||
selected.append(item) | ||
else: | ||
skipped.append(item) | ||
|
||
config.hook.pytest_deselected(items=skipped) | ||
items[:] = selected |
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
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
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