Skip to content

Commit

Permalink
black flake
Browse files Browse the repository at this point in the history
  • Loading branch information
Yejashi committed Oct 16, 2024
1 parent 88e6368 commit 701759e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
6 changes: 2 additions & 4 deletions thicket/stats/confidence_interval.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def confidence_interval(thicket, columns=None, confidence_level=0.95):
columns (list): List of hardware/timing metrics to perform confidence interval
calculation on. Note, if using a columnar_joined thicket a list of tuples
must be passed in with the format (column index, column name).
confidence_level (int,float): The confidence level (often 0.90, 0.95, or 0.99)
confidence_level (float): The confidence level (often 0.90, 0.95, or 0.99)
indicates the degree of confidence that the true parameter lies within the interval.
Returns:
Expand All @@ -44,9 +44,7 @@ def confidence_interval(thicket, columns=None, confidence_level=0.95):
raise ValueError("Value passed to 'columns' must be of type list.")

if not isinstance(confidence_level, float):
raise ValueError(
r"Value passed to 'confidence_level' must be of type float or int."
)
raise ValueError(r"Value passed to 'confidence_level' must be of type float.")

if confidence_level >= 1 or confidence_level <= 0:
raise ValueError(
Expand Down
4 changes: 2 additions & 2 deletions thicket/tests/test_stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -1233,7 +1233,7 @@ def test_confidence_interval(thicket_axis_columns):

with pytest.raises(
ValueError,
match="Value passed to 'confidence_level' must be of type float or int.",
match="Value passed to 'confidence_level' must be of type float.",
):
th.stats.confidence_interval(
combined_th, columns=columns, confidence_level="0.95"
Expand All @@ -1243,7 +1243,7 @@ def test_confidence_interval(thicket_axis_columns):
ValueError,
match=r"Value passed to 'confidence_level' must be in the range of \(0, 1\).",
):
th.stats.confidence_interval(combined_th, columns=columns, confidence_level=95)
th.stats.confidence_interval(combined_th, columns=columns, confidence_level=1.2)

# Hardcoded cases
columns = [("block_128", "Avg time/rank"), ("default", "Avg time/rank")]
Expand Down

0 comments on commit 701759e

Please sign in to comment.