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

default_region="point" crashes for timeseries #103

Closed
ahuang11 opened this issue Apr 24, 2024 · 0 comments · Fixed by #104
Closed

default_region="point" crashes for timeseries #103

ahuang11 opened this issue Apr 24, 2024 · 0 comments · Fixed by #104

Comments

@ahuang11
Copy link
Contributor

import panel as pn
import numpy as np
import pandas as pd
import hvplot.pandas
import numpy as np
import holoviews as hv

from holonote.annotate import SQLiteDB, Annotator
from holonote.app import PanelWidgets

pn.extension()

curve = pd.read_parquet("assets/example.parquet").hvplot(x="TIME")
connector = SQLiteDB(table_name="test_app")
fields = ["Stoppage", "Reason", "Category"]
annotator = Annotator({"TIME": np.datetime64, "SPEED": float}, fields=fields, connector=connector, default_region="point")
annotator_element = annotator * curve

fields_values = {
    "Stoppage": ["Yes", "No"],
    "Category": ["Mechanical", "Electrical", "Process", "Other"],
}

w = PanelWidgets(annotator, field_values=fields_values)

pn.Row(w, annotator_element)

traceback

  File "/Users/ahuang/repos/holonote/holonote/annotate/display.py", line 346, in _filter_stream_values
    x = (bounds[0] + bounds[2]) / 2
numpy.core._exceptions._UFuncBinaryResolutionError: ufunc 'add' cannot use operands with types dtype('<M8[us]') and dtype('<M8[us]')```
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 a pull request may close this issue.

1 participant