def setUp(self):
   # Data paths
   file_noecho = './test_data/frame_no_echo.nc'
   file_v_zero = './test_data/frame_v_zero.nc'
   file_faulty = './test_data/frame_with_faulty_excitation.nc'
   file_noexci = './test_data/frame_with_no_excitation.nc'
   
   # Data loading
   self.frame_noecho = utilities.load_data_from_file(file_noecho)
   self.frame_v_zero = utilities.load_data_from_file(file_v_zero)
   self.frame_faulty = utilities.load_data_from_file(file_faulty)
   self.frame_noexci = utilities.load_data_from_file(file_noexci)
 def test_load_data_from_file(self):
   self.assertEqual(type(utilities.load_data_from_file(self.file_noecho)),
                    np.ndarray)
   self.assertNotEqual(type(self.echoes_noecho), dict)
   self.assertRaises(IOError, utilities.load_data_from_file, 
                     'non_existent_file.nc')
Example #3
0
from rebuild_operation import Rebuild_Operator
import utilities
import time
if __name__ == '__main__':

    #should test with high padding mode to see the effectiveness

    #only for rebuild mode
    rebuild_mode = False
    alpha = 256

    client_state_folder = "tmp"

    #select cluster to rebuild and all their corresponding keywords
    key_folder = "data" + str(alpha)
    fixed_clusters_keywords = utilities.load_data_from_file(
        key_folder, "fixed_clusters_keywords")
    prob_clusters = utilities.load_data_from_file(key_folder, "prob_clusters")

    largest_cluster_index = prob_clusters.index(max(prob_clusters))
    query_keywords = fixed_clusters_keywords[largest_cluster_index]

    rebuild_operator = Rebuild_Operator(query_keywords, client_state_folder)
    rebuild_operator.start()
    rebuild_operator.join()
    rebuild_operator.terminate()

    time.sleep(10)
Example #4
0
 def test_load_data_from_file(self):
     self.assertEqual(type(utilities.load_data_from_file(self.file_noecho)),
                      np.ndarray)
     self.assertNotEqual(type(self.echoes_noecho), dict)
     self.assertRaises(IOError, utilities.load_data_from_file,
                       'non_existent_file.nc')