diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 39a38ed0c038013551719f6194937cc8e7c6b632..1467e0c1cdc71a45465b96db3e1b44e50892216e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -18,7 +18,7 @@ Python 3 Titan V: script: - export PY_EXE=python3 - export PYOPENCL_TEST=nvi:titan - - EXTRA_INSTALL="pybind11 numpy mako" + - EXTRA_INSTALL="pybind11 numpy mako matplotlib" - curl -L -O -k https://gitlab.tiker.net/inducer/ci-support/raw/master/build-and-test-py-project.sh - ". ./build-and-test-py-project.sh" tags: @@ -68,7 +68,7 @@ Python 3 POCL: script: - export PY_EXE=python3 - export PYOPENCL_TEST=portable - - export EXTRA_INSTALL="pybind11 numpy mako" + - export EXTRA_INSTALL="pybind11 numpy mako matplotlib" - curl -L -O -k https://gitlab.tiker.net/inducer/ci-support/raw/master/build-and-test-py-project.sh - ". ./build-and-test-py-project.sh" tags: diff --git a/boxtree/traversal.py b/boxtree/traversal.py index 2d60f68725ea5f1b2b95a77f7b547f5954cd6951..e99b7d83b50f7d4fd7c34bf0cefb555974f5b3a4 100644 --- a/boxtree/traversal.py +++ b/boxtree/traversal.py @@ -1566,7 +1566,8 @@ class FMMTraversalInfo(DeviceDataRecord): type ``box_id_t``. (Note: This list contains global box numbers, not indices into :attr:`source_boxes`.) - Note *starts* are indexed by `target_boxes_sep_smaller_by_source_level`. For + Note *starts* are indexed along with + `target_boxes_sep_smaller_by_source_level`. For example, for level *i*, *lists[starts[j]:starts[j+1]]* represents "List 3" source boxes of *target_boxes_sep_smaller_by_source_level[i][j]* on level *i*. diff --git a/boxtree/visualization.py b/boxtree/visualization.py index e5fb19de8fbfe51e6003a6f346bcfca076f890db..e9671e07deb961eb9cd3cd9bf53447d5dcf69a67 100644 --- a/boxtree/visualization.py +++ b/boxtree/visualization.py @@ -245,7 +245,7 @@ def draw_box_lists(tree_plotter, traversal, ibox): _draw_box_list(tree_plotter, ibox, traversal.from_sep_smaller_by_level[ilev].starts, traversal.from_sep_smaller_by_level[ilev].lists, - key_to_box=traversal.target_boxes, + key_to_box=traversal.target_boxes_sep_smaller_by_source_level[ilev], facecolor="orange") # list 3 close diff --git a/test/test_traversal.py b/test/test_traversal.py index 32645a2a708d0f4403a714fdccf69bd654cc7dbe..25ef18f299d4c62f29760dae1fbe04a57709485b 100644 --- a/test/test_traversal.py +++ b/test/test_traversal.py @@ -290,9 +290,13 @@ def test_tree_connectivity(ctx_factory, dims, sources_are_targets): # }}} -# {{{ visualization helper (not a test) +# {{{ visualization helper -def plot_traversal(ctx_factory, do_plot=False, well_sep_is_n_away=1): +# Set 'plot' kwarg to True to actually plot. Otherwise, this +# test simply ensures that interaction list plotting is still +# working. +def test_plot_traversal(ctx_factory, well_sep_is_n_away=1, plot=False): + pytest.importorskip("matplotlib") ctx = ctx_factory() queue = cl.CommandQueue(ctx) @@ -337,11 +341,19 @@ def plot_traversal(ctx_factory, do_plot=False, well_sep_is_n_away=1): from boxtree.visualization import draw_box_lists #draw_box_lists(randrange(tree.nboxes)) - draw_box_lists(plotter, trav, 320) + + if well_sep_is_n_away == 1: + draw_box_lists(plotter, trav, 380) + elif well_sep_is_n_away == 2: + draw_box_lists(plotter, trav, 320) #plotter.draw_box_numbers() - import matplotlib.pyplot as pt - pt.show() + if plot: + import matplotlib.pyplot as pt + pt.gca().set_xticks([]) + pt.gca().set_yticks([]) + + pt.show() # }}}