Skip to content

added pandas day alias to fix problem when using hercules with resolutions < 1 month #323

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

Merged
merged 1 commit into from
Nov 28, 2019
Merged

Conversation

Jeffrey-P-McAteer
Copy link
Contributor

Not sure where to fix this but I was getting the following errors when running with values of $DAYS < 30

./hercules --sampling=$DAYS --granularity=$DAYS --burndown --first-parent --pb "$OLD_CWD" | labours -f pb -m burndown-project --output stack_plot.png
Running: burndown-project
         Ratio of survived lines
2 days                  0.947440
4 days                  0.917328
6 days                  0.915297
8 days                  0.915124
10 days                 0.915124
12 days                 0.915124
14 days                 0.915124
14 days                 0.915124
resampling to year, please wait...
100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 7/7 [00:00<00:00, 5108.77it/s]
too loose resampling - by year, trying by month
resampling to month, please wait...
Traceback (most recent call last):
  File "/usr/bin/labours", line 10, in <module>
    sys.exit(main())
  File "/usr/lib/python3.7/site-packages/labours/cli.py", line 449, in main
    modes[mode]()
  File "/usr/lib/python3.7/site-packages/labours/cli.py", line 204, in project_burndown
    interpolation_progress=True,
  File "/usr/lib/python3.7/site-packages/labours/modes/burndown.py", line 344, in load_burndown
    header, name, matrix, "month", report_survival=False
  File "/usr/lib/python3.7/site-packages/labours/modes/burndown.py", line 347, in load_burndown
    raise ValueError("Too loose resampling: %s. Try finer." % resample)
ValueError: Too loose resampling: M. Try finer.

the pandas.date_range freq argument accepts a number of different time strings including D for day resolution, which is what I wanted for a small project of mine.

Copy link
Collaborator

@vmarkovtsev vmarkovtsev left a comment

Choose a reason for hiding this comment

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

Thanks for a great contribution!

@vmarkovtsev
Copy link
Collaborator

Hey @Jeffrey-P-McAteer could you please fix the DCO and the CI so that I can merge this? I believe that a git rebase - -signoff should solve both problems.

…tions < 1 month

Signed-off-by: Jeffrey McAteer <jeffrey.p.mcateer@gmail.com>
@vmarkovtsev vmarkovtsev merged commit 78cfaf4 into src-d:master Nov 28, 2019
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