Skip to content

add month suffix M to asv --date-period argument #34

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions asv_runner/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@ def human_float(value, significant=3, truncate_small=None, significant_zeros=Fal
("h", 60 * 60),
("d", 60 * 60 * 24),
("w", 60 * 60 * 24 * 7),
("M", int(60 * 60 * 24 * 7 * 52 / 12)),
("q", int(60 * 60 * 24 * 7 * 52 / 4)),
Comment on lines +110 to +111
Copy link
Member

Choose a reason for hiding this comment

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

Just as a stylistic nit, are the conversions for the other suffixes done elsewhere? It would be nice to be consistent perhaps.

Copy link
Author

Choose a reason for hiding this comment

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

I don't think so, the place it's being used in the asv flow is here:
https://github.com/airspeed-velocity/asv/blob/b8cbf81ccb808158102692a6fc42b8a9b2f2861e/asv/util.py#L187
and there's not type guard there. Should there be?

("y", 60 * 60 * 24 * 7 * 52),
("C", 60 * 60 * 24 * 7 * 52 * 100),
)
Expand Down