Skip to content

Commit

Permalink
Unify min and max value retrievement and give schema to polars datafr…
Browse files Browse the repository at this point in the history
…ame accounting for eventual empty values
  • Loading branch information
fxwiegand committed Sep 11, 2024
1 parent c0c88c3 commit 478b12d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion workflow/scripts/compare_enrichment.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,8 @@ def plot(df, effect_x, effect_y, title, xlabel, ylabel):
line = (
alt.Chart(
pl.DataFrame(
{effect_x: [min_value, max_value], effect_y: [min_value, max_value]}
{effect_x: [min_value, max_value], effect_y: [min_value, max_value]},
schema={effect_x: pl.Float64, effect_y: pl.Float64},
)
)
.mark_line(color="lightgrey")
Expand Down
4 changes: 2 additions & 2 deletions workflow/scripts/compare_pathways.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ def prepare(df):
)
)

min_value = combined.select(pl.min(effect_x, effect_y)).min_horizontal()[0]
max_value = combined.select(pl.max(effect_x, effect_y)).max_horizontal()[0]
min_value = min(df[effect_x].min(), df[effect_y].min())
max_value = max(df[effect_x].max(), df[effect_y].max())

line = (
alt.Chart(
Expand Down

0 comments on commit 478b12d

Please sign in to comment.