def generate_widget() -> Widget: w = Widget() w.serial_number = "devserial1" w.factory_id = "kitty hawk" w.line_id = "1" w.classification = generate_classification() return w
def generate_widget() -> Widget: w = Widget() w.serial_number = "devserial1" w.factory_id = "kitty hawk" w.line_id = "1" w.classification = generate_classification() w.telemetry = [generate_telemetry() for i in range(0, 5)] return w
def generate_widget(is_anomaly=False) -> Widget: w = Widget() w.serial_number = str(uuid.uuid4()) factories = ["kitty hawk", "nags head", "seattle", "miami"] w.factory_id = random.choice(factories) line_ids = ["1", "2", "3"] w.line_id = random.choice(line_ids) w.telemetry = generate_telemetry_list(10, is_anomaly=is_anomaly) w.classification = generate_classification() return w
def widget_from_row(row) -> Widget: w_class = Widget_Classification() w_class.classified_time = row.classified_time w_class.threshold = row.threshold w_class.mean = row.mean w_class.std = row.std w_class.std_dist = row.std_dist wid = Widget() wid.classification = w_class wid.serial_number = row.serial_number wid.line_id = row.line_id wid.factory_id = row.factory_id return wid