Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Over time #321

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Over time #321

wants to merge 2 commits into from

Conversation

yusufuyanik1
Copy link
Collaborator

  • Now we properly handle showing the difference of a metric over periods.
    @StijnKas can you check line 302 in Plots.py, are you happy with the y-axis labels?
  • Improved the unit test

Copy link

codecov bot commented Jan 23, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 61.35%. Comparing base (b817f63) to head (daefc60).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #321      +/-   ##
==========================================
+ Coverage   61.18%   61.35%   +0.17%     
==========================================
  Files          56       56              
  Lines        4949     4953       +4     
==========================================
+ Hits         3028     3039      +11     
+ Misses       1921     1914       -7     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@StijnKas StijnKas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great stuff, thanks @yusufuyanik1! My only doubt is the name for the argument - imo either cumulative or delta makes sense (as they are opposites in this case), period change seems ambiguous. Other than that - good to go

@@ -280,8 +280,8 @@ def over_time(
The column to group by, by default "ModelID"
every : Union[str, timedelta], optional
By what time period to group, by default "1d"
cumulative : bool, optional
Whether to take the cumulative value or the absolute one, by default False
show_changes : bool, optional
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure how much I like this name. I think cumulative is more technically correct - technically the distinction is between cumulative or delta. We could make it a literal between these? That's even more explicit

df = (
df.with_columns(
Delta=pl.col(metric).cast(pl.Int64).diff().over(grouping_columns)
PeriodChange=pl.col(metric).diff().over(grouping_columns)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PeriodChange seems unnecessarily ambiguous; it's just the delta between snapshot times right? Period implies that could be something different from day-to-day changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants