src-d / hercules

Gaining advanced insights from Git repository history.
Other
2.63k stars 334 forks source link

[labours] overflow encountered in ulong_scalars #268

Closed senden9 closed 5 years ago

senden9 commented 5 years ago

Hi!

I tried hercules on a quite big private repository of our company. It seems that something in labours overflows. The repository use LFS if that matters.

CLI Output

$ ./hercules.linux_amd64 git@github.com:ORG/REPONAME.git repo-cache
[...]

$ ./hercules.linux_amd64 --burndown --granularity 2 --sampling 2 --pb repo-cache/ > baukasten_burndown.pb

$ ls -lh baukasten_burndown.pb 
-rw-r--r-- 1 stefano stefano 8,0K  7. Apr 09:42 baukasten_burndown.pb

$ cat baukasten_burndown.pb | labours -f pb -m burndown-project
Reading the input... done
project lifetime index: 0.3188283261307594
resampling to year, please wait...
Traceback (most recent call last):
  File "/tmp/tetet/venv/lib/python3.7/site-packages/pandas/core/arrays/_ranges.py", line 120, in _generate_range_overflow_safe
    addend = np.uint64(periods) * np.uint64(np.abs(stride))
FloatingPointError: overflow encountered in ulong_scalars

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/tmp/tetet/venv/bin/labours", line 10, in <module>
    sys.exit(main())
  File "/tmp/tetet/venv/lib/python3.7/site-packages/labours/labours.py", line 1891, in main
    modes[args.mode]()
  File "/tmp/tetet/venv/lib/python3.7/site-packages/labours/labours.py", line 1737, in project_burndown
    resample=args.resample))
  File "/tmp/tetet/venv/lib/python3.7/site-packages/labours/labours.py", line 613, in load_burndown
    freq="1D")
  File "/tmp/tetet/venv/lib/python3.7/site-packages/pandas/core/indexes/datetimes.py", line 1524, in date_range
    closed=closed, **kwargs)
  File "/tmp/tetet/venv/lib/python3.7/site-packages/pandas/core/arrays/datetimes.py", line 448, in _generate_range
    values, _tz = generate_regular_range(start, end, periods, freq)
  File "/tmp/tetet/venv/lib/python3.7/site-packages/pandas/core/arrays/_ranges.py", line 46, in generate_regular_range
    e = _generate_range_overflow_safe(b, periods, stride, side='start')
  File "/tmp/tetet/venv/lib/python3.7/site-packages/pandas/core/arrays/_ranges.py", line 122, in _generate_range_overflow_safe
    raise OutOfBoundsDatetime(msg)
pandas._libs.tslibs.np_datetime.OutOfBoundsDatetime: Cannot generate range with start=1546269728000000000 and periods=-80

Versions

 $ pip freeze | rg labours
labours==10.0.1

 $ ./hercules.linux_amd64 version
Version: 10
Git:     b856b666909194669e93d2c8dd5f86a96d9f60dc
vmarkovtsev commented 5 years ago

Thanks for testing.

Is it possible to send me the YAML file (no --pb) to the email from my GitHub profile? There should be nothing private inside except the repo name, which you can edit by hand.

The current workaround is obviously to increase granularity and sampling until it stops to overflow.

senden9 commented 5 years ago

Thanks! Mail is out.

With labours -m burndown-project --resample M < baukasten_burndown.yaml it is working without a problem.

senden9 commented 5 years ago

Thanks