def test_ddt3_quadratic(self): jfile = os.path.join(self.path, "u-squared-ddt3.json") client.main([jfile]) ofile = os.path.join(self.path, "u-squared-sig-proc-3.csv") data = np.genfromtxt(ofile, dtype="float", delimiter=",") test = data[:, 1] ref = np.zeros(11) diff = test - ref diff_norm = np.linalg.norm(diff) same_data = False same_data = np.abs(diff_norm) < self.tol self.assertTrue(same_data)
def test_ddt1_sine(self): jfile = os.path.join(self.path, "t-v-sines-ddt1.json") client.main([jfile]) ofile = os.path.join(self.path, "t-v-sines-sig-proc-1.csv") data = np.genfromtxt(ofile, dtype="float", delimiter=",") test = data[:, 1] _t = np.linspace(0, 1, 101) ref = 2 * np.pi * np.cos(2 * np.pi * _t) diff = test - ref diff_norm = np.linalg.norm(diff) same_data = False # same_data = np.abs(diff_norm) < self.tol # In manual testing, the L2norm was # diff_norm: 0.031201004731119160 # because of how the np.gradient operator works on the edges of the # interval, so loosen the tolerance manually: _cosine_tolerance = 0.1 # same_data = np.abs(diff_norm) < 10000 same_data = np.abs(diff_norm) < _cosine_tolerance self.assertTrue(same_data)
def test_unknown_factory_item_request(self): jfile = os.path.join(self.path, "u-squared-ddt1-model-type-defect.json") result = client.main([jfile]) self.assertIsNone(result)
def test_101_anomaly_recipe(self): jfile = os.path.join(self.path, "anomaly_recipe.json") result = client.main([jfile]) self.assertIsNone(result)
def test_100_correlation_recipe(self): jfile = os.path.join(self.path, "correlation_recipe.json") result = client.main([jfile]) self.assertIsNone(result)
def test_defective_json_keyword_file(self): jfile = os.path.join(self.path, "u-squared-ddt1-file-defect.json") client.main([jfile])
def test_defective_signal_process(self): jfile = os.path.join(self.path, "u-squared-ddt1-signal-process-defect.json") client.main([jfile])
def test_verbose_model(self): jfile = os.path.join(self.path, "u-squared-ddt1-verbose.json") client.main([jfile])