Skip to content

Commit

Permalink
Rename display_table parameter to display_survival_statistics in kapl…
Browse files Browse the repository at this point in the history
…an_meier function and update related tests
  • Loading branch information
aGuyLearning committed Jan 21, 2025
1 parent a3652aa commit b7e1f3e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions ehrapy/plot/_survival_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ def kmf(
def kaplan_meier(
kmfs: Sequence[KaplanMeierFitter],
*,
display_table: bool = False,
display_survival_statistics: bool = False,
ci_alpha: list[float] | None = None,
ci_force_lines: list[Boolean] | None = None,
ci_show: list[Boolean] | None = None,
Expand All @@ -208,7 +208,7 @@ def kaplan_meier(
Args:
kmfs: Iterables of fitted KaplanMeierFitter objects.
display_table: Display the survival probabilities in a table, below the plot.
display_survival_statistics: Display survival statistics in a table below the plot.
ci_alpha: The transparency level of the confidence interval. If more than one kmfs, this should be a list.
ci_force_lines: Force the confidence intervals to be line plots (versus default shaded areas).
If more than one kmfs, this should be a list.
Expand Down Expand Up @@ -302,7 +302,7 @@ def kaplan_meier(
ax.set_title(title)

# Prepare data for the table
if display_table:
if display_survival_statistics:
xticks = [x for x in ax.get_xticks() if x >= 0]
xticks_space = xticks[1] - xticks[0]
if xlabel is None:
Expand Down
2 changes: 1 addition & 1 deletion tests/_scripts/kaplain_meier_create_expected_plots.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
" ylim=[0, 1],\n",
" xlabel=\"Days\",\n",
" ylabel=\"Proportion Survived\",\n",
" display_table=True,\n",
" display_survival_statistics=True,\n",
" grid=True,\n",
")"
]
Expand Down
2 changes: 1 addition & 1 deletion tests/plot/test_survival_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def test_kaplan_meier(mimic_2, check_same_image):
xlabel="Days",
ylabel="Proportion Survived",
grid=True,
display_table=True,
display_survival_statistics=True,
)

check_same_image(
Expand Down

0 comments on commit b7e1f3e

Please sign in to comment.