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

wily rank for revision without data raises statistics.StatisticsError #196

Closed
devdanzin opened this issue Jul 10, 2023 · 0 comments
Closed

Comments

@devdanzin
Copy link
Collaborator

For some revisions, like wily's own 9519747, rank finds no data to report. However, in rank() it still tries to calculate the mean for no data, resulting in:

statistics.StatisticsError: mean requires at least one data point

To Reproduce

  1. checkout wily's repo
  2. wily build
  3. wily rank -r 9519747
  4. See traceback ending like above.

Expected behavior
No exception raised and either print nothing, or print an empty table listing a total of 0. Printing nothing is what wily diff does when there are no results. No users should be impacted by not printing, as it just didn't work before.

Screenshots
Printing an empty table with a total of zero looks like this:

╒════════╤═════════════════════════╕
│ File   │   Maintainability Index │
╞════════╪═════════════════════════╡
│ Total  │                       0 │
╘════════╧═════════════════════════╛

Desktop (please complete the following information):

  • OS: Windows
  • Version 1.24.2

I'll submit a PR for the "prints nothing" option.

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