-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
updated variable names and moved test to better file
- Loading branch information
1 parent
66815c4
commit 76f0f0c
Showing
3 changed files
with
40 additions
and
34 deletions.
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,17 @@ | ||
from pathlib import Path | ||
|
||
import ehrapy as ep | ||
|
||
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") | ||
fig, ax = ep.pl.cox_ph_forestplot(coxph, fig_size=(12, 3), t_adjuster=0.15, marker="o", size=2, text_size=14) | ||
|
||
check_same_image( | ||
fig=fig, | ||
base_path=f"{_TEST_IMAGE_PATH}/coxph_forestplot", | ||
tol=2e-1, | ||
) |