-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Print Tree on Performance Data (#118)
* Change functionality to print tree on Thicket.dataframe instead of Thicket.statsframe.dataframe * Add support for list and single data-types * Make tree printout more detailed * Add render_legend code from hatchet to modify the legend and add in Indicies * Add error msg for specific idx * Replace none values with node name * Add unit tests for tree * Add level to error msg
- Loading branch information
1 parent
012c89c
commit 7019ed1
Showing
4 changed files
with
184 additions
and
1 deletion.
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
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,44 @@ | ||
# Copyright 2022 Lawrence Livermore National Security, LLC and other | ||
# Thicket Project Developers. See the top-level LICENSE file for details. | ||
# | ||
# SPDX-License-Identifier: MIT | ||
|
||
import pytest | ||
|
||
import thicket as th | ||
|
||
|
||
def test_indices(rajaperf_unique_tunings): | ||
tk = th.Thicket.from_caliperreader(rajaperf_unique_tunings) | ||
|
||
# No error | ||
tk.tree(metric_column="Avg time/rank", indices=tk.profile[0]) | ||
|
||
tk.metadata_column_to_perfdata("variant") | ||
tk.metadata_column_to_perfdata("tuning") | ||
|
||
# Error because there are duplicate variants. We need to add the tuning to the index as well. | ||
tk.dataframe = ( | ||
tk.dataframe.reset_index().set_index(["node", "variant"]).sort_index() | ||
) | ||
with pytest.raises( | ||
KeyError, | ||
match=r"Either dataframe cannot be represented as a single index or provided slice,*", | ||
): | ||
tk.tree(metric_column="Avg time/rank") | ||
|
||
# Add tuning to the index to avoid the error. | ||
tk.dataframe = ( | ||
tk.dataframe.reset_index().set_index(["node", "variant", "tuning"]).sort_index() | ||
) | ||
# No error | ||
tk.tree(metric_column="Avg time/rank") | ||
|
||
# No error | ||
tk.tree(metric_column="Avg time/rank", indices=["Base_Seq", "default"]) | ||
|
||
with pytest.raises( | ||
KeyError, | ||
match=r"The indices, \{\'tuning\': \'hi\'\}, do not exist in the index \'self.dataframe.index\'", | ||
): | ||
tk.tree(metric_column="Avg time/rank", indices=["Base_Seq", "hi"]) |
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