Skip to content

Commit 2af666f

Browse files
committed
Closes #159. Adjusts example for better reflection.
1 parent 56bf65c commit 2af666f

2 files changed

Lines changed: 19 additions & 20 deletions

File tree

example/dose_response.csv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
pApB,obsA,obsB,obsC
1+
dose,obsA,obsB,obsC
22
3, 1, 2, 3
33
5, 4, 5, 6
44
7, 7, 8, 9

src/petab_gui/controllers/table_controllers.py

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -776,27 +776,26 @@ def _rank_dose_candidates(self, df) -> list[str]:
776776
re.IGNORECASE,
777777
)
778778
scores = {}
779-
# FIXME: https://github.com/PaulJonasJost/PEtab_GUI/issues/159
780779
for col in df.columns: # noqa: B007
781780
s = 0.0
782-
if patt.search(col or ""):
783-
s += 2.0
784-
try:
785-
if df[col].dtype.kind in "if":
786-
s += 1.0
787-
uniq = df[col].nunique(dropna=True)
788-
if 2 <= uniq <= 30:
789-
s += 0.8
790-
if np.all(pd.to_numeric(df[col], errors="coerce").fillna(0) >= 0):
791-
s += 0.3
792-
ser = pd.to_numeric(df[col], errors="coerce").dropna()
793-
if len(ser) >= 5:
794-
diffs = np.diff(ser.values)
795-
if np.mean(diffs >= 0) >= 0.7:
796-
s += 0.2
797-
except Exception:
798-
pass
799-
scores[col] = s
781+
if patt.search(col or ""):
782+
s += 2.0
783+
try:
784+
if df[col].dtype.kind in "if":
785+
s += 1.0
786+
uniq = df[col].nunique(dropna=True)
787+
if 2 <= uniq <= 30:
788+
s += 0.8
789+
if np.all(pd.to_numeric(df[col], errors="coerce").fillna(0) >= 0):
790+
s += 0.3
791+
ser = pd.to_numeric(df[col], errors="coerce").dropna()
792+
if len(ser) >= 5:
793+
diffs = np.diff(ser.values)
794+
if np.mean(diffs >= 0) >= 0.7:
795+
s += 0.2
796+
except Exception:
797+
pass
798+
scores[col] = s
800799
return [
801800
c
802801
for c, _ in sorted(

0 commit comments

Comments
 (0)