Skip to content

Commit

Permalink
add initial tests for stats (LLNL#43)
Browse files Browse the repository at this point in the history
* Adding unit tests for std.py and percentiles.py

* Adding unit tests for mean, median, minimum and maximum

* Adding unit tests for boxplot, correlation, check normality, and variance

* Add tests for columnar-joined thicket, add a stats fixture to conftest.py

* black formatting
---------

Co-authored-by: Treece Alexander Burgess <[email protected]>
Co-authored-by: Michael Richard McKinsey <[email protected]>
  • Loading branch information
3 people authored Sep 6, 2023
1 parent bfda27c commit 6bbf77d
Show file tree
Hide file tree
Showing 2 changed files with 588 additions and 0 deletions.
29 changes: 29 additions & 0 deletions thicket/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,35 @@ def columnar_join_thicket(mpi_scaling_cali, rajaperf_basecuda_xl_cali):
return thicket_list, thicket_list_cp, combined_th


@pytest.fixture
def stats_columnar_join_thicket(rajaperf_basecuda_xl_cali):
"""Generator for 'columnar_join' thicket for test_stats.py.
Arguments:
mpi_scaling_cali (list): List of Caliper files for MPI scaling study.
rajaperf_basecuda_xl_cali (list): List of Caliper files for base cuda variant.
Returns:
list: List of original thickets, list of deepcopies of original thickets, and
columnar-joined thicket.
"""
th_cuda128_1 = Thicket.from_caliperreader(rajaperf_basecuda_xl_cali[0:4])
th_cuda128_2 = Thicket.from_caliperreader(rajaperf_basecuda_xl_cali[5:9])

# To check later if modifications were unexpectedly made
th_cuda128_1_deep = th_cuda128_1.deepcopy()
th_cuda128_2_deep = th_cuda128_2.deepcopy()
thicket_list = [th_cuda128_1, th_cuda128_2]
thicket_list_cp = [th_cuda128_1_deep, th_cuda128_2_deep]

combined_th = Thicket.columnar_join(
thicket_list=thicket_list,
header_list=["Cuda 1", "Cuda 2"],
)

return thicket_list, thicket_list_cp, combined_th


@pytest.fixture
def data_dir():
"""Return path to the top-level data directory for tests."""
Expand Down
Loading

0 comments on commit 6bbf77d

Please sign in to comment.