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

[BUG] Problem with time series for repository with a short lifetime ( <64 day) #362

Open
Detrous opened this issue Apr 24, 2020 · 2 comments

Comments

@Detrous
Copy link

Detrous commented Apr 24, 2020

Hi! I found that time_series cannot be created for repositories with lifetime lower than 64 days.
It is caused by this constant
https://github.com/src-d/hercules/blob/master/python/labours/modes/devs.py#L51
window = slepian(size // resolution, 0.5) windows can be blank(if size < resolution) that will cause this error:

Traceback (most recent call last):
  File "/usr/local/bin/labours", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.7/site-packages/labours/cli.py", line 449, in main
    modes[mode]()
  File "/usr/local/lib/python3.7/site-packages/labours/cli.py", line 349, in devs
    max_people=args.max_people,
  File "/usr/local/lib/python3.7/site-packages/labours/modes/devs.py", line 66, in show_devs
    final[route_map[i]] = convolve(full_history, window, "same")
  File "/usr/local/lib/python3.7/site-packages/scipy/signal/signaltools.py", line 811, in convolve
    method = choose_conv_method(volume, kernel, mode=mode)
  File "/usr/local/lib/python3.7/site-packages/scipy/signal/signaltools.py", line 698, in choose_conv_method
    if _fftconv_faster(volume, kernel, mode):
  File "/usr/local/lib/python3.7/site-packages/scipy/signal/signaltools.py", line 512, in _fftconv_faster
    tuple(out_shape)))
  File "/usr/local/lib/python3.7/site-packages/scipy/signal/signaltools.py", line 511, in <genexpr>
    fft_time = sum(n * math.log(n) for n in (x.shape + h.shape +
ValueError: math domain error

Why resolution is set to 64 ? Maybe this value must be calculated based on size and should always be lower then size ? #

@Detrous Detrous changed the title [BUG] Problem with time series for repository with a short lifetime ( >64 day) [BUG] Problem with time series for repository with a short lifetime ( <64 day) Apr 24, 2020
@nepp95
Copy link

nepp95 commented Oct 27, 2021

Can reproduce this. Also not working for me.

@apachetonville
Copy link

I can reproduce this error as well. Debug log below:

Plotting
Traceback (most recent call last):
  File "/usr/local/bin/labours", line 33, in <module>
    sys.exit(load_entry_point('labours==10.7.2', 'console_scripts', 'labours')())
  File "/usr/local/lib/python3.6/dist-packages/labours/cli.py", line 449, in main
    modes[mode]()
  File "/usr/local/lib/python3.6/dist-packages/labours/cli.py", line 349, in devs
    max_people=args.max_people,
  File "/usr/local/lib/python3.6/dist-packages/labours/modes/devs.py", line 59, in show_devs
    final[route_map[i]] = convolve(full_history, window, "same")
  File "/usr/local/lib/python3.6/dist-packages/scipy/signal/signaltools.py", line 799, in convolve
    method = choose_conv_method(volume, kernel, mode=mode)
  File "/usr/local/lib/python3.6/dist-packages/scipy/signal/signaltools.py", line 692, in choose_conv_method
    if _fftconv_faster(volume, kernel, mode):
  File "/usr/local/lib/python3.6/dist-packages/scipy/signal/signaltools.py", line 508, in _fftconv_faster
    tuple(out_shape)))
  File "/usr/local/lib/python3.6/dist-packages/scipy/signal/signaltools.py", line 507, in <genexpr>
    fft_time = sum(n * math.log(n) for n in (x.shape + h.shape +
ValueError: math domain error
##[debug]Docker Action run completed with exit code 1
##[debug]Finishing: Hercules

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

No branches or pull requests

3 participants