''' sync = False if load_ds_queries.check_uuid(self.conn, exp_uuid): conn = self.conn elif load_ds_queries.check_uuid(SQL_database_manager().conn_remote, exp_uuid): conn = SQL_database_manager().conn_remote sync = sync2local else: raise ValueError( "the uuid {}, does not exist in the local/remote database.". format(exp_uuid)) ds_raw = load_ds_queries.get_dataset_raw(conn, exp_uuid) if sync: conn_mgr = SQL_database_manager() sync_mgr_queries.sync_raw_data(conn_mgr, exp_uuid, to_local=True) sync_mgr_queries.sync_table(conn_mgr, exp_uuid, to_local=True) return ds_raw if __name__ == '__main__': from core_tools.data.SQL.connector import set_up_local_storage, set_up_remote_storage, set_up_local_and_remote_storage set_up_local_storage('stephan', 'magicc', 'test', 'test_project', 'test_set_up', 'test_sample') # set_up_local_and_remote_storage('131.180.205.81', 5432, 'stephan', 'magicc', 'test', # 'stephan_test', 'magicc', 'spin_data_test', 'test_project', 'test_set_up', 'test_sample') ds_creator = SQL_dataset_creator() ds_creator.fetch_raw_dataset_by_Id(71)
@staticmethod def __check_exist(cursor, statement): cursor.execute(statement) return_data = cursor.fetchall() if len(return_data) == 0 or return_data[0][0] is None: return False return True if __name__ == '__main__': from core_tools.data.SQL.connector import SQL_conn_info_local, SQL_conn_info_remote, sample_info, set_up_local_storage import psycopg2 set_up_local_storage('stephan', 'magicc', 'test', '6dot', 'XLD2', 'SQblabla12') conn_local = psycopg2.connect(dbname=SQL_conn_info_local.dbname, user=SQL_conn_info_local.user, password=SQL_conn_info_local.passwd, host=SQL_conn_info_local.host, port=SQL_conn_info_local.port) cur = conn_local.cursor() # cur.execute(write_query_generator.generate_data_overview_tables()) # cur.execute(write_query_generator.write_data_overview_tables(sample_info.project, sample_info.set_up, sample_info.sample)) # conn_local.commit() # cur.close() # name1 = '_'+sample_info.project+'_'+sample_info.set_up+'_'+sample_info.sample # name2 = 'global_measurement_overview'
return line def generate_h_line(self, name): line = QtWidgets.QFrame(self.geom_parent) line.setFrameShape(QtWidgets.QFrame.HLine) line.setFrameShadow(QtWidgets.QFrame.Sunken) line.setObjectName(name) return line if __name__ == '__main__': from core_tools.data.SQL.connector import SQL_conn_info_local, SQL_conn_info_remote, sample_info, set_up_local_storage from core_tools.data.SQL.SQL_measurment_queries import query_for_measurement_results from core_tools.data.ds.data_set import load_by_id import sys import datetime set_up_local_storage('stephan', 'magicc', 'test', 'Intel Project', 'F006', 'SQ38328342') ds = load_by_id(45782) class test_window(QtWidgets.QMainWindow): def __init__(self, MainWindow, ds): super().__init__() self.centralwidget = QtWidgets.QWidget(MainWindow) self.gridLayout_2 = QtWidgets.QGridLayout(self.centralwidget) self.gridLayout_2.setObjectName("gridLayout_2") self.scrollArea = QtWidgets.QScrollArea(self.centralwidget) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Expanding) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0)
[['Quantum sim', 'dipstick'], ['Quantum sim', 'V2'],], [['Hybrid', 'VTI'], ['Hybrid', 'dipstick'], ['Hybrid', 'V3'],], [['Horsridge', 'XLD2']], [['6dot', 'dipstick'], ['6dot', 'XLD']], [['2x2', 'dipstick'], ['2x2', 'V1'], ['2x2', 'V2']] ] print(projects_set_up_pairs) n = 0 import psycopg2 from core_tools.data.SQL.SQL_commands import write_query_generator from core_tools.data.SQL.SQL_database_mgr import SQL_database_manager set_up_local_storage('stephan', 'magicc', 'test', 'project', 'set_up', 'sample_name') SQL_database_manager() conn_local = psycopg2.connect(dbname=SQL_conn_info_local.dbname, user=SQL_conn_info_local.user, password=SQL_conn_info_local.passwd, host=SQL_conn_info_local.host, port=SQL_conn_info_local.port) cur = conn_local.cursor() for p_s_multi in projects_set_up_pairs: n_samples = random.randint(, 40) for n_samples in range(n_samples): sample_name = 'SQ' + str(random.randint(10000000, 100000000)) for project, set_up in p_s_multi: set_up_local_storage('stephan', 'magicc', 'test', project, set_up, sample_name) n_measurements = random.randint(100, 3000)