Skip to content

Commit

Permalink
🐛🎨 remove doubled imports and format files
Browse files Browse the repository at this point in the history
  • Loading branch information
enryH committed Oct 16, 2024
1 parent 2b6bfa3 commit bf26ae1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
3 changes: 0 additions & 3 deletions src/njab/plotting/__init__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
"""Matplotlib functionality for custom plots."""

import numpy as np
import pandas as pd
import matplotlib
import logging
import pathlib
from typing import Iterable
Expand Down
16 changes: 9 additions & 7 deletions src/njab/plotting/km.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
msg = (
"lifelines not available. Please install all njab dependencies typing:"
"\n\tpip install 'njab[all]'"
"\nor separately typing:\n\tpip install lifelines"
)
"\nor separately typing:\n\tpip install lifelines")
e.args = (msg, *e.args[1:])
raise ModuleNotFoundError(*e.args) from e
import pandas as pd
Expand Down Expand Up @@ -66,13 +65,16 @@ def compare_km_curves(
mask = pred
kmf_1 = KaplanMeierFitter()
kmf_1.fit(time.loc[mask], event_observed=y.loc[mask])
ax = kmf_1.plot(xlim=xlim,
ylim=ylim,
xlabel=xlabel,
ylabel=ylabel,
legend=False)
ax = kmf_1.plot(
xlim=xlim,
ylim=ylim,
xlabel=xlabel,
ylabel=ylabel,
legend=False,
)
if add_risk_counts:
from lifelines.plotting import add_at_risk_counts

add_at_risk_counts(kmf_0, kmf_1, ax=ax)
return ax, kmf_0, kmf_1

Expand Down

0 comments on commit bf26ae1

Please sign in to comment.