biolab / orange3-timeseries

🍊 :chart_with_upwards_trend: Orange add-on for analyzing, visualizing, manipulating, and forecasting time series data.
Other
62 stars 40 forks source link

Line Chart: crash on sparse #224

Closed ajdapretnar closed 2 years ago

ajdapretnar commented 2 years ago
Timeseries version

master since #220

Orange version

3.32.dev

Expected behavior

Online retail data works.

Actual behavior
----------------------------- TypeError Exception -----------------------------
AttributeError: 'float' object has no attribute 'rint'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/Users/ajda/.pyenv-x86/versions/py3.9/lib/python3.9/site-packages/numpy/core/fromnumeric.py", line 57, in _wrapfunc
    return bound(*args, **kwds)
TypeError: loop of ufunc does not support argument 0 of type float which has no callable rint method

During handling of the above exception, another exception occurred:

AttributeError: 'float' object has no attribute 'rint'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/Users/ajda/orange/orange-canvas-core/orangecanvas/scheme/signalmanager.py", line 1047, in __process_next
    if self.__process_next_helper(use_max_active=True):
  File "/Users/ajda/orange/orange-canvas-core/orangecanvas/scheme/signalmanager.py", line 1085, in __process_next_helper
    self.process_node(selected_node)
  File "/Users/ajda/orange/orange-canvas-core/orangecanvas/scheme/signalmanager.py", line 713, in process_node
    self.send_to_node(node, signals_in)
  File "/Users/ajda/orange/orange-widget-base/orangewidget/workflow/widgetsscheme.py", line 806, in send_to_node
    self.process_signals_for_widget(node, widget, signals)
  File "/Users/ajda/orange/orange-widget-base/orangewidget/workflow/widgetsscheme.py", line 820, in process_signals_for_widget
    process_signals_for_widget(widget, signals, workflow)
  File "/Users/ajda/.pyenv-x86/versions/3.9.10/lib/python3.9/functools.py", line 888, in wrapper
    return dispatch(args[0].__class__)(*args, **kw)
  File "/Users/ajda/orange/orange-widget-base/orangewidget/workflow/widgetsscheme.py", line 921, in process_signals_for_widget
    process_signal_input(input_meta, widget, signal, workflow)
  File "/Users/ajda/.pyenv-x86/versions/3.9.10/lib/python3.9/functools.py", line 888, in wrapper
    return dispatch(args[0].__class__)(*args, **kw)
  File "/Users/ajda/orange/orange-widget-base/orangewidget/workflow/widgetsscheme.py", line 884, in process_signal_input_default
    notify_input_helper(
  File "/Users/ajda/.pyenv-x86/versions/3.9.10/lib/python3.9/functools.py", line 888, in wrapper
    return dispatch(args[0].__class__)(*args, **kw)
  File "/Users/ajda/orange/orange-widget-base/orangewidget/utils/signals.py", line 692, in set_input_helper
    handler(*args)
  File "/Users/ajda/orange/orange-widget-base/orangewidget/utils/signals.py", line 205, in summarize_wrapper
    method(widget, value)
  File "/Users/ajda/orange/orange3-timeseries/orangecontrib/timeseries/widgets/owlinechart.py", line 664, in set_data
    self.init_editor()
  File "/Users/ajda/orange/orange3-timeseries/orangecontrib/timeseries/widgets/owlinechart.py", line 686, in init_editor
    self._add_editor({"vars": self._vars_model[:1]})
  File "/Users/ajda/orange/orange3-timeseries/orangecontrib/timeseries/widgets/owlinechart.py", line 738, in _add_editor
    self._setup_plot(len(self._editors) - 1, editor.parameters())
  File "/Users/ajda/orange/orange3-timeseries/orangecontrib/timeseries/widgets/owlinechart.py", line 766, in _setup_plot
    self.__extract_data(self.data, var, self.forecast, is_time_var)
  File "/Users/ajda/orange/orange3-timeseries/orangecontrib/timeseries/widgets/owlinechart.py", line 782, in __extract_data
    x_total, y_true = self.__remove_duplicates(x_total, y_true)
  File "/Users/ajda/orange/orange3-timeseries/orangecontrib/timeseries/widgets/owlinechart.py", line 814, in __remove_duplicates
    np.round(x / k),  # also remove highly granular data
  File "<__array_function__ internals>", line 180, in round_
  File "/Users/ajda/.pyenv-x86/versions/py3.9/lib/python3.9/site-packages/numpy/core/fromnumeric.py", line 3773, in round_
    return around(a, decimals=decimals, out=out)
  File "<__array_function__ internals>", line 180, in around
  File "/Users/ajda/.pyenv-x86/versions/py3.9/lib/python3.9/site-packages/numpy/core/fromnumeric.py", line 3348, in around
    return _wrapfunc(a, 'round', decimals=decimals, out=out)
  File "/Users/ajda/.pyenv-x86/versions/py3.9/lib/python3.9/site-packages/numpy/core/fromnumeric.py", line 66, in _wrapfunc
    return _wrapit(obj, method, *args, **kwds)
  File "/Users/ajda/.pyenv-x86/versions/py3.9/lib/python3.9/site-packages/numpy/core/fromnumeric.py", line 43, in _wrapit
    result = getattr(asarray(obj), method)(*args, **kwds)
TypeError: loop of ufunc does not support argument 0 of type float which has no callable rint method
-------------------------------------------------------------------------------
Steps to reproduce the behavior

Datasets (Online retail) - Line Chart.

Additional info (worksheets, data, screenshots, ...)

/