Skip to content

Commit 6b0aa5a

Browse files
sullivanj91claude
andcommitted
style: apply ruff formatting
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 64655e7 commit 6b0aa5a

3 files changed

Lines changed: 11 additions & 3 deletions

File tree

src/pdex/__init__.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -530,7 +530,11 @@ def _pdex_on_target(
530530
fc = float(
531531
fold_change(np.array([target_mean]), np.array([ref_mean]), prior_count)[0]
532532
)
533-
pc = float(percent_change(np.array([target_mean]), np.array([ref_mean]), prior_count)[0])
533+
pc = float(
534+
percent_change(np.array([target_mean]), np.array([ref_mean]), prior_count)[
535+
0
536+
]
537+
)
534538

535539
mwu_result = mwu(group_col, ref_col)
536540
p_value = float(np.clip(np.asarray(mwu_result.pvalue).ravel()[0], 0, 1))

src/pdex/_math.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,9 @@ def fold_change(x: np.ndarray, y: np.ndarray, prior_count: float = 0.0) -> np.nd
117117

118118

119119
@nb.njit(parallel=True)
120-
def percent_change(x: np.ndarray, y: np.ndarray, prior_count: float = 0.0) -> np.ndarray:
120+
def percent_change(
121+
x: np.ndarray, y: np.ndarray, prior_count: float = 0.0
122+
) -> np.ndarray:
121123
"""Calculates the percent change between two arrays.
122124
123125
When ``prior_count > 0``, adds a pseudocount to the denominator before

tests/test_math.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,9 @@ def test_dampens_extreme_pc_from_near_zero_denominator(self):
100100
pc_raw = percent_change(x, y)[0]
101101
pc_dampened = percent_change(x, y, 0.5)[0]
102102
assert abs(pc_dampened) < abs(pc_raw)
103-
np.testing.assert_allclose(pc_dampened, (0.1 - 0.001) / (0.001 + 0.5), rtol=1e-5)
103+
np.testing.assert_allclose(
104+
pc_dampened, (0.1 - 0.001) / (0.001 + 0.5), rtol=1e-5
105+
)
104106

105107
def test_preserves_direction(self):
106108
"""prior_count should not flip the sign of percent change."""

0 commit comments

Comments
 (0)