Skip to content

Commit

Permalink
Merge pull request #225 from VesnaT/line_chart_arr_dtype
Browse files Browse the repository at this point in the history
[FIX] Line Chart: Plot data in metas
  • Loading branch information
ajdapretnar committed Aug 3, 2022
2 parents 6e6f18c + 55cbf06 commit 8459850
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions orangecontrib/timeseries/widgets/owlinechart.py
Original file line number Diff line number Diff line change
Expand Up @@ -776,6 +776,7 @@ def __extract_data(
) -> Tuple[np.ndarray, np.ndarray, np.ndarray]:
y_true = data.get_column_view(variable)[0].astype(float)
x_total = data.time_values if is_time_var else np.arange(len(y_true))
x_total = x_total.astype(float)
y_pred, y_pred_low, y_pred_high = None, None, None

x_tail = x_total[-2:].copy() # remember original x to plot prediction
Expand All @@ -784,12 +785,12 @@ def __extract_data(
var_pred = variable.name + " (forecast)"
if forecast and var_pred in forecast.domain:
var_pred = forecast.domain[var_pred]
y_pred = forecast.get_column_view(var_pred)[0]
y_pred = forecast.get_column_view(var_pred)[0].astype(float)

var_low, var_high = getattr(var_pred, "ci_attrs", (None, None))
if var_low in forecast.domain and var_high in forecast.domain:
y_pred_low = forecast.get_column_view(var_low)[0]
y_pred_high = forecast.get_column_view(var_high)[0]
y_pred_low = forecast.get_column_view(var_low)[0].astype(float)
y_pred_high = forecast.get_column_view(var_high)[0].astype(float)

x_pred = np.arange(len(y_true) + len(y_pred) - 1)
if is_time_var:
Expand Down

0 comments on commit 8459850

Please sign in to comment.