Skip to content
This repository was archived by the owner on Feb 28, 2022. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DB/api/query_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ def format_data(header, data, json=False):
yield ',' + format_data_row(row)
yield "]"
if json:
yield "}"
yield "}\n" # Newline at Ian's request


def write_subsample(query, crosstab=False):
Expand Down
2 changes: 2 additions & 0 deletions DB/api/server.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/usr/bin/env python3
import sys
import os

# add Backend directory to python path so we can do
# cross directory imports
path = os.path.dirname(os.path.realpath(__file__))
Expand Down
20 changes: 0 additions & 20 deletions DB/api/test_query_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,26 +79,6 @@ def format_data(*args):
return 'format_data called'
return format_data

#TODO: reenable test.
# def test_classify(self):
# self.query_options['device_id'] = 5
# self.retrieve_args[0] = 5

# self.query_options['classify'] = True
# self.query_options['device'] = 'Panel1'
# self.retrieve_args[7] = 'Panel1'

# self.query_options['start_time'] = 6
# self.retrieve_args[1] = 6

# self.query_options['end_time'] = 7
# self.retrieve_args[2] = 7

# query_db.retrieve_within_filters = self.retrieve_factory()
# Analysis_3.run = self.classify_factory()

# self.assertEqual(query_db.query(self.query_options), 'classify called')

def test_classify_missing_start_time(self):
self.query_options['device_id'] = 10
self.query_options['device'] = "Panel1"
Expand Down
2 changes: 1 addition & 1 deletion DB/classification/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@

# This is an empty file. There are Reasons behind its existance. Please do not delete it.
57 changes: 0 additions & 57 deletions DB/classification/dataset_converter_unit_tests.py

This file was deleted.

2 changes: 1 addition & 1 deletion DB/classification/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ def get_model(cls):

try:
cursor = con.cursor()
query = "SELECT * FROM classifier_model ORDER BY created_at DESC LIMIT 1;"
query = "SELECT classifier_model.id, classifier_model.window_size, classifier_model.created_at, classifier_model.model_type, classifier_model.model, classifier_model.labels, classifier_model.trained FROM classifier_model ORDER BY created_at DESC LIMIT 1;"
cursor.execute(query)
model_row = cursor.fetchall()
except psycopg2.Error as e:
Expand Down
1 change: 0 additions & 1 deletion DB/classification/test_RandomForestModel.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import psycopg2
import unittest
#import DB.classification.RandomForestModel as rfm
import DB.classification.RandomForestModel as rfm
import datetime
import random
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
psycopg2==2.6.1