Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Dec 13, 2024
1 parent 76f0f0c commit 2108681
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
12 changes: 10 additions & 2 deletions ehrapy/plot/_survival_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,13 @@ def cox_ph_forestplot(
tval.append(
[
coxph_summary[auc_col][i],
("(" + str(coxph_summary["coef lower 95%"][i]) + ", " + str(coxph_summary["coef upper 95%"][i]) + ")"),
(
"("
+ str(coxph_summary["coef lower 95%"][i])
+ ", "
+ str(coxph_summary["coef upper 95%"][i])
+ ")"
),
]
)
ytick.append(i)
Expand Down Expand Up @@ -401,7 +407,9 @@ def cox_ph_forestplot(
linewidth=0,
elinewidth=1,
)
plot.scatter(coxph_summary[auc_col], coxph_summary.index, c=color, s=(size * 25), marker=marker, zorder=3, edgecolors="None")
plot.scatter(
coxph_summary[auc_col], coxph_summary.index, c=color, s=(size * 25), marker=marker, zorder=3, edgecolors="None"
)
plot.xaxis.set_ticks_position("bottom")
plot.yaxis.set_ticks_position("left")
plot.get_xaxis().set_major_formatter(ticker.ScalarFormatter())
Expand Down
1 change: 0 additions & 1 deletion tests/plot/test_catplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,3 @@ def test_catplot_vanilla(adata_mini, check_same_image):
base_path=f"{_TEST_IMAGE_PATH}/catplot_vanilla",
tol=2e-1,
)

3 changes: 2 additions & 1 deletion tests/plot/test_survival_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
CURRENT_DIR = Path(__file__).parent
_TEST_IMAGE_PATH = f"{CURRENT_DIR}/_images"


def test_coxph_forestplot(mimic_2, check_same_image):
adata_subset = mimic_2[:, ["mort_day_censored", "censor_flg", "gender_num", "afib_flg", "day_icu_intime_num"]]
coxph = ep.tl.cox_ph(adata_subset, duration_col="mort_day_censored", event_col="censor_flg")
Expand All @@ -14,4 +15,4 @@ def test_coxph_forestplot(mimic_2, check_same_image):
fig=fig,
base_path=f"{_TEST_IMAGE_PATH}/coxph_forestplot",
tol=2e-1,
)
)

0 comments on commit 2108681

Please sign in to comment.