diff --git a/WorkbookTemplates/Compare_scenarios_result/CompareScenario_empty.xlsx b/WorkbookTemplates/Compare_scenarios_result/CompareScenario_empty.xlsx index 5fc9b91..c11f2ef 100644 Binary files a/WorkbookTemplates/Compare_scenarios_result/CompareScenario_empty.xlsx and b/WorkbookTemplates/Compare_scenarios_result/CompareScenario_empty.xlsx differ diff --git a/WorkbookTemplates/InputData_Template/WaMDaM_InputData_template.xlsm b/WorkbookTemplates/InputData_Template/WaMDaM_InputData_template.xlsm deleted file mode 100644 index 2c9372e..0000000 Binary files a/WorkbookTemplates/InputData_Template/WaMDaM_InputData_template.xlsm and /dev/null differ diff --git a/WorkbookTemplates/InputData_Template/WaMDaM_InputData_template_April2018.xlsm b/WorkbookTemplates/InputData_Template/WaMDaM_InputData_template_April2018.xlsm new file mode 100644 index 0000000..4080dd3 Binary files /dev/null and b/WorkbookTemplates/InputData_Template/WaMDaM_InputData_template_April2018.xlsm differ diff --git a/WorkbookTemplates/InputData_Template/template.PNG b/WorkbookTemplates/InputData_Template/template.PNG index 4f671e7..31d259a 100644 Binary files a/WorkbookTemplates/InputData_Template/template.PNG and b/WorkbookTemplates/InputData_Template/template.PNG differ diff --git a/src_1.0/ReadMe.md b/src/ReadMe.md similarity index 100% rename from src_1.0/ReadMe.md rename to src/ReadMe.md diff --git a/src_1.0/SqliteDDL_hooks_path.PNG b/src/SqliteDDL_hooks_path.PNG similarity index 100% rename from src_1.0/SqliteDDL_hooks_path.PNG rename to src/SqliteDDL_hooks_path.PNG diff --git a/src_1.0/Validations_README b/src/Validations_README similarity index 100% rename from src_1.0/Validations_README rename to src/Validations_README diff --git a/src_1.0/wamdam.py b/src/WaMDaM.py similarity index 80% rename from src_1.0/wamdam.py rename to src/WaMDaM.py index 45bf990..a47a056 100644 --- a/src_1.0/wamdam.py +++ b/src/WaMDaM.py @@ -1,11 +1,20 @@ #!/usr/bin/env python # -*- coding: utf-8 -*-# -# Wamdam.py +# Wamdam_v1.01.py +"""""" + +""" +WaMDaM: The Water Management Data Model Version 1.01 +See the schema at http://schema.wamdam.org/diagrams/01_WaMDaM.html +Instructions at http://docs.wamdam.org/Getting_started/Steps +Adel M. Abdallah +email: amabdallah@aggiemail.usu.edu +""" """ -Wamdam.py is the key calling/initializing function for the Wizard. +Wamdam.py is the calling/initializing function for the Wizard. Before you start, make sure to install all the required Python libraries listed in requirements.md text file/ @@ -27,20 +36,20 @@ dlg_ImportSpreadsheetBasic.py which exist in the viewer Folder. Then when the user clicks at "load Data" in this dialog box, a function calls one or all the sub-data importers for the checked boxes from the controller folder: -stp0_loadCVs.py, stp1_loadMetadata.py, -stp2_loadDataStructure.py, -stp3_loadNetworks.py, -and stp4_loadDataValues.py +stp0_loadCVs.py, stp1_loadMetadata.py, +stp2_loadDataStructure.py, +stp3_loadNetworks.py, +and stp4_loadDataValues.py stp0_loadCVs.py, load_step_1.py, load_step_2.py, load_step_3.py, stp4_loadDataValues.py -It's important to note that the controlled vocabulary (CV) data in the stp0_loadCVs.py -are called from the online registry http://vocabulary.wamdam.org/ -while the data for the rest of the steps are obtained form the provided spreadsheet template or other source of data. +It's important to note that the controlled vocabulary (CV) data in the stp0_loadCVs.py +are called from the online registry http://vocabulary.wamdam.org/ +while the data for the rest of the steps are obtained form the provided spreadsheet template or other source of data. -The Wizard implements dozens of validations and checks on the imported data +The Wizard implements dozens of validations and checks on the imported data to make sure it complies with WaMDaM business rules -The Wizard either loads all the dataset and it's metadata etc or nothing. +The Wizard either loads all the dataset and it's metadata etc or nothing. See the software architecture in a flowchart @ https://github.com/WamdamProject/WaMDaM_Wizard """ @@ -70,4 +79,3 @@ def main(): if __name__ == '__main__': main() - diff --git a/src_1.0/WaMDaM_Wizard.ico b/src/WaMDaM_Wizard.ico similarity index 100% rename from src_1.0/WaMDaM_Wizard.ico rename to src/WaMDaM_Wizard.ico diff --git a/src_1.0/__init__.py b/src/__init__.py similarity index 100% rename from src_1.0/__init__.py rename to src/__init__.py diff --git a/src_1.0/src_1.0_MacOS_test/controller/CUAHS_importer.py b/src/controller/CUAHS_importer.py similarity index 90% rename from src_1.0/src_1.0_MacOS_test/controller/CUAHS_importer.py rename to src/controller/CUAHS_importer.py index efeda39..dd34f64 100644 --- a/src_1.0/src_1.0_MacOS_test/controller/CUAHS_importer.py +++ b/src/controller/CUAHS_importer.py @@ -136,29 +136,29 @@ def load_data(self, response_data): self.setup.add_data() #////////////////////////////////////////////////////////////////////# - # Add data within Datasets table - recordCountResult = self.__session.execute('SELECT COUNT(*) FROM Datasets;') - datasetID = 0 + # Add data within ResourceTypes table + recordCountResult = self.__session.execute('SELECT COUNT(*) FROM ResourceTypes;') + resourceTypeID = 0 for n in recordCountResult: - datasetID = int(n[0]) - datasetID += 1 + resourceTypeID = int(n[0]) + resourceTypeID += 1 - dataset_name = "CUAHSI web service" + resource_type = "CUAHSI web service" - # Check whether same name exist in Datasets table + # Check whether same name exist in ResourceTypes table exsting = None try: - exsting = self.__session.query(SqlAlchemy.Datasets).filter( - SqlAlchemy.Datasets.DatasetName == dataset_name).first().DatasetID + exsting = self.__session.query(SqlAlchemy.ResourceTypes).filter( + SqlAlchemy.ResourceTypes.ResourceType == resource_type).first().ResourceTypeID except: pass if exsting is None: - datasets = SqlAlchemy.Datasets() - datasets.DatasetID = datasetID - datasets.DatasetName = dataset_name - datasets.DatasetAcronym = "CUAHSI" - datasets.SourceID = sourceID - self.setup.push_data(datasets) + resourceTypes = SqlAlchemy.ResourceTypes() + resourceTypes.ResourceTypeID = resourceTypeID + resourceTypes.ResourceType = resource_type + resourceTypes.ResourceTypeAcronym = "CUAHSI" + resourceTypes.MethodID = methodID + self.setup.push_data(resourceTypes) self.setup.add_data() #////////////////////////////////////////////////////////////////////# @@ -183,7 +183,7 @@ def load_data(self, response_data): objectTypes.ObjectTypeID = objectTypeID objectTypes.ObjectType = objecttype objectTypes.ObjectTypologyCV = "Node" - objectTypes.DatasetID = datasetID + objectTypes.ResourceTypeID = resourceTypeID self.setup.push_data(objectTypes) self.setup.add_data() #////////////////////////////////////////////////////////////////////# @@ -298,16 +298,16 @@ def load_data(self, response_data): instance_name = node_instance_name #////////////////////////////////////////////////////////////////////# - # Load data for DataValuesMapper, Mapping, ScenarioMapping, TimeSeries and TimeSeriesValues table - # Add data for DataValuesMapper - dataValuesMapper = SqlAlchemy.DataValuesMapper() + # Load data for ValuesMapper, Mapping, ScenarioMapping, TimeSeries and TimeSeriesValues table + # Add data for ValuesMapper + valuesMapper = SqlAlchemy.ValuesMapper() try: - dataValuesMapper.DataValuesMapperID = int(self.__session.query(SqlAlchemy.DataValuesMapper).order_by( - SqlAlchemy.DataValuesMapper.DataValuesMapperID.desc()).first().DataValuesMapperID) - dataValuesMapper.DataValuesMapperID += 1 + valuesMapper.ValuesMapperID = int(self.__session.query(SqlAlchemy.ValuesMapper).order_by( + SqlAlchemy.ValuesMapper.ValuesMapperID.desc()).first().ValuesMapperID) + valuesMapper.ValuesMapperID += 1 except: - dataValuesMapper.DataValuesMapperID = 1 - self.setup.push_data(dataValuesMapper) + valuesMapper.ValuesMapperID = 1 + self.setup.push_data(valuesMapper) self.setup.add_data() #///////////////////////////////////# @@ -323,7 +323,7 @@ def load_data(self, response_data): dataval_map.InstanceID = instance_id dataval_map.SourceID = source_id dataval_map.MethodID = method_id - dataval_map.DataValuesMapperID = dataValuesMapper.DataValuesMapperID + dataval_map.ValuesMapperID = valuesMapper.ValuesMapperID self.setup.push_data(dataval_map) self.setup.add_data() #///////////////////////////////////# @@ -372,7 +372,7 @@ def load_data(self, response_data): timeSeries.AggregationStatisticCV = "Average" timeSeries.AggregationInterval = 1 timeSeries.IntervalTimeUnitCV = "day" - timeSeries.DataValuesMapperID = dataValuesMapper.DataValuesMapperID + timeSeries.ValuesMapperID = valuesMapper.ValuesMapperID self.setup.push_data(timeSeries) self.setup.add_data() @@ -386,9 +386,9 @@ def load_data(self, response_data): timeSeriesValues.DateTimeStamp = datetime(value._dateTime.year, value._dateTime.month, value._dateTime.day, value._dateTime.hour, value._dateTime.minute, value._dateTime.second) try: - timeSeriesValues.Value = value.value + timeSeriesValues.DataValue = value.value except: - timeSeriesValues.Value = 0.0 + timeSeriesValues.DataValue = 0.0 self.setup.push_data(timeSeriesValues) self.setup.add_data() #////////////////////////////////////////////////////////////////////# diff --git a/src_1.0/src_1.0_MacOS_test/controller/ConnectDB_ParseExcel.py b/src/controller/ConnectDB_ParseExcel.py similarity index 93% rename from src_1.0/src_1.0_MacOS_test/controller/ConnectDB_ParseExcel.py rename to src/controller/ConnectDB_ParseExcel.py index 5d830ae..91ed976 100644 --- a/src_1.0/src_1.0_MacOS_test/controller/ConnectDB_ParseExcel.py +++ b/src/controller/ConnectDB_ParseExcel.py @@ -1,4 +1,3 @@ - """ The ConnectDB_ParseExcel.py file contain two very important classes used throughout all the classes in controller. these classes are: @@ -17,7 +16,6 @@ (the workbook is different than what it is supposed to be) . """ - # import the database params from SqlAlchemy.py found in the Model folder from model import SqlAlchemy @@ -38,15 +36,17 @@ from shutil import copyfile + # Get only one copy of database class at a time and use it throughout the Wizard class Singleton(type): - _instances = {} + _instances = {} + + def __call__(cls, *args, **kwargs): + if cls not in cls._instances: + cls._instances[cls] = super(Singleton, cls).__call__(*args, **kwargs) + # print "Singleton", cls._instances[cls] + return cls._instances[cls] - def __call__(cls, *args, **kwargs): - if cls not in cls._instances: - cls._instances[cls] = super(Singleton, cls).__call__(*args, **kwargs) - #print "Singleton", cls._instances[cls] - return cls._instances[cls] # ****************************************************************************************************************** # # # @@ -65,7 +65,7 @@ class used to setup the database and __path = None __type = None __backupName = None - + def __init__(self): pass @@ -82,12 +82,13 @@ def get_session(self): The Data loader has a rule to load all or nothing. so if the user cancels in the middle, then, the App, deletes the db which might have half loaded data, then it restores a backup db before loading the new data''' + def connect(self, dbpath, db_type, sql_string=None): self.__session = SqlAlchemy.connect(dbpath, db_type, sql_string) print dbpath, 'path' print db_type, 'type' print sql_string, 'string' - self.__path = dbpath # To be used later to backup the database. + self.__path = dbpath # To be used later to backup the database. self.__type = db_type def add_data(self, table=None): @@ -100,7 +101,7 @@ def add_data(self, table=None): except e.IntegrityError as error: self.__session.rollback() print error - raise Exception('\nDuplicate entries found \n looks like some {} tables have already been loaded' + raise Exception('\n Duplicate entries found \n looks like some {} tables have already been loaded' .format(table)) except e and Exception as error: @@ -138,6 +139,7 @@ def close_db(self): self.__session.close() self.__session.bind.dispose() self.__session = None + def getType(self): return self.__type @@ -151,7 +153,7 @@ def backup_db(self): self.__backupName = dst print 'Backing Up the DB\nsrc:{}\ndst:{}'.format(src, dst) copyfile(src, dst) - + def restore_db(self): """ used to restore the database after the user cancels data loading. @@ -167,11 +169,13 @@ def restore_db(self): copyfile(src, dst) self.__session = SqlAlchemy.connect(dst, self.__type) + class Parse_Excel_File(object): ''' this class is used to parse the excel workbook ''' + def __init__(self, obj): self.filename = None self.__workbook = obj diff --git a/src_1.0/controller/Hydra_importer.py b/src/controller/Hydra_importer.py similarity index 100% rename from src_1.0/controller/Hydra_importer.py rename to src/controller/Hydra_importer.py diff --git a/src_1.0/controller/Logic_loadingDataStructure b/src/controller/Logic_loadingDataStructure similarity index 100% rename from src_1.0/controller/Logic_loadingDataStructure rename to src/controller/Logic_loadingDataStructure diff --git a/src_1.0/controller/Logic_loadingMetadata b/src/controller/Logic_loadingMetadata similarity index 100% rename from src_1.0/controller/Logic_loadingMetadata rename to src/controller/Logic_loadingMetadata diff --git a/src_1.0/controller/Logic_loadingNetworks.md b/src/controller/Logic_loadingNetworks.md similarity index 100% rename from src_1.0/controller/Logic_loadingNetworks.md rename to src/controller/Logic_loadingNetworks.md diff --git a/src_1.0/controller/README b/src/controller/README similarity index 100% rename from src_1.0/controller/README rename to src/controller/README diff --git a/src_1.0/src_1.0_MacOS_test/controller/RWISE_importer.py b/src/controller/RWISE_importer.py similarity index 92% rename from src_1.0/src_1.0_MacOS_test/controller/RWISE_importer.py rename to src/controller/RWISE_importer.py index 0f7dcd9..cb831d0 100644 --- a/src_1.0/src_1.0_MacOS_test/controller/RWISE_importer.py +++ b/src/controller/RWISE_importer.py @@ -139,30 +139,30 @@ def load_data(self, xml_string): self.setup.push_data(methods) self.setup.add_data() - # ** loading Datasets ** # - recordCountResult = self.__session.execute('SELECT COUNT(*) FROM Datasets;') - datasetID = 0 + # ** loading ResourceTypes ** # + recordCountResult = self.__session.execute('SELECT COUNT(*) FROM ResourceTypes;') + resourceTypeID = 0 for n in recordCountResult: - datasetID = int(n[0]) - datasetID += 1 + resourceTypeID = int(n[0]) + resourceTypeID += 1 - dataset_name = "Reclamation's Water Information System (RWIS)" + resource_type = "Reclamation's Water Information System (RWIS)" - # Check whether same name exist in Datasets table + # Check whether same name exist in ResourceTypes table exsting = None try: - exsting = self.__session.query(SqlAlchemy.Datasets).filter( - SqlAlchemy.Datasets.DatasetName == dataset_name).first().DatasetID + exsting = self.__session.query(SqlAlchemy.ResourceTypes).filter( + SqlAlchemy.ResourceTypes.ResourceType == resource_type).first().ResourceTypeID except: pass if exsting is None: - datasets = SqlAlchemy.Datasets() - datasets.DatasetID = datasetID - datasets.DatasetName = dataset_name - datasets.DatasetAcronym = "RWISE" - datasets.SourceID = sourceID - datasets.Description = '' - self.setup.push_data(datasets) + resourceTypes = SqlAlchemy.ResourceTypes() + resourceTypes.ResourceTypeID = resourceTypeID + resourceTypes.ResourceType = resource_type + resourceTypes.ResourceTypeAcronym = "RWISE" + resourceTypes.MethodID = methodID + resourceTypes.Description = '' + self.setup.push_data(resourceTypes) self.setup.add_data() # ** loading object types data ** # @@ -186,8 +186,8 @@ def load_data(self, xml_string): objectTypes.ObjectTypeID = objectTypeID objectTypes.ObjectType = objecttype objectTypes.ObjectTypologyCV = "Network" - objectTypes.DatasetID = datasetID - objectTypes.icon = None + objectTypes.ResourceTypeID = resourceTypeID + objectTypes.Layout = None objectTypes.Description = '' objectTypes.ObjectCategoryID = None self.setup.push_data(objectTypes) @@ -220,8 +220,8 @@ def load_data(self, xml_string): objectTypes.ObjectType = objecttype objectTypes.ObjectTypeCV = 'Reservoir' objectTypes.ObjectTypologyCV = "Node" - objectTypes.DatasetID = datasetID - objectTypes.icon = None + objectTypes.ResourceTypeID = resourceTypeID + objectTypes.Layout = None objectTypes.Description = '' objectTypes.ObjectCategoryID = None self.setup.push_data(objectTypes) @@ -325,7 +325,7 @@ def load_data(self, xml_string): try: print 'it is starting here' dummy_map, attrib = LoadingUtils.load_mapping([dummy_id, instance_id, source_name, - method_name, dummy_dataval.DataValuesMapperID], + method_name, dummy_dataval.ValuesMapperID], self.__session) print 'it is ending here' except Exception as e: @@ -397,7 +397,7 @@ def load_data(self, xml_string): self.setup.push_data(dummy_dataval) dummy_map, attrib = LoadingUtils.load_mapping([dummy_id, instanceID, source_name, - method_name, dummy_dataval.DataValuesMapperID], + method_name, dummy_dataval.ValuesMapperID], self.__session) self.setup.push_data(dummy_map) @@ -490,14 +490,14 @@ def load_data(self, xml_string): self.setup.push_data(attributes) self.setup.add_data() - # ** Add data for DataValuesMapper ** # - dataValuesMapper = SqlAlchemy.DataValuesMapper() + # ** Add data for ValuesMapper ** # + dataValuesMapper = SqlAlchemy.ValuesMapper() try: - dataValuesMapper.DataValuesMapperID = int(self.__session.query(SqlAlchemy.DataValuesMapper).order_by( - SqlAlchemy.DataValuesMapper.DataValuesMapperID.desc()).first().DataValuesMapperID) - dataValuesMapper.DataValuesMapperID += 1 + dataValuesMapper.ValuesMapperID = int(self.__session.query(SqlAlchemy.ValuesMapper).order_by( + SqlAlchemy.ValuesMapper.ValuesMapperID.desc()).first().ValuesMapperID) + dataValuesMapper.ValuesMapperID += 1 except: - dataValuesMapper.DataValuesMapperID = 1 + dataValuesMapper.ValuesMapperID = 1 self.setup.push_data(dataValuesMapper) # ** Add data for Mapping ** # @@ -513,7 +513,7 @@ def load_data(self, xml_string): dataval_map.InstanceID = instance_id dataval_map.SourceID = source_id dataval_map.MethodID = method_id - dataval_map.DataValuesMapperID = dataValuesMapper.DataValuesMapperID + dataval_map.ValuesMapperID = dataValuesMapper.ValuesMapperID self.setup.push_data(dataval_map) # ** Add data for ScenarioMapping ** # @@ -537,7 +537,7 @@ def load_data(self, xml_string): SqlAlchemy.Mappings.InstanceID == instance_id, SqlAlchemy.Mappings.SourceID == source_id, SqlAlchemy.Mappings.MethodID == method_id, - SqlAlchemy.Mappings.DataValuesMapperID == dataValuesMapper.DataValuesMapperID + SqlAlchemy.Mappings.ValuesMapperID == dataValuesMapper.ValuesMapperID ) ).first().MappingID @@ -564,7 +564,7 @@ def load_data(self, xml_string): timeSeries.IsRegular = None timeSeries.NoDataValue = '' timeSeries.Description = '' - timeSeries.DataValuesMapperID = dataValuesMapper.DataValuesMapperID + timeSeries.ValuesMapperID = dataValuesMapper.ValuesMapperID self.setup.push_data(timeSeries) @@ -601,6 +601,6 @@ def load_data(self, xml_string): if value is not None or value != '': timeSeriesValues.TimeSeriesID = timeseriesID timeSeriesValues.DateTimeStamp = datetime.strptime(date, '%Y-%m-%d %H:%M:%S') - timeSeriesValues.Value = value + timeSeriesValues.DataValue = value self.setup.push_data(timeSeriesValues) self.setup.add_data() diff --git a/src_1.0/src_1.0_MacOS_test/controller/ReadWorkbook_SheetsNames.py b/src/controller/ReadWorkbook_SheetsNames.py similarity index 93% rename from src_1.0/src_1.0_MacOS_test/controller/ReadWorkbook_SheetsNames.py rename to src/controller/ReadWorkbook_SheetsNames.py index dd76394..9fedc6c 100644 --- a/src_1.0/src_1.0_MacOS_test/controller/ReadWorkbook_SheetsNames.py +++ b/src/controller/ReadWorkbook_SheetsNames.py @@ -20,7 +20,6 @@ "aggregationstatistic": CV_AggregationStatistic, "attributedatatype": CV_AttributeDataType, "attributename": CV_AttributeName, - "dualvaluemeaning": CV_DualValueMeaning, "electronicfileformat": CV_ElectronicFileFormat, "instancename": CV_InstanceName, "methodtype": CV_MethodType, @@ -39,7 +38,7 @@ # Sheet Names for loading structure data in order of dependency (structure) -struct_sheets_ordered = ['ObjectCategory', 'AttributeCategory', '2.1_Datasets&ObjectTypes', +struct_sheets_ordered = ['ObjectCategory', 'AttributeCategory', '2.1_ResourceTypes&ObjectTypes', '2.2_Attributes'] @@ -49,6 +48,6 @@ # Sheet Names for step 4 loading in order (Datavalues) datavalues_sheets_ordered = ['4_NumericValues', '4_SeasonalNumericValues', '4_TimeSeries', - '4_DescriptorValues', '4_TimeSeriesValues', '4_DualValues', '4_ElectronicFiles', '4_MultiAttributeSeries'] + '4_DescriptorValues', '4_TimeSeriesValues', '4_ElectronicFiles', '4_MultiAttributeSeries'] row_start_data_values = {'4_MultiAttributeSeries': 14} diff --git a/src_1.0/controller/WaDE_importer.py b/src/controller/WaDE_importer.py similarity index 100% rename from src_1.0/controller/WaDE_importer.py rename to src/controller/WaDE_importer.py diff --git a/src_1.0/controller/__init__.py b/src/controller/__init__.py similarity index 100% rename from src_1.0/controller/__init__.py rename to src/controller/__init__.py diff --git a/src_1.0/controller/seasonalData_shaper.py b/src/controller/seasonalData_shaper.py similarity index 100% rename from src_1.0/controller/seasonalData_shaper.py rename to src/controller/seasonalData_shaper.py diff --git a/src/controller/shapefileExporter.py b/src/controller/shapefileExporter.py new file mode 100644 index 0000000..1c6e8b1 --- /dev/null +++ b/src/controller/shapefileExporter.py @@ -0,0 +1,131 @@ + + +""" + The shapefileExporter.py is a python script use to reshape + a shapefile data and write the output result in the appropriate + excel sheets for WaMDaM template. it is made up of: + + - shapefileExporter(): This is the function which shapes the excel file + by looking for distinct attribute types and doing a cross + multiplication with the file properties and the attributes + values using the corresponding object code. + Warning: if format of file changes, script will fail to work + + - write_data(): This is a helper function used in accomplishing shapefileExporter() + all it does is write the data to the appropriate sheets +""" + +# The xlrd library is used for only reading data in excel files. its is quite fast at that +import xlrd as excel + +# This library is used here to write data to an excel file +from openpyxl import load_workbook + + + +class shapefileExporter(): + """ + This class gets data from an xml file given by the user + and stores in the Wamdam database + """ + + def __init__(self): + pass + # self.shapefileExporter(workbook) + + + def shapefileExporter(self, workbook, input_sheet='Shapefile_input'): + """ + This function parses the input file for shapefileExporter and get all required + matrices and control data. the user must make sure that the excel file + has sheetnames ('DualValues', 'NumericValues' and 'DescriptorValues') + :param workbook: holds the excel file + :param input_sheet: holds the input sheet + :return: None + """ + book = excel.open_workbook(workbook) + try: + sheet = book.sheet_by_name(input_sheet) + except: + raise Exception('Input sheet {} not found in the provided Excel file \n Please select valid excel file'.format(input_sheet)) + + rows = [rows for rows in sheet.get_rows()] + + + sources = [cell for cell in rows[1][3:]] + + methods = [cell for cell in rows[3][3:]] + + attributes = [str(cell.value) for cell in rows[5][3:]] + + attrib_code = [cell for cell in rows[7][3:]] + + left_data = [row[0:3] for row in rows[8:]] + + + right_data = [row[3:] for row in rows[8:]] + + book2 = load_workbook(workbook) + + max_row = [9, 9, 9, 9] + try: + for ida, attrib in enumerate(attributes): + + if attrib == 'DualValues': + # write_data('4_DualValues', book2, ida, attrib_code, sources, methods, left_data, right_data, max_row[1]) + max_row[1] = self.write_data('4_DualValues', book2, ida, attrib_code, sources, methods, left_data, right_data, max_row[1] + 1) + + elif attrib == 'NumericValues': + # write_data('4_NumericValues', book2, ida, attrib_code, sources, methods, left_data, right_data, max_row[2]) + max_row[2] = self.write_data('4_NumericValues', book2, ida, attrib_code, sources, methods, left_data, right_data, max_row[2] + 1) + + elif attrib == 'DescriptorValues': + # write_data('4_DescriptorValues', book2, ida, attrib_code, sources, methods, left_data, right_data, max_row[3]) + max_row[3] = self.write_data('4_DescriptorValues', book2, ida, attrib_code, sources, methods, left_data, right_data, max_row[3] + 1) + except Exception as e: + raise Exception(e.message) + + + book2.save(workbook) + + def write_data(self, sheet_name, workbook, ida, attrib_code, sources, methods, left_data, right_data, max_row): + """ + This is a helper function for shapefileExporter to write data in + the appropriate excel sheet. + :param sheet_name: Sheet name sent from shapefileExporter() function + :param workbook: The excel workbook in question + :param ida: Attribute index (integer) + :param attrib_code: Attribute code (eg 'DAM_ID_DamUtah') + :param left_data: utahDams properties + :param right_data: Attribute values + :return: + """ + try: + sheet = workbook.get_sheet_by_name(sheet_name) + except: + raise Exception( + 'Output sheet {} not found in Excel File\nPlease select a valid excel file'.format(sheet_name)) + temp = list() + for idd, data in enumerate(left_data): + content = data[:] + content.append(attrib_code[ida]) + content.append(sources[ida]) + content.append(methods[ida]) + content += [right_data[idd][ida]] + temp.append(content) + + # writing parsing result to appropriate excel sheet + + for rowID, row in enumerate(temp): + for colID, cell in enumerate(row): + try: + sheet.cell(row=rowID + max_row, column=colID + 1, value=unicode(cell.value)) + except Exception as e: + if e.args[0] == 'ascii': + # raise Exception(e) + raise Exception("There is word '" + e.args[ + 1] + "' that is not a unicode type in the sheet. Please fix the word.") + raise Exception(e) + return rowID + max_row + + diff --git a/src_1.0/controller/stp0_loadCVs.py b/src/controller/stp0_loadCVs.py similarity index 100% rename from src_1.0/controller/stp0_loadCVs.py rename to src/controller/stp0_loadCVs.py diff --git a/src_1.0/controller/stp1_loadMetadata.py b/src/controller/stp1_loadMetadata.py similarity index 100% rename from src_1.0/controller/stp1_loadMetadata.py rename to src/controller/stp1_loadMetadata.py diff --git a/src_1.0/src_1.0_MacOS_test/controller/stp2_loadDataStructure.py b/src/controller/stp2_loadDataStructure.py similarity index 84% rename from src_1.0/src_1.0_MacOS_test/controller/stp2_loadDataStructure.py rename to src/controller/stp2_loadDataStructure.py index 630c34e..d5ca954 100644 --- a/src_1.0/src_1.0_MacOS_test/controller/stp2_loadDataStructure.py +++ b/src/controller/stp2_loadDataStructure.py @@ -63,7 +63,7 @@ def __init__(self, filename): def create_dummy_attrib(self, dum_attrib): """ This method creates dummy record in the attribute table when loading - datasets and objecttypes. Also contributes in creating links in the + ResourceTypes and objecttypes. Also contributes in creating links in the database :param dum_attrib: Dummy attribute name :return: An instance of the Attributes() table @@ -78,7 +78,7 @@ def create_dummy_attrib(self, dum_attrib): dummy_attrib.UnitName = 'Dimensionless' else: - dummy_attrib.AttributeName = 'DatasetAcronym' + dummy_attrib.AttributeName = 'ResourceTypeAcronym' dummy_attrib.ObjectTypeID = dum_attrib[0] @@ -111,7 +111,7 @@ def load_data(self, sheet_names): the appropriate table is initialized and the table fields are loaded using data from the corresponding sheet. Some dummy Data (objecttypes and attributes) are also loaded - accordingly when loading datasets and objecttypes. + accordingly when loading ResourceTypes and objecttypes. :param sheet_names: :return: None """ @@ -159,7 +159,7 @@ def load_data(self, sheet_names): if sheet_name == sheet_names[2]: temp_row = [cell.value for cell in row] - if 'Datasets_table' in temp_row: + if 'ResourceTypes_table' in temp_row: cur_table = sheet_rows[row_id + 4:] temp_org = cur_table[:] for row_id, row in enumerate(cur_table): @@ -167,58 +167,58 @@ def load_data(self, sheet_names): row_id = row_id + static_rownum if all('' == cell.value for cell in row): break - data_struct = SqlAlchemy.Datasets() + data_struct = SqlAlchemy.ResourceTypes() if row[0].value == "": - raise Exception('Error in {} row of "Datasets_table" of sheet "{}"\nField named "DatasetName" is empty.\nThis field should not be empty.\nPlease fill this field to a value\n\n' + raise Exception('Error in {} row of "ResourceTypes_table" of sheet "{}"\nField named "ResourceType" is empty.\nThis field should not be empty.\nPlease fill this field to a value\n\n' .format(row_id, sheet_names[2])) if row[1].value == "": - raise Exception('Error in {} row of "Datasets_table" of sheet "{}"\nField named "DatasetAcronym" is empty.\nThis field should not be empty.\nPlease fill this field to a value\n\n' + raise Exception('Error in {} row of "ResourceTypes_table" of sheet "{}"\nField named "ResourceTypeAcronym" is empty.\nThis field should not be empty.\nPlease fill this field to a value\n\n' .format(row_id, sheet_names[2])) if row[2].value == "": - raise Exception('Error in {} row of "Datasets_table" of sheet "{}"\nField named "SourceName" is empty.\nThis field should not be empty.\nPlease fill this field to a value\n\n' + raise Exception('Error in {} row of "ResourceTypes_table" of sheet "{}"\nField named "MethodName" is empty.\nThis field should not be empty.\nPlease fill this field to a value\n\n' .format(row_id, sheet_names[2])) if not row[0].value: - raise Exception('Error in "Datasets_table" of sheet "{}"\nField named "DatasetName" is empty.\nThis field should not be empty.\nPlease fill this field to a value\n\n' + raise Exception('Error in "ResourceTypes_table" of sheet "{}"\nField named "ResourceType" is empty.\nThis field should not be empty.\nPlease fill this field to a value\n\n' .format(sheet_names[2])) - # raise Exception('Empty Field found in DatasetName Column in Dataset table') + # raise Exception('Empty Field found in ResourceType Column in ResourceTypes table') existname = None try: - existname = self.__session.query(SqlAlchemy.Datasets).filter( - SqlAlchemy.Datasets.DatasetName == row[0].value - ).first().DatasetAcronym + existname = self.__session.query(SqlAlchemy.ResourceTypes).filter( + SqlAlchemy.ResourceTypes.ResourceType == row[0].value + ).first().ResourceTypeAcronym self.datasetAcronym = existname define.datasetName = existname except: existname = None if existname == None: - data_struct.DatasetName = row[0].value + data_struct.ResourceType = row[0].value if row[1].value: - data_struct.DatasetAcronym = row[1].value + data_struct.ResourceTypeAcronym = row[1].value self.datasetAcronym = row[1].value define.datasetName = row[1].value else: - raise Exception('Error in "Datasets_table" of sheet "{}"\nField named "DatasetAcronym" is empty.\nThis field should not be empty.\nPlease fill this field to a value\n\n' + raise Exception('Error in "ResourceTypes_table" of sheet "{}"\nField named "ResourceTypeAcronym" is empty.\nThis field should not be empty.\nPlease fill this field to a value\n\n' .format(sheet_names[2])) - # raise Exception('Empty Fields found in DatasetAcronym Column in Dataset table') + # raise Exception('Empty Fields found in ResourceTypeAcronym Column in ResourceTypes table') try: - data_struct.SourceID = self.__session.query(SqlAlchemy.Sources).filter( - SqlAlchemy.Sources.SourceName == row[2].value - ).first().SourceID + data_struct.MethodID = self.__session.query(SqlAlchemy.Methods).filter( + SqlAlchemy.Methods.MethodName == row[2].value + ).first().MethodID except Exception as e: print e - raise Exception('Error in sheet {}\ncould not find {} in Sources\n\n' + raise Exception('Error in sheet {}\ncould not find {} in Methods\n\n' .format(sheet_names[2], row[2].value)) data_struct.Description = row[3].value self.setup.push_data(data_struct) - # Storing DatasetAcronym in Dict. + # Storing ResourceTypeAcronym in Dict. if not row[1].value in dataset_acronyms: dataset_acronyms.append(row[1].value) @@ -242,7 +242,7 @@ def load_data(self, sheet_names): .format(row_id, sheet_names[2], row[0].value)) # Raise an error if the user leaves the required field "DatasetAcronym" empty if row[2].value == '': - raise Exception('Error in {} row of "ObjectTypes_table" of sheet {}\n"DatasetAcronym" field which "ObjectType" is {} is empty.\nThis field should not be empty.\nPlease fill this field to a value\n\n' + raise Exception('Error in {} row of "ObjectTypes_table" of sheet {}\n"ResourceTypeAcronym" field which "ObjectType" is {} is empty.\nThis field should not be empty.\nPlease fill this field to a value\n\n' .format(row_id, sheet_names[2],row[0].value)) obj_type.ObjectType = row[0].value @@ -250,12 +250,12 @@ def load_data(self, sheet_names): try: if row[2].value: - obj_type.DatasetID = self.__session.query(SqlAlchemy.Datasets).filter( - SqlAlchemy.Datasets.DatasetAcronym == row[2].value - ).first().DatasetID + obj_type.ResourceTypeID = self.__session.query(SqlAlchemy.ResourceTypes).filter( + SqlAlchemy.ResourceTypes.ResourceTypeAcronym == row[2].value + ).first().ResourceTypeID except Exception as e: print e - raise Exception('Error in sheet {}\ncould not find {} in Datasets\n\n' + raise Exception('Error in sheet {}\ncould not find {} in ResourceTypes\n\n' .format(sheet_names[2], row[2].value)) try: @@ -268,18 +268,21 @@ def load_data(self, sheet_names): raise Exception('Error in sheet {}\ncould not find {} in ObjectTypeCV\n\n' .format(sheet_names[2], row[3].value)) + obj_type.Layout = row[4].value + + try: - if row[6].value: + if row[5].value: obj_type.ObjectCategoryID = self.__session.query(SqlAlchemy.ObjectCategories).filter( - SqlAlchemy.ObjectCategories.ObjectCategoryName == row[6].value + SqlAlchemy.ObjectCategories.ObjectCategoryName == row[5].value ).first().ObjectCategoryID except Exception as e: print e raise Exception('Error in sheet {}\ncould not find {} in ObjectCategory\n\n' - .format(sheet_names[2], row[6].value)) + .format(sheet_names[2], row[5].value)) - if row[7]: - obj_type.Description = row[7].value + if row[6]: + obj_type.Description = row[6].value self.setup.push_data(obj_type) # Creating dummy attributes for corresponding object type @@ -291,18 +294,7 @@ def load_data(self, sheet_names): "ObjectType"]) self.setup.push_data(obj) - # Code fragment to create dummy attributes when dataset is loaded. [[delete this stuff??]] - - # for dataAcronym in dataset_acronyms: - # object_id = self.__session.query(sq.ObjectTypes).filter( - # sq.ObjectTypes.ObjectType == dataAcronym - # ).first().ObjectTypeID - # obj = self.create_dummy_attrib([int(object_id), 'The purpose of this Attribute is ' - # 'to connect and help query a ' - # 'scenario and network for a ' - # 'dataset.']) - # self.push_data(obj) - # self.add_data() + break if sheet_name == sheet_names[3]: @@ -339,13 +331,13 @@ def load_data(self, sheet_names): try: if row[0]: try: - DatasetID = self.__session.query(SqlAlchemy.Datasets).filter( - SqlAlchemy.Datasets.DatasetAcronym == self.datasetAcronym - ).first().DatasetID + ResourceTypeID = self.__session.query(SqlAlchemy.ResourceTypes).filter( + SqlAlchemy.ResourceTypes.ResourceTypeAcronym == self.datasetAcronym + ).first().ResourceTypeID attrib.ObjectTypeID = self.__session.query(SqlAlchemy.ObjectTypes).filter( and_( SqlAlchemy.ObjectTypes.ObjectType == row[0].value, - SqlAlchemy.ObjectTypes.DatasetID == DatasetID + SqlAlchemy.ObjectTypes.ResourceTypeID == ResourceTypeID ) ).first().ObjectTypeID except Exception as e: @@ -407,10 +399,10 @@ def load_data(self, sheet_names): except Exception as e: print e raise Exception('Error in sheet {}\ncould not find {} in AttributeCategory\n\n' - .format(sheet_names[3], row[5].value)) + .format(sheet_names[3], row[6].value)) - attrib.ModelInputOrOutput = row[6].value - attrib.AttributeDescription = row[7].value + attrib.ModelInputOrOutput = row[7].value + attrib.AttributeDescription = row[8].value self.setup.push_data(attrib) break def add_data(self): diff --git a/src_1.0/src_1.0_MacOS_test/controller/stp3_loadNetworks.py b/src/controller/stp3_loadNetworks.py similarity index 96% rename from src_1.0/src_1.0_MacOS_test/controller/stp3_loadNetworks.py rename to src/controller/stp3_loadNetworks.py index 1362358..ec87d63 100644 --- a/src_1.0/src_1.0_MacOS_test/controller/stp3_loadNetworks.py +++ b/src/controller/stp3_loadNetworks.py @@ -154,19 +154,19 @@ def load_scenario_mappings(self, params): def load_data_values(self): """ This is a helper method to create an instance of the - DataValuesMapper table. it queries the table to get the + valuesmapper table. it queries the table to get the most recent datavaluemapperid. If query returns None, the Databaluesmapperid is set to None else, one is added to the - highest Datavaluesmapper. - :return: An instance of DataValuesMapper with filled fields + highest valuesmapper. + :return: An instance of valuesmapper with filled fields """ - dummy_dataval = SqlAlchemy.DataValuesMapper() + dummy_dataval = SqlAlchemy.ValuesMapper() try: - dummy_dataval.DataValuesMapperID = int(self.__session.query(SqlAlchemy.DataValuesMapper).order_by( - SqlAlchemy.DataValuesMapper.DataValuesMapperID.desc()).first().DataValuesMapperID) - dummy_dataval.DataValuesMapperID += 1 + dummy_dataval.ValuesMapperID = int(self.__session.query(SqlAlchemy.ValuesMapper).order_by( + SqlAlchemy.ValuesMapper.ValuesMapperID.desc()).first().ValuesMapperID) + dummy_dataval.ValuesMapperID += 1 except: - dummy_dataval.DataValuesMapperID = 1 + dummy_dataval.ValuesMapperID = 1 return dummy_dataval def load_mappings(self, params): @@ -203,7 +203,7 @@ def load_mappings(self, params): # raise exception with Methods table and value if there is no params[3] valuye in the Methods table. msg = "Methods|{}".format(params[3]) raise Exception(msg) - dummy_map.DataValuesMapperID = params[4] + dummy_map.ValuesMapperID = params[4] # except Exception as e: # print e # raise Exception('Object Type: ' + str(params[0]) @@ -273,7 +273,7 @@ def load_data(self): raise Exception('Error in {} row of "MasterNetworks_table" of sheet "{}"\nField named "MasterNetworkName" is empty. This field should not be empty.\nPlease fill this field to a value' .format(row_id, Network_sheets_ordered[1])) if row[1].value == "": - raise Exception('Error in {} row of "MasterNetworks_table" of sheet "{}"\nField named "DatasetAcronym" is empty. This field should not be empty.\nPlease fill this field to a value' + raise Exception('Error in {} row of "MasterNetworks_table" of sheet "{}"\nField named "ResourceTypeAcronym" is empty. This field should not be empty.\nPlease fill this field to a value' .format(row_id, Network_sheets_ordered[1])) if row[2].value == "": raise Exception('Error in {} row of "MasterNetworks_table" of sheet "{}"\nField named "SpatialReferenceNameCV" is empty. This field should not be empty.\nPlease fill this field to a value' @@ -309,16 +309,16 @@ def load_data(self): data_struct_acronym[Master_Networks.MasterNetworkName] = row[1].value self.setup.push_data(Master_Networks) - # adding dummy instance for each Master Network Loaded + # adding dummy instance for each scenario loaded dummy_instance = SqlAlchemy.Instances() dummy_instance.InstanceName = row[0].value dummy_instance.InstanceNameCV = None dummy_instance.Longitude_x = None dummy_instance.Latitude_y = None dummy_instance.Description = "Dummy instance to help connect scenarios and networks with " \ - "their Dataset through the ObjectTypeInstancesAttribute and " \ - "'DatasetAcronym' ObjectType.\nIt is also used in referencing "\ - "the Global Attributes of each model or dataset" + "their ResourceType through the ObjectTypeInstancesAttribute and " \ + "'ResourceTypeAcronym' ObjectType.\nIt is also used in referencing "\ + "the Global Attributes of each ResourceType" dummy_instance.InstanceCategoryID = None self.setup.push_data(dummy_instance) @@ -393,7 +393,7 @@ def load_data(self): try: dummy_map, attrib = self.load_mappings([dummy_id, instance_id, row[2].value, - row[3].value, dummy_dataval.DataValuesMapperID]) + row[3].value, dummy_dataval.ValuesMapperID]) except Exception as e: msg = e.message if msg[:8] == "Methods|": @@ -513,15 +513,15 @@ def load_data(self): # load Mappings of node instance try: # ////////////// dataset name and object type name join in object type table/////////// - DatasetID = self.__session.query(SqlAlchemy.Datasets).filter( - SqlAlchemy.Datasets.DatasetAcronym == define.datasetName - ).first().DatasetID + ResourceTypeID = self.__session.query(SqlAlchemy.ResourceTypes).filter( + SqlAlchemy.ResourceTypes.ResourceTypeAcronym == define.datasetName + ).first().ResourceTypeID obj = self.__session.query(SqlAlchemy.ObjectTypes).filter( and_( SqlAlchemy.ObjectTypes.ObjectType == row[0].value, - SqlAlchemy.ObjectTypes.DatasetID == DatasetID + SqlAlchemy.ObjectTypes.ResourceTypeID == ResourceTypeID ) ).first().ObjectTypeID except Exception as e: @@ -530,10 +530,10 @@ def load_data(self): try: if node_test: dummy_map, attrib = self.load_mappings([obj, node_test, row[4].value, - row[5].value, dummy_dataval.DataValuesMapperID]) + row[5].value, dummy_dataval.ValuesMapperID]) else: dummy_map, attrib = self.load_mappings([obj, nodes.InstanceID, row[4].value, - row[5].value, dummy_dataval.DataValuesMapperID]) + row[5].value, dummy_dataval.ValuesMapperID]) except Exception as e: # Get exception from load_mappings method msg = e.message @@ -703,10 +703,10 @@ def load_data(self): # raise Exception(e.message) if link_test: dummy_map, attrib = self.load_mappings([obj, link_test, row[4].value, - row[5].value, dummy_dataval.DataValuesMapperID]) + row[5].value, dummy_dataval.ValuesMapperID]) else: dummy_map, attrib = self.load_mappings([obj, links.InstanceID, row[4].value, - row[5].value, dummy_dataval.DataValuesMapperID]) + row[5].value, dummy_dataval.ValuesMapperID]) test_same_links = None diff --git a/src_1.0/controller/stp4_loadDataValue/Logic_loadingDataValues.md b/src/controller/stp4_loadDataValue/Logic_loadingDataValues.md similarity index 100% rename from src_1.0/controller/stp4_loadDataValue/Logic_loadingDataValues.md rename to src/controller/stp4_loadDataValue/Logic_loadingDataValues.md diff --git a/src_1.0/src_1.0_MacOS_test/controller/stp4_loadDataValue/MultiAttributeSeries.py b/src/controller/stp4_loadDataValue/MultiAttributeSeries.py similarity index 93% rename from src_1.0/src_1.0_MacOS_test/controller/stp4_loadDataValue/MultiAttributeSeries.py rename to src/controller/stp4_loadDataValue/MultiAttributeSeries.py index f476ab9..9dc85fd 100644 --- a/src_1.0/src_1.0_MacOS_test/controller/stp4_loadDataValue/MultiAttributeSeries.py +++ b/src/controller/stp4_loadDataValue/MultiAttributeSeries.py @@ -40,7 +40,7 @@ def __init__(self, filename): self.setup = DB_Setup() # self.__session = self.init() self.__session = self.setup.get_session() - self.work_sheet = self.parse_object_control_value([datavalues_sheets_ordered[7]]) + self.work_sheet = self.parse_object_control_value([datavalues_sheets_ordered[6]]) def load_data(self): """ @@ -227,7 +227,7 @@ def load_data(self): elif len(multi_map) > 1: multi_map = multi_map[-1] - main_data_val = multi_map.DataValuesMapperID + main_data_val = multi_map.ValuesMapperID except Exception as e: print e @@ -238,10 +238,10 @@ def load_data(self): multiarray_mapping.InstanceID = instance_id multiarray_mapping.SourceID = source_id multiarray_mapping.MethodID = method_id - multiarray_mapping.DataValuesMapperID = datavalmapper.DataValuesMapperID + multiarray_mapping.ValuesMapperID = datavalmapper.ValuesMapperID self.setup.push_data(datavalmapper) self.setup.push_data(multiarray_mapping) - main_data_val = datavalmapper.DataValuesMapperID + main_data_val = datavalmapper.ValuesMapperID # Loads Scenariomapping for the new loaded combination scenariomap = SqlAlchemy.ScenarioMappings() @@ -262,7 +262,7 @@ def load_data(self): SqlAlchemy.Mappings.InstanceID == instance_id, SqlAlchemy.Mappings.SourceID == source_id, SqlAlchemy.Mappings.MethodID == method_id, - SqlAlchemy.Mappings.DataValuesMapperID == main_data_val + SqlAlchemy.Mappings.ValuesMapperID == main_data_val ) ).first().MappingID @@ -310,7 +310,7 @@ def load_data(self): elif len(main_var_map) > 1: main_var_map = main_var_map[-1] - sub_data_val = main_var_map.DataValuesMapperID + sub_data_val = main_var_map.ValuesMapperID except Exception as e: datavalmapper = self.load_data_values(self.__session) multiarray_mapping = SqlAlchemy.Mappings() @@ -320,23 +320,23 @@ def load_data(self): multiarray_mapping.InstanceID = instance_id multiarray_mapping.SourceID = source_id multiarray_mapping.MethodID = method_id - multiarray_mapping.DataValuesMapperID = datavalmapper.DataValuesMapperID + multiarray_mapping.ValuesMapperID = datavalmapper.ValuesMapperID self.setup.push_data(multiarray_mapping) self.setup.push_data(datavalmapper) - sub_data_val = datavalmapper.DataValuesMapperID + sub_data_val = datavalmapper.ValuesMapperID # Loading MultiCulumnArrays for each new added mapping combination. try: self.__session.query(SqlAlchemy.MultiAttributeSeries).filter( and_( - SqlAlchemy.MultiAttributeSeries.AttributeNameID == sub_data_val, - SqlAlchemy.MultiAttributeSeries.DataValuesMapperID == main_data_val + SqlAlchemy.MultiAttributeSeries.MappingID_Attribute == sub_data_val, + SqlAlchemy.MultiAttributeSeries.ValuesMapperID == main_data_val ) ).first().MultiAttributeSeriesID except: multicolumn = SqlAlchemy.MultiAttributeSeries() - multicolumn.AttributeNameID = sub_data_val - multicolumn.DataValuesMapperID = main_data_val + multicolumn.MappingID_Attribute = sub_data_val + multicolumn.ValuesMapperID = main_data_val self.setup.push_data(multicolumn) # adding scenario for new sub attribute mapping combination. @@ -355,7 +355,7 @@ def load_data(self): SqlAlchemy.Mappings.InstanceID == instance_id, SqlAlchemy.Mappings.SourceID == source_id, SqlAlchemy.Mappings.MethodID == method_id, - SqlAlchemy.Mappings.DataValuesMapperID == sub_data_val + SqlAlchemy.Mappings.ValuesMapperID == sub_data_val ) ).first().MappingID @@ -388,15 +388,15 @@ def load_data(self): SqlAlchemy.Mappings.MethodID == method_id, SqlAlchemy.Mappings.InstanceID == instance_id ) - ).first().DataValuesMapperID + ).first().ValuesMapperID multiarray_id = self.__session.query(SqlAlchemy.MultiAttributeSeries).filter( - SqlAlchemy.MultiAttributeSeries.AttributeNameID == multiarray_attrib_id + SqlAlchemy.MultiAttributeSeries.MappingID_Attribute == multiarray_attrib_id ).first().MultiAttributeSeriesID multicolval = SqlAlchemy.MultiAttributeSeriesValues() multicolval.MultiAttributeSeriesID = multiarray_id - multicolval.Value = row[6 + row_id].value + multicolval.DataValue = row[6 + row_id].value # checks if next instance is same as previous, if yes, value order is increamented else # value order is reset to 1 @@ -424,7 +424,7 @@ def load_data(self): # loaded into the db else it is added. test = self.__session.query(SqlAlchemy.MultiAttributeSeriesValues).filter( and_( - SqlAlchemy.MultiAttributeSeriesValues.Value == multicolval.Value + SqlAlchemy.MultiAttributeSeriesValues.DataValue == multicolval.DataValue ) ).first().MultiAttributeSeriesValuesID except: @@ -464,10 +464,10 @@ def load_data(self): ).first().ScenarioMappingID found = True multi_map = mapping - main_data_val = Mappings.DataValuesMapperID + main_data_val = Mappings.ValuesMapperID except: pass - datavalue = multi_map.DataValuesMapperID + datavalue = multi_map.ValuesMapperID # loads mapping combination with main_attribute except Exception as e: @@ -478,10 +478,10 @@ def load_data(self): multiarray_mapping.InstanceID = instance_id multiarray_mapping.SourceID = source_id multiarray_mapping.MethodID = method_id - multiarray_mapping.DataValuesMapperID = datavalmapper.DataValuesMapperID + multiarray_mapping.ValuesMapperID = datavalmapper.ValuesMapperID self.setup.push_data(datavalmapper) self.setup.push_data(multiarray_mapping) - main_data_val = datavalmapper.DataValuesMapperID + main_data_val = datavalmapper.ValuesMapperID # this is to load scenariomapping for rows under different category. # gets mapping ID is mapping combination already existed else it gets the @@ -497,7 +497,7 @@ def load_data(self): SqlAlchemy.Mappings.InstanceID == instance_id, SqlAlchemy.Mappings.SourceID == source_id, SqlAlchemy.Mappings.MethodID == method_id, - SqlAlchemy.Mappings.DataValuesMapperID == main_data_val + SqlAlchemy.Mappings.ValuesMapperID == main_data_val ) ).first().MappingID @@ -522,14 +522,14 @@ def load_data(self): ).order_by(SqlAlchemy.ScenarioMappings.ScenarioMappingID).first().MappingID datavalmapper = self.load_data_values(self.__session) - main_data_val = datavalmapper.DataValuesMapperID + main_data_val = datavalmapper.ValuesMapperID multiarray_mapping .AttributeID = self.__session.query(SqlAlchemy.Attributes).filter( SqlAlchemy.Attributes.AttributeName == main_col.value ).first().AttributeID multiarray_mapping .InstanceID = instance_id multiarray_mapping .SourceID = source_id multiarray_mapping .MethodID = method_id - multiarray_mapping .DataValuesMapperID = datavalmapper.DataValuesMapperID + multiarray_mapping .ValuesMapperID = datavalmapper.ValuesMapperID self.setup.push_data(datavalmapper) self.setup.push_data(multiarray_mapping) @@ -539,7 +539,7 @@ def load_data(self): SqlAlchemy.Mappings.InstanceID == instance_id, SqlAlchemy.Mappings.SourceID == source_id, SqlAlchemy.Mappings.MethodID == method_id, - SqlAlchemy.Mappings.DataValuesMapperID == datavalmapper.DataValuesMapperID + SqlAlchemy.Mappings.ValuesMapperID == datavalmapper.ValuesMapperID ) ).first().MappingID self.setup.push_data(scenariomap) @@ -577,10 +577,10 @@ def load_data(self): ).first().ScenarioMappingID found = True main_var_map = mapping - sub_data_val = Mappings.DataValuesMapperID + sub_data_val = Mappings.ValuesMapperID except: pass - test = main_var_map.DataValuesMapperID + test = main_var_map.ValuesMapperID except Exception as e: datavalmapper = self.load_data_values(self.__session) multiarray_mapping = SqlAlchemy.Mappings() @@ -590,23 +590,23 @@ def load_data(self): multiarray_mapping .InstanceID = instance_id multiarray_mapping .SourceID = source_id multiarray_mapping .MethodID = method_id - multiarray_mapping .DataValuesMapperID = datavalmapper.DataValuesMapperID + multiarray_mapping .ValuesMapperID = datavalmapper.ValuesMapperID self.setup.push_data(multiarray_mapping) self.setup.push_data(datavalmapper) - sub_data_val = datavalmapper.DataValuesMapperID + sub_data_val = datavalmapper.ValuesMapperID # Loading MultiAttributeSeries try: self.__session.query(SqlAlchemy.MultiAttributeSeries).filter( and_( - SqlAlchemy.MultiAttributeSeries.AttributeNameID == sub_data_val, - SqlAlchemy.MultiAttributeSeries.DataValuesMapperID == main_data_val + SqlAlchemy.MultiAttributeSeries.MappingID_Attribute == sub_data_val, + SqlAlchemy.MultiAttributeSeries.ValuesMapperID == main_data_val ) ).first().MultiAttributeSeriesID except: multicolumn = SqlAlchemy.MultiAttributeSeries() - multicolumn.AttributeNameID = sub_data_val - multicolumn.DataValuesMapperID = main_data_val + multicolumn.MappingID_Attribute = sub_data_val + multicolumn.ValuesMapperID = main_data_val self.setup.push_data(multicolumn) scenariomap = SqlAlchemy.ScenarioMappings() @@ -623,7 +623,7 @@ def load_data(self): SqlAlchemy.Mappings.InstanceID == instance_id, SqlAlchemy.Mappings.SourceID == source_id, SqlAlchemy.Mappings.MethodID == method_id, - SqlAlchemy.Mappings.DataValuesMapperID == sub_data_val + SqlAlchemy.Mappings.ValuesMapperID == sub_data_val ) ).first().MappingID @@ -641,14 +641,14 @@ def load_data(self): ).order_by(SqlAlchemy.ScenarioMappings.ScenarioMappingID).first().MappingID datavalmapper = self.load_data_values(self.__session) - main_data_val = datavalmapper.DataValuesMapperID + main_data_val = datavalmapper.ValuesMapperID multiarray_mapping.AttributeID = self.__session.query(SqlAlchemy.Attributes).filter( SqlAlchemy.Attributes.AttributeName == main_col.value ).first().AttributeID multiarray_mapping.InstanceID = instance_id multiarray_mapping.SourceID = source_id multiarray_mapping.MethodID = method_id - multiarray_mapping.DataValuesMapperID = datavalmapper.DataValuesMapperID + multiarray_mapping.ValuesMapperID = datavalmapper.ValuesMapperID self.setup.push_data(datavalmapper) self.setup.push_data(multiarray_mapping) @@ -656,14 +656,14 @@ def load_data(self): try: self.__session.query(SqlAlchemy.MultiAttributeSeries).filter( and_( - SqlAlchemy.MultiAttributeSeries.AttributeNameID == sub_data_val, - SqlAlchemy.MultiAttributeSeries.DataValuesMapperID == main_data_val + SqlAlchemy.MultiAttributeSeries.MappingID_Attribute == sub_data_val, + SqlAlchemy.MultiAttributeSeries.ValuesMapperID == main_data_val ) ).first().MultiAttributeSeriesID except: multicolumn = SqlAlchemy.MultiAttributeSeries() - multicolumn.AttributeNameID = sub_data_val - multicolumn.DataValuesMapperID = main_data_val + multicolumn.MappingID_Attribute = sub_data_val + multicolumn.ValuesMapperID = main_data_val self.setup.push_data(multicolumn) scenariomap.MappingID = self.__session.query(SqlAlchemy.Mappings).filter( @@ -672,7 +672,7 @@ def load_data(self): SqlAlchemy.Mappings.InstanceID == instance_id, SqlAlchemy.Mappings.SourceID == source_id, SqlAlchemy.Mappings.MethodID == method_id, - SqlAlchemy.Mappings.DataValuesMapperID == datavalmapper.DataValuesMapperID + SqlAlchemy.Mappings.ValuesMapperID == datavalmapper.ValuesMapperID ) ).first().MappingID self.setup.push_data(scenariomap) @@ -706,17 +706,17 @@ def load_data(self): SqlAlchemy.ScenarioMappings.ScenarioID == scenario_id ) ).first().ScenarioMappingID - multiarray_attrib_id = Mappings.DataValuesMapperID + multiarray_attrib_id = Mappings.ValuesMapperID except: pass multiarray_id = self.__session.query(SqlAlchemy.MultiAttributeSeries).filter( - SqlAlchemy.MultiAttributeSeries.AttributeNameID == multiarray_attrib_id + SqlAlchemy.MultiAttributeSeries.MappingID_Attribute == multiarray_attrib_id ).first().MultiAttributeSeriesID multicolval = SqlAlchemy.MultiAttributeSeriesValues() multicolval.MultiAttributeSeriesID = multiarray_id - multicolval.Value = row[6 + row_id].value + multicolval.DataValue = row[6 + row_id].value # checks if next instance is same as previous, if yes, value order is increamented else # value order is reset to 1 diff --git a/src_1.0/src_1.0_MacOS_test/controller/stp4_loadDataValue/__init__.py b/src/controller/stp4_loadDataValue/__init__.py similarity index 91% rename from src_1.0/src_1.0_MacOS_test/controller/stp4_loadDataValue/__init__.py rename to src/controller/stp4_loadDataValue/__init__.py index edd27e3..057c23f 100644 --- a/src_1.0/src_1.0_MacOS_test/controller/stp4_loadDataValue/__init__.py +++ b/src/controller/stp4_loadDataValue/__init__.py @@ -1,5 +1,4 @@ from loadDescriptorValues import LoadDescriptorValues -from loadDualValues import LoadDualValues from loadElectronicFiles import LoadElectronicFiles from controller.stp4_loadDataValue.MultiAttributeSeries import LoadMultiCulumnArray from MultiAttributeSeries import LoadMultiCulumnArray diff --git a/src_1.0/controller/stp4_loadDataValue/helper.py b/src/controller/stp4_loadDataValue/helper.py similarity index 94% rename from src_1.0/controller/stp4_loadDataValue/helper.py rename to src/controller/stp4_loadDataValue/helper.py index fe147ef..ba68dfc 100644 --- a/src_1.0/controller/stp4_loadDataValue/helper.py +++ b/src/controller/stp4_loadDataValue/helper.py @@ -22,19 +22,19 @@ def __init__(self): def load_data_values(session): """ This is a method to create an instance of the - DataValuesMapper table. it queries the table to get the + ValuesMapper table. it queries the table to get the most recent datavaluemapperid. If query returns None, the Databaluesmapperid is set to None else 1 is added to the highest Datavaluesmapper. - :return: An instance of DataValuesMapper with filled fields + :return: An instance of ValuesMapper with filled fields """ - dummy_dataval = SqlAlchemy.DataValuesMapper() + dummy_dataval = SqlAlchemy.ValuesMapper() try: - dummy_dataval.DataValuesMapperID = int(session.query(SqlAlchemy.DataValuesMapper).order_by( - SqlAlchemy.DataValuesMapper.DataValuesMapperID.desc()).first().DataValuesMapperID) - dummy_dataval.DataValuesMapperID += 1 + dummy_dataval.ValuesMapperID = int(session.query(SqlAlchemy.ValuesMapper).order_by( + SqlAlchemy.ValuesMapper.ValuesMapperID.desc()).first().ValuesMapperID) + dummy_dataval.ValuesMapperID += 1 except: - dummy_dataval.DataValuesMapperID = 1 + dummy_dataval.ValuesMapperID = 1 return dummy_dataval @staticmethod @@ -54,7 +54,7 @@ def create_dummy_attrib(dum_attrib, session): dummy_attrib.ObjectTypeID = session.query(SqlAlchemy.ObjectTypes).order_by( SqlAlchemy.ObjectTypes.ObjectTypeID.desc()).first().ObjectTypeID else: - dummy_attrib.AttributeName = 'DatasetAcronym' + dummy_attrib.AttributeName = 'ResourceTypeAcronym' dummy_attrib.ObjectTypeID = dum_attrib[0] dummy_attrib.UnitName = 'Dimensionless' @@ -149,7 +149,7 @@ def load_mapping(params, session): # raise exception with Methods table and value if there is no params[3] value in the Methods table. msg = "Methods|{}".format(params[3]) raise Exception(msg) - dummy_map.DataValuesMapperID = params[4] + dummy_map.ValuesMapperID = params[4] try: test = session.query(SqlAlchemy.Mappings).filter( @@ -237,9 +237,9 @@ def get_ids(row, session, sheet_name, row_id): SqlAlchemy.Attributes.ObjectTypeID == session.query(SqlAlchemy.ObjectTypes).filter( and_( SqlAlchemy.ObjectTypes.ObjectType == row[0].value, - SqlAlchemy.ObjectTypes.DatasetID == session.query(SqlAlchemy.Datasets).filter( - SqlAlchemy.Datasets.DatasetAcronym == define.datasetName - ).first().DatasetID + SqlAlchemy.ObjectTypes.ResourceTypeID == session.query(SqlAlchemy.ResourceTypes).filter( + SqlAlchemy.ResourceTypes.ResourceTypeAcronym == define.datasetName + ).first().ResourceTypeID ) ).first().ObjectTypeID ) diff --git a/src_1.0/src_1.0_MacOS_test/controller/stp4_loadDataValue/loadDescriptorValues.py b/src/controller/stp4_loadDataValue/loadDescriptorValues.py similarity index 84% rename from src_1.0/src_1.0_MacOS_test/controller/stp4_loadDataValue/loadDescriptorValues.py rename to src/controller/stp4_loadDataValue/loadDescriptorValues.py index 20d266a..82a4cab 100644 --- a/src_1.0/src_1.0_MacOS_test/controller/stp4_loadDataValue/loadDescriptorValues.py +++ b/src/controller/stp4_loadDataValue/loadDescriptorValues.py @@ -65,6 +65,7 @@ def load_data(self): stored_rows = [temp_row[:-1]] scenario_name = temp[0][2] + descriptor_values = {} for row_id, row in enumerate(temp): if all('' == cell.value for cell in row): @@ -72,7 +73,7 @@ def load_data(self): if any('' == cell.value for cell in row[:-1]): continue - + # skip rows that dont have a provided value like in the case of a shapefile data with blank values if row[6].value is None or row[6].value == '' or row[6].value == ' ' or row[6].value == ' ': continue @@ -158,15 +159,15 @@ def load_data(self): SqlAlchemy.DescriptorValues.DescriptorValue == row[6].value ).all() - result = [datavaluemapper.DataValuesMapperID for datavaluemapper in datavalues_id] + result = [datavaluemapper.ValuesMapperID for datavaluemapper in datavalues_id] - # check for mapping with same datavaluesmapper as the data value. + # check for mapping with same ValuesMapper as the data value. # if found, reuse of mapping id is emminent. for mapping in datavalues: if found: break for each in result[:]: - if Mappings.DataValuesMapperID == each: + if Mappings.ValuesMapperID == each: datavalues = mapping found = True break @@ -189,37 +190,47 @@ def load_data(self): dataval_map.InstanceID = instance_id dataval_map.SourceID = source_id dataval_map.MethodID = method_id + if datavalues_id is None and not diff_scene: # check if a descriptor value already exists when creating a new Mappings. - # if both the DescriptorValue and the DescriptorValueCV together are identical, # then share them among "Instances" within the same "Scenario" and across "Scenarios". # If only the DescriptorValue is given, (no DescriptorValueCV with it in excel), then dont # worry about sharing among instances of the same scenario - if row[6].value == row[7].value: + + # if both the DescriptorValue and the DescriptorValueCV together exist, + if row[7].value : try: - datavalues_id = self.__session.query(SqlAlchemy.DescriptorValues).filter( - SqlAlchemy.DescriptorValues.descriptorvalueCV == self.__session.query( - SqlAlchemy.CV_DescriptorValues). - filter(SqlAlchemy.CV_DescriptorValues.Name == row[6].value). - first().Name - ).first().DataValuesMapperID value = True + + descriptorvalueCV = self.__session.query( + SqlAlchemy.CV_DescriptorValues).filter( + SqlAlchemy.CV_DescriptorValues.Name == row[7].value + ).first().Name + if not descriptorvalueCV: + raise Exception( + "'{}' attribute is not associated to {} in {} row of descriptor sheet ". + format(row[7].value, 'DescriptorValues_cv', str(row_id + 10))) + datavalues_id = self.__session.query(SqlAlchemy.DescriptorValues).filter( + SqlAlchemy.DescriptorValues.DescriptorValue == row[6].value and + SqlAlchemy.DescriptorValues.DescriptorvalueCV == descriptorvalueCV + ).first().ValuesMapperID + except: pass - # if there the row is a different row it creates new datavaluemapperID for the new block + if not datavalues_id: self.setup.push_data(datavalmapper) - datavalues_id = datavalmapper.DataValuesMapperID - dataval_map.DataValuesMapperID = datavalmapper.DataValuesMapperID + datavalues_id = datavalmapper.ValuesMapperID + dataval_map.ValuesMapperID = datavalmapper.ValuesMapperID else: - dataval_map.DataValuesMapperID = datavalues_id + dataval_map.ValuesMapperID = datavalues_id # If the row is not a different group, it reuses the previous datavalues elif not diff_scene: - dataval_map.DataValuesMapperID = datavalues_id + dataval_map.ValuesMapperID = datavalues_id self.setup.push_data(dataval_map) else: - datavalues_id = datavalues.DataValuesMapperID + datavalues_id = datavalues.ValuesMapperID # Creating new scenariomapping if scenarioID-mappingID does not exists. # Starts by searchine for the mappingID in case its just been created, then tests to see if a @@ -237,7 +248,7 @@ def load_data(self): SqlAlchemy.Mappings.InstanceID == instance_id, SqlAlchemy.Mappings.SourceID == source_id, SqlAlchemy.Mappings.MethodID == method_id, - SqlAlchemy.Mappings.DataValuesMapperID == datavalues_id + SqlAlchemy.Mappings.ValuesMapperID == datavalues_id ) ).first().MappingID @@ -254,16 +265,21 @@ def load_data(self): if row[6].value: # Add new entry to the database if the value is none(depicts similar scenario) and the value is not found - if not value: + if (not row[6].value in descriptor_values.keys()) or \ + (row[6].value in descriptor_values.keys() and not row[7].value in descriptor_values[row[6].value]): + if not row[6].value in descriptor_values.keys(): + descriptor_values[row[6].value] = [row[7].value] + else: + descriptor_values[row[6].value].append(row[7].value) try: - textcontrol.descriptorvalueCV = self.__session.query( + textcontrol.DescriptorvalueCV = self.__session.query( SqlAlchemy.CV_DescriptorValues).filter( SqlAlchemy.CV_DescriptorValues.Name == row[7].value ).first().Name except: pass - textcontrol.DataValuesMapperID = datavalues_id + textcontrol.ValuesMapperID = datavalues_id self.setup.push_data(textcontrol) value = False diff --git a/src_1.0/src_1.0_MacOS_test/controller/stp4_loadDataValue/loadElectronicFiles.py b/src/controller/stp4_loadDataValue/loadElectronicFiles.py similarity index 96% rename from src_1.0/src_1.0_MacOS_test/controller/stp4_loadDataValue/loadElectronicFiles.py rename to src/controller/stp4_loadDataValue/loadElectronicFiles.py index cd62272..0793109 100644 --- a/src_1.0/src_1.0_MacOS_test/controller/stp4_loadDataValue/loadElectronicFiles.py +++ b/src/controller/stp4_loadDataValue/loadElectronicFiles.py @@ -38,7 +38,7 @@ def __init__(self, filename): self.setup = DB_Setup() # self.__session = self.init() self.__session = self.setup.get_session() - self.work_sheet = self.parse_object_control_value([datavalues_sheets_ordered[6]]) + self.work_sheet = self.parse_object_control_value([datavalues_sheets_ordered[5]]) def load_data(self): """ @@ -145,7 +145,7 @@ def load_data(self): SqlAlchemy.CV_ElectronicFormat.Name == row[7].value ).first().Name ) - ).first().DataValuesMapperID + ).first().ValuesMapperID value = True except Exception as e: print e @@ -161,19 +161,19 @@ def load_data(self): if datavalues_id is None: self.setup.push_data(datavalmapper) - datavalues_id = datavalmapper.DataValuesMapperID - dataval_map.DataValuesMapperID = datavalmapper.DataValuesMapperID + datavalues_id = datavalmapper.ValuesMapperID + dataval_map.ValuesMapperID = datavalmapper.ValuesMapperID else: - dataval_map.DataValuesMapperID = datavalues_id + dataval_map.ValuesMapperID = datavalues_id self.setup.push_data(dataval_map) if not datavalues_id: - datavalues_id = datavalues.DataValuesMapperID + datavalues_id = datavalues.ValuesMapperID if row[5].value and row[6].value and row[7].value: if not value: file_base.FileName = row[6].value - file_base.DataValuesMapperID = datavalues_id + file_base.ValuesMapperID = datavalues_id file_base.ElectronicFileFormatCV = self.__session.query(SqlAlchemy.CV_ElectronicFormat).filter( SqlAlchemy.CV_ElectronicFormat.Name == row[7].value ).first().Name diff --git a/src_1.0/src_1.0_MacOS_test/controller/stp4_loadDataValue/loadNumericValues.py b/src/controller/stp4_loadDataValue/loadNumericValues.py similarity index 94% rename from src_1.0/src_1.0_MacOS_test/controller/stp4_loadDataValue/loadNumericValues.py rename to src/controller/stp4_loadDataValue/loadNumericValues.py index 92578f5..7f3f4a7 100644 --- a/src_1.0/src_1.0_MacOS_test/controller/stp4_loadDataValue/loadNumericValues.py +++ b/src/controller/stp4_loadDataValue/loadNumericValues.py @@ -161,15 +161,15 @@ def load_data(self): SqlAlchemy.NumericValues.NumericValue == row[6].value ).all() - result = [datavaluemapper.DataValuesMapperID for datavaluemapper in datavalues_id] + result = [datavaluemapper.ValuesMapperID for datavaluemapper in datavalues_id] - # check for mapping with same datavaluesmapper as the data value. + # check for mapping with same ValuesMapper as the data value. # if found, reuse of mapping id is emminent. for mapping in datavalues: if found: break for each in result[:]: - if mapping.DataValuesMapperID == each: + if mapping.ValuesMapperID == each: datavalues = mapping found = True break @@ -196,14 +196,14 @@ def load_data(self): # creating new datavaluemapper if the row is in a different block if datavalues_id is None and not diff_scene: self.setup.push_data(datavalmapper) - datavalues_id = datavalmapper.DataValuesMapperID - dataval_map.DataValuesMapperID = datavalmapper.DataValuesMapperID + datavalues_id = datavalmapper.ValuesMapperID + dataval_map.ValuesMapperID = datavalmapper.ValuesMapperID elif not diff_scene: - dataval_map.DataValuesMapperID = datavalues_id + dataval_map.ValuesMapperID = datavalues_id self.setup.push_data(dataval_map) else: - datavalues_id = datavalues.DataValuesMapperID + datavalues_id = datavalues.ValuesMapperID # Creating new scenariomapping if scenarioID-mappingID does not exists. # Starts by searchine for the mappingID in case its just been created, then tests to see if a @@ -220,7 +220,7 @@ def load_data(self): SqlAlchemy.Mappings.InstanceID == instance_id, SqlAlchemy.Mappings.SourceID == source_id, SqlAlchemy.Mappings.MethodID == method_id, - SqlAlchemy.Mappings.DataValuesMapperID == datavalues_id + SqlAlchemy.Mappings.ValuesMapperID == datavalues_id ) ).first().MappingID @@ -241,7 +241,7 @@ def load_data(self): # loaded rows, that current row is also added to the database. if not value or not diff_scene: params.NumericValue = row[6].value - params.DataValuesMapperID = datavalues_id + params.ValuesMapperID = datavalues_id self.setup.push_data(params) value = False else: diff --git a/src_1.0/src_1.0_MacOS_test/controller/stp4_loadDataValue/loadSeasonalNumericValues.py b/src/controller/stp4_loadDataValue/loadSeasonalNumericValues.py similarity index 95% rename from src_1.0/src_1.0_MacOS_test/controller/stp4_loadDataValue/loadSeasonalNumericValues.py rename to src/controller/stp4_loadDataValue/loadSeasonalNumericValues.py index 6b4ee29..85322c0 100644 --- a/src_1.0/src_1.0_MacOS_test/controller/stp4_loadDataValue/loadSeasonalNumericValues.py +++ b/src/controller/stp4_loadDataValue/loadSeasonalNumericValues.py @@ -174,9 +174,9 @@ def load_data(self): diff_scene = False raise Exception - result = [datavaluemapper.DataValuesMapperID for datavaluemapper in datavalues_id] + result = [datavaluemapper.ValuesMapperID for datavaluemapper in datavalues_id] - # check for mapping with same datavaluesmapper as the data value. + # check for mapping with same ValuesMapper as the data value. # if found, reuse of mapping id is emminent. if len(result) > 0: for mapping in datavalues: @@ -184,7 +184,7 @@ def load_data(self): break for each in result[:]: #print 'it found something.' - if mapping.DataValuesMapperID == each: + if mapping.ValuesMapperID == each: datavalues = mapping found = True break @@ -212,14 +212,14 @@ def load_data(self): # Creating new datavaluemapper if its the start of another block if datavalues_id is None and not diff_scene: self.setup.push_data(datavalmapper) - datavalues_id = datavalmapper.DataValuesMapperID - dataval_map.DataValuesMapperID = datavalmapper.DataValuesMapperID + datavalues_id = datavalmapper.ValuesMapperID + dataval_map.ValuesMapperID = datavalmapper.ValuesMapperID elif not diff_scene: - dataval_map.DataValuesMapperID = datavalues_id + dataval_map.ValuesMapperID = datavalues_id self.setup.push_data(dataval_map) else: - datavalues_id = datavalues.DataValuesMapperID + datavalues_id = datavalues.ValuesMapperID # Creating new scenariomapping if scenarioID-mappingID does not exists. # Starts by searchine for the mappingID in case its just been created, then tests to see if a @@ -238,7 +238,7 @@ def load_data(self): SqlAlchemy.Mappings.InstanceID == instance_id, SqlAlchemy.Mappings.SourceID == source_id, SqlAlchemy.Mappings.MethodID == method_id, - SqlAlchemy.Mappings.DataValuesMapperID == datavalues_id + SqlAlchemy.Mappings.ValuesMapperID == datavalues_id ) ).first().MappingID @@ -267,7 +267,7 @@ def load_data(self): "Error:\nCannot find '{}' in SeasonNameCV field of SeasonalNumericValues_table".format( row[7].value)) sparams.SeasonNumericValue = row[8].value - sparams.DataValuesMapperID = datavalues_id + sparams.ValuesMapperID = datavalues_id sparams.SeasonName = row[6].value self.setup.push_data(sparams) diff --git a/src_1.0/src_1.0_MacOS_test/controller/stp4_loadDataValue/loadTimeSeries.py b/src/controller/stp4_loadDataValue/loadTimeSeries.py similarity index 96% rename from src_1.0/src_1.0_MacOS_test/controller/stp4_loadDataValue/loadTimeSeries.py rename to src/controller/stp4_loadDataValue/loadTimeSeries.py index 5b2f3c4..1da4dbd 100644 --- a/src_1.0/src_1.0_MacOS_test/controller/stp4_loadDataValue/loadTimeSeries.py +++ b/src/controller/stp4_loadDataValue/loadTimeSeries.py @@ -228,7 +228,7 @@ def load_data(self): ) ).all() - result = [datavaluemapper.DataValuesMapperID for datavaluemapper in datavalues_id] + result = [datavaluemapper.ValuesMapperID for datavaluemapper in datavalues_id] # check for mapping with same datavaluesmapper as the data value. # if found, reuse of mapping id is emminent. @@ -236,7 +236,7 @@ def load_data(self): if found: break for each in result[:]: - if Mappings.DataValuesMapperID == each: + if mapping.ValuesMapperID == each: datavalues = mapping found = True break @@ -263,14 +263,14 @@ def load_data(self): # Creating new datavaluemapper if its the start of another block if datavalues_id is None: self.setup.push_data(datavalmapper) - datavalues_id = datavalmapper.DataValuesMapperID - dataval_map.DataValuesMapperID = datavalmapper.DataValuesMapperID + datavalues_id = datavalmapper.ValuesMapperID + dataval_map.ValuesMapperID = datavalmapper.ValuesMapperID else: - dataval_map.DataValuesMapperID = datavalues_id + dataval_map.ValuesMapperID = datavalues_id self.setup.push_data(dataval_map) else: - datavalues_id = datavalues.DataValuesMapperID + datavalues_id = datavalues.ValuesMapperID # Creating new scenariomapping if scenarioID-mappingID does not exists. # Starts by searchine for the mappingID in case its just been created, then tests to see if a @@ -289,7 +289,7 @@ def load_data(self): SqlAlchemy.Mappings.InstanceID == instance_id, SqlAlchemy.Mappings.SourceID == source_id, SqlAlchemy.Mappings.MethodID == method_id, - SqlAlchemy.Mappings.DataValuesMapperID == datavalues_id + SqlAlchemy.Mappings.ValuesMapperID == datavalues_id ) ).first().MappingID @@ -333,7 +333,7 @@ def load_data(self): timeseries.IntervalTimeUnitCV = self.__session.query(SqlAlchemy.CV_Units).filter( SqlAlchemy.CV_Units.Name == row[9].value ).first().Name - timeseries.DataValuesMapperID = datavalues_id + timeseries.ValuesMapperID = datavalues_id self.setup.push_data(timeseries) value = False @@ -441,9 +441,9 @@ def load_data(self): # get attibute id based on attrib - objecttype association try: - DatasetID = self.__session.query(SqlAlchemy.Datasets).filter( - SqlAlchemy.Datasets.DatasetAcronym == define.datasetName - ).first().DatasetID + ResourceTypeID = self.__session.query(SqlAlchemy.ResourceTypes).filter( + SqlAlchemy.ResourceTypes.ResourceTypeAcronym == define.datasetName + ).first().ResourceTypeID attrib_id = self.__session.query(SqlAlchemy.Attributes).filter( and_( @@ -451,7 +451,7 @@ def load_data(self): SqlAlchemy.Attributes.ObjectTypeID == self.__session.query(SqlAlchemy.ObjectTypes).filter( and_( SqlAlchemy.ObjectTypes.ObjectType == row[0].value, - SqlAlchemy.ObjectTypes.DatasetID == DatasetID + SqlAlchemy.ObjectTypes.ResourceTypeID == ResourceTypeID ) ).first().ObjectTypeID ) @@ -501,7 +501,7 @@ def load_data(self): result = self.__session.query(SqlAlchemy.TimeSeries.TimeSeriesID, SqlAlchemy.Mappings.MappingID, SqlAlchemy.ScenarioMappings.ScenarioID). \ join(SqlAlchemy.Mappings, - SqlAlchemy.Mappings.DataValuesMapperID == SqlAlchemy.TimeSeries.DataValuesMapperID). \ + SqlAlchemy.Mappings.ValuesMapperID == SqlAlchemy.TimeSeries.ValuesMapperID). \ join(SqlAlchemy.ScenarioMappings, SqlAlchemy.ScenarioMappings.MappingID == SqlAlchemy.Mappings.MappingID). \ filter( @@ -516,12 +516,12 @@ def load_data(self): 'Are not found in TimeSeries Table. Please Check \n' 'Loading is Exiting due to this error.'.format(row_id)) # find mapping id which are mapped with the current scenario in the scenariomapping from result above - # if it is found, we set the found var to True and reuse the Mappings. + # if it is found, we set the found var to True and reuse the mapping. for mapping in result: try: scene = self.__session.query(SqlAlchemy.ScenarioMappings).filter( and_( - SqlAlchemy.ScenarioMappings.MappingID == Mappings.MappingID, + SqlAlchemy.ScenarioMappings.MappingID == mapping.MappingID, SqlAlchemy.ScenarioMappings.ScenarioID == scenario_id ) ).first().ScenarioMappingID @@ -541,7 +541,7 @@ def load_data(self): test_query = self.__session.query(SqlAlchemy.TimeSeriesValues).filter( and_( SqlAlchemy.TimeSeriesValues.TimeSeriesID == result.TimeSeriesID, - SqlAlchemy.TimeSeriesValues.Value == row[5].value, + SqlAlchemy.TimeSeriesValues.DataValue == row[5].value, SqlAlchemy.TimeSeriesValues.DateTimeStamp == datetime.date.fromordinal(int(row[4].value) + 693594) ) @@ -555,7 +555,7 @@ def load_data(self): 'attribue and instance combination'.format(row[3].value, row[1].value)) # Adding new entery for time series values timeserieval.TimeSeriesID = result.TimeSeriesID - timeserieval.Value = row[5].value + timeserieval.DataValue = row[5].value try: if isinstance(row[4].value, float) or isinstance(row[4].value, int): timeserieval.DateTimeStamp = datetime.date.fromordinal(int(row[4].value) + 693594) diff --git a/src_1.0/controller/timeSeriesData_shaper.py b/src/controller/timeSeriesData_shaper.py similarity index 100% rename from src_1.0/controller/timeSeriesData_shaper.py rename to src/controller/timeSeriesData_shaper.py diff --git a/src_1.0/controller/wamdamAPI/GetComapreScenarios.py b/src/controller/wamdamAPI/GetComapreScenarios.py similarity index 87% rename from src_1.0/controller/wamdamAPI/GetComapreScenarios.py rename to src/controller/wamdamAPI/GetComapreScenarios.py index 1de8bb4..31685f8 100644 --- a/src_1.0/controller/wamdamAPI/GetComapreScenarios.py +++ b/src/controller/wamdamAPI/GetComapreScenarios.py @@ -14,7 +14,7 @@ def __init__(self): def GetComapreScenarios(self, selectedDataset, masterNetworkName, scenarioName1, scenarioName2): ''' This method is used to compare any two scenarios within a MasterNetwork in a selected database file and make ScenarioComparision table. - :param selectedDataset: value of selected DatasetAcronym. + :param selectedDataset: value of selected ResourceTypeAcronym. :param masterNetworkName: value of selected MasterNetworkName. :param scenarioName1: first scenario name :param scenarioName2: second scenario name @@ -94,7 +94,7 @@ def GetComapreScenarios(self, selectedDataset, masterNetworkName, scenarioName1, def GetUniqueTopology_Scenario2(self, selectedDataset, masterNetworkName, scenarioName1, scenarioName2): ''' This method is used to get data making UniqueToFirstScenario table within ChangeInTopology sheet - :param selectedDataset: value of selected DatasetAcronym. + :param selectedDataset: value of selected ResourceTypeAcronym. :param masterNetworkName: value of selected MasterNetworkName. :param scenarioName1: first scenario name :param scenarioName2: second scenario name @@ -116,12 +116,12 @@ def GetUniqueTopology_Scenario2(self, selectedDataset, masterNetworkName, scenar 'ON "Attributes"."AttributeID"="Mappings"."AttributeID"' \ 'Left JOIN "ObjectTypes"' \ 'ON "ObjectTypes"."ObjectTypeID"="Attributes"."ObjectTypeID"' \ - 'Left JOIN "Datasets"' \ - 'ON "Datasets"."DatasetID"="ObjectTypes"."DatasetID"' \ + 'Left JOIN "ResourceTypes"' \ + 'ON "ResourceTypes"."ResourceTypeID"="ObjectTypes"."ResourceTypeID"' \ 'JOIN "Instances"' \ 'ON "Instances"."InstanceID"="Mappings"."InstanceID"'\ 'WHERE "Attributes"."AttributeName"="ObjectTypeInstances" ' \ - 'AND "Datasets"."DatasetAcronym"="{}" ' \ + 'AND "ResourceTypes"."ResourceTypeAcronym"="{}" ' \ 'AND "MasterNetworks"."MasterNetworkName"="{}" '.format(selectedDataset, masterNetworkName) @@ -137,7 +137,7 @@ def GetUniqueTopology_Scenario2(self, selectedDataset, masterNetworkName, scenar def GetUniqueTopology_Scenario1(self, selectedDataset, masterNetworkName, scenarioName1, scenarioName2): ''' This method is used to get data making UniqueToSecondScenario table within ChangeInTopology sheet - :param selectedDataset: value of selected DatasetAcronym. + :param selectedDataset: value of selected ResourceTypeAcronym. :param masterNetworkName: value of selected MasterNetworkName. :param scenarioName1: first scenario name :param scenarioName2: second scenario name @@ -159,12 +159,12 @@ def GetUniqueTopology_Scenario1(self, selectedDataset, masterNetworkName, scenar 'ON "Attributes"."AttributeID"="Mappings"."AttributeID"' \ 'Left JOIN "ObjectTypes"' \ 'ON "ObjectTypes"."ObjectTypeID"="Attributes"."ObjectTypeID"' \ - 'Left JOIN "Datasets"' \ - 'ON "Datasets"."DatasetID"="ObjectTypes"."DatasetID"'\ + 'Left JOIN "ResourceTypes"' \ + 'ON "ResourceTypes"."ResourceTypeID"="ObjectTypes"."ResourceTypeID"'\ 'JOIN "Instances"' \ 'ON "Instances"."InstanceID"="Mappings"."InstanceID"' \ 'WHERE "Attributes"."AttributeName"="ObjectTypeInstances" AND ObjectTypologyCV !="Network" '\ - 'AND "Datasets"."DatasetAcronym"="{}" ' \ + 'AND "ResourceTypes"."ResourceTypeAcronym"="{}" ' \ 'AND "MasterNetworks"."MasterNetworkName"="{}" ' \ 'ORDER BY "ScenarioName" desc '.format(selectedDataset, masterNetworkName) @@ -181,16 +181,16 @@ def GetUniqueTopology_Scenario1(self, selectedDataset, masterNetworkName, scenar def GetCommonTopology(self, selectedDataset, masterNetworkName, scenarioName1, scenarioName2): ''' This method is used to get data making CommonBetweenThem table within ChangeInTopology sheet - :param selectedDataset: value of selected DatasetAcronym. + :param selectedDataset: value of selected ResourceTypeAcronym. :param masterNetworkName: value of selected MasterNetworkName. :param scenarioName1: first scenario name :param scenarioName2: second scenario name :return: queried result(list) ''' sql = 'SELECT DISTINCT "Instances"."InstanceName","ObjectType",ObjectTypologyCV ' \ - 'FROM "Datasets"' \ + 'FROM "ResourceTypes"' \ 'left join "ObjectTypes"' \ - 'ON ObjectTypes.Datasetid=Datasets.Datasetid ' \ + 'ON ObjectTypes.ResourceTypeID=ResourceTypes.ResourceTypeID ' \ 'Left JOIN "Attributes"' \ 'ON Attributes.ObjectTypeid = Objecttypes.Objecttypeid ' \ 'Left JOIN "Mappings"'\ @@ -207,7 +207,7 @@ def GetCommonTopology(self, selectedDataset, masterNetworkName, scenarioName1, s 'ON Methods.Methodid = Mappings.Methodid ' \ 'Left JOIN Sources on Sources.Sourceid = Mappings.Sourceid '\ 'WHERE "Attributes"."AttributeName"="ObjectTypeInstances" AND ObjectTypologyCV !="Network" and InstanceName IS NOT NULL '\ - 'AND "Datasets"."DatasetAcronym"="{}" ' \ + 'AND "ResourceTypes"."ResourceTypeAcronym"="{}" ' \ 'AND "MasterNetworks"."MasterNetworkName"="{}" '\ ' ORDER BY "InstanceName" desc '.format(selectedDataset, masterNetworkName) @@ -227,7 +227,7 @@ def GetCommonTopology(self, selectedDataset, masterNetworkName, scenarioName1, s def GetChangeInMetadata_Topology(self, selectedDataset, masterNetworkName, scenarioName1, scenarioName2): ''' This method is used to get data making table within ChangeInMetadata_Topology sheet - :param selectedDataset: value of selected DatasetAcronym. + :param selectedDataset: value of selected ResourceTypeAcronym. :param masterNetworkName: value of selected MasterNetworkName. :param scenarioName1: first scenario name :param scenarioName2: second scenario name @@ -236,7 +236,7 @@ def GetChangeInMetadata_Topology(self, selectedDataset, masterNetworkName, scena sqlDrop = 'DROP TABLE IF EXISTS ChangeInMetadata_Topology;' sql = 'CREATE Table ChangeInMetadata_Topology AS ' \ 'SELECT DISTINCT "Instances"."InstanceName","ObjectType","ObjectTypologyCV",' \ - 'AttributeName,"ScenarioName",SourceName,MethodName,"MasterNetworkName",DataValuesMapperID '\ + 'AttributeName,"ScenarioName",SourceName,MethodName,"MasterNetworkName",ValuesMapperID '\ 'FROM "ScenarioComparision" '\ 'JOIN "Mappings" '\ 'ON "Mappings"."MappingID"="ScenarioComparision"."MappingID2" '\ @@ -250,17 +250,17 @@ def GetChangeInMetadata_Topology(self, selectedDataset, masterNetworkName, scena 'ON "Attributes"."AttributeID"="Mappings"."AttributeID" '\ 'Left JOIN "ObjectTypes" '\ 'ON "ObjectTypes"."ObjectTypeID"="Attributes"."ObjectTypeID" '\ - 'Left JOIN "Datasets" '\ - 'ON "Datasets"."DatasetID"="ObjectTypes"."DatasetID" '\ + 'Left JOIN "ResourceTypes" '\ + 'ON "ResourceTypes"."ResourceTypeID"="ObjectTypes"."ResourceTypeID" '\ 'JOIN "Instances" '\ 'ON "Instances"."InstanceID"="Mappings"."InstanceID" '\ 'Left JOIN "Methods" '\ 'ON "Methods"."MethodID"="Mappings"."MethodID" '\ 'Left JOIN "Sources" '\ 'ON "Sources"."SourceID"="Mappings"."SourceID" '\ - 'WHERE "Attributes"."AttributeName"="ObjectTypeInstances" AND "MasterNetworks"."MasterNetworkName"="{}" AND DatasetAcronym="{}" '\ + 'WHERE "Attributes"."AttributeName"="ObjectTypeInstances" AND "MasterNetworks"."MasterNetworkName"="{}" AND ResourceTypeAcronym="{}" '\ 'UNION ALL '\ - 'SELECT DISTINCT "Instances"."InstanceName","ObjectType","ObjectTypologyCV",AttributeName,ScenarioName,SourceName,MethodName,"MasterNetworkName",DataValuesMapperID '\ + 'SELECT DISTINCT "Instances"."InstanceName","ObjectType","ObjectTypologyCV",AttributeName,ScenarioName,SourceName,MethodName,"MasterNetworkName",ValuesMapperID '\ 'FROM "ScenarioComparision" '\ 'JOIN "Mappings" '\ 'ON "Mappings"."MappingID"="ScenarioComparision"."MappingID1" '\ @@ -272,8 +272,8 @@ def GetChangeInMetadata_Topology(self, selectedDataset, masterNetworkName, scena 'ON "Attributes"."AttributeID"="Mappings"."AttributeID" '\ 'Left JOIN "ObjectTypes" '\ 'ON "ObjectTypes"."ObjectTypeID"="Attributes"."ObjectTypeID" '\ - 'Left JOIN "Datasets" '\ - 'ON "Datasets"."DatasetID"="ObjectTypes"."DatasetID" '\ + 'Left JOIN "ResourceTypes" '\ + 'ON "ResourceTypes"."ResourceTypeID"="ObjectTypes"."ResourceTypeID" '\ 'Left JOIN "MasterNetworks" '\ 'ON "MasterNetworks"."MasterNetworkID"="Scenarios"."MasterNetworkID" '\ 'JOIN "Instances" '\ @@ -282,7 +282,7 @@ def GetChangeInMetadata_Topology(self, selectedDataset, masterNetworkName, scena 'ON "Methods"."MethodID"="Mappings"."MethodID" '\ 'Left JOIN "Sources" '\ 'ON "Sources"."SourceID"="Mappings"."SourceID" '\ - 'WHERE "Attributes"."AttributeName"="ObjectTypeInstances" AND "MasterNetworks"."MasterNetworkName"="{}" AND DatasetAcronym="{}" '\ + 'WHERE "Attributes"."AttributeName"="ObjectTypeInstances" AND "MasterNetworks"."MasterNetworkName"="{}" AND ResourceTypeAcronym="{}" '\ 'ORDER BY "ScenarioName" desc '.format(masterNetworkName, selectedDataset, masterNetworkName, selectedDataset) self.session.execute(sqlDrop) @@ -290,23 +290,23 @@ def GetChangeInMetadata_Topology(self, selectedDataset, masterNetworkName, scena result = self.session.execute("SELECT * FROM ChangeInMetadata_Topology;") resultData = [] for row in result: - resultData.append([row.InstanceName, row.ObjectType, row.ObjectTypologyCV, row.AttributeName, row.ScenarioName, row.SourceName, row.MethodName, row.MasterNetworkName, row.DataValuesMapperID]) + resultData.append([row.InstanceName, row.ObjectType, row.ObjectTypologyCV, row.AttributeName, row.ScenarioName, row.SourceName, row.MethodName, row.MasterNetworkName, row.ValuesMapperID]) pass return resultData - def GetChangeInMetadataValues_Attributes(self, selectedDataset, masterNetworkName, scenarioName1, scenarioName2): + def GetChangeInMetaValues_Attributes(self, selectedDataset, masterNetworkName, scenarioName1, scenarioName2): ''' This method is used to get data making table within ChangeInMetadata_Attributes sheet - :param selectedDataset: value of selected DatasetAcronym. + :param selectedDataset: value of selected ResourceTypeAcronym. :param masterNetworkName: value of selected MasterNetworkName. :param scenarioName1: first scenario name :param scenarioName2: second scenario name :return: queried result(list) ''' - sqlDrop = 'DROP TABLE IF EXISTS ChangeInMetadataValues_Attributes; ' - sql = 'CREATE Table ChangeInMetadataValues_Attributes AS '\ - 'SELECT DISTINCT "Instances"."InstanceName","ObjectType","ObjectTypologyCV",AttributeName,AttributeDataTypeCV,"ScenarioName",SourceName,MethodName,"MasterNetworkName",DataValuesMapperID '\ + sqlDrop = 'DROP TABLE IF EXISTS ChangeInMetavalues_Attributes; ' + sql = 'CREATE Table ChangeInMetavalues_Attributes AS '\ + 'SELECT DISTINCT "Instances"."InstanceName","ObjectType","ObjectTypologyCV",AttributeName,AttributeDataTypeCV,"ScenarioName",SourceName,MethodName,"MasterNetworkName",ValuesMapperID '\ 'FROM "ScenarioComparision" '\ 'JOIN "Mappings" '\ 'ON "Mappings"."MappingID"="ScenarioComparision"."MappingID2" '\ @@ -320,17 +320,17 @@ def GetChangeInMetadataValues_Attributes(self, selectedDataset, masterNetworkNam 'ON "Attributes"."AttributeID"="Mappings"."AttributeID" '\ 'Left JOIN "ObjectTypes" '\ 'ON "ObjectTypes"."ObjectTypeID"="Attributes"."ObjectTypeID" '\ - 'Left JOIN "Datasets" '\ - 'ON "Datasets"."DatasetID"="ObjectTypes"."DatasetID" '\ + 'Left JOIN "ResourceTypes" '\ + 'ON "ResourceTypes"."ResourceTypeID"="ObjectTypes"."ResourceTypeID" '\ 'JOIN "Instances" '\ 'ON "Instances"."InstanceID"="Mappings"."InstanceID" '\ 'Left JOIN "Methods" '\ 'ON "Methods"."MethodID"="Mappings"."MethodID" '\ 'Left JOIN "Sources" '\ 'ON "Sources"."SourceID"="Mappings"."SourceID" '\ - 'WHERE "Attributes"."AttributeName"!="ObjectTypeInstances" AND "MasterNetworks"."MasterNetworkName"="{}" AND DatasetAcronym="{}" '\ + 'WHERE "Attributes"."AttributeName"!="ObjectTypeInstances" AND "MasterNetworks"."MasterNetworkName"="{}" AND ResourceTypeAcronym="{}" '\ 'UNION ALL '\ - 'SELECT DISTINCT "Instances"."InstanceName","ObjectType","ObjectTypologyCV",AttributeName,AttributeDataTypeCV, ScenarioName,SourceName,MethodName,"MasterNetworkName",DataValuesMapperID '\ + 'SELECT DISTINCT "Instances"."InstanceName","ObjectType","ObjectTypologyCV",AttributeName,AttributeDataTypeCV, ScenarioName,SourceName,MethodName,"MasterNetworkName",ValuesMapperID '\ 'FROM "ScenarioComparision" '\ 'JOIN "Mappings" '\ 'ON "Mappings"."MappingID"="ScenarioComparision"."MappingID1" '\ @@ -342,8 +342,8 @@ def GetChangeInMetadataValues_Attributes(self, selectedDataset, masterNetworkNam 'ON "Attributes"."AttributeID"="Mappings"."AttributeID" '\ 'Left JOIN "ObjectTypes" '\ 'ON "ObjectTypes"."ObjectTypeID"="Attributes"."ObjectTypeID" '\ - 'Left JOIN "Datasets" '\ - 'ON "Datasets"."DatasetID"="ObjectTypes"."DatasetID" '\ + 'Left JOIN "ResourceTypes" '\ + 'ON "ResourceTypes"."ResourceTypeID"="ObjectTypes"."ResourceTypeID" '\ 'Left JOIN "MasterNetworks" '\ 'ON "MasterNetworks"."MasterNetworkID"="Scenarios"."MasterNetworkID" '\ 'JOIN "Instances" '\ @@ -352,23 +352,23 @@ def GetChangeInMetadataValues_Attributes(self, selectedDataset, masterNetworkNam 'ON "Methods"."MethodID"="Mappings"."MethodID" '\ 'Left JOIN "Sources" '\ 'ON "Sources"."SourceID"="Mappings"."SourceID" '\ - 'WHERE "Attributes"."AttributeName"!="ObjectTypeInstances" AND "MasterNetworks"."MasterNetworkName"="{}" AND DatasetAcronym="{}" '\ + 'WHERE "Attributes"."AttributeName"!="ObjectTypeInstances" AND "MasterNetworks"."MasterNetworkName"="{}" AND ResourceTypeAcronym="{}" '\ 'ORDER BY "ScenarioName" desc '.format(masterNetworkName, selectedDataset, masterNetworkName, selectedDataset) self.session.execute(sqlDrop) result = self.session.execute(sql) - result = self.session.execute("SELECT * FROM ChangeInMetadataValues_Attributes;") + result = self.session.execute("SELECT * FROM ChangeInMetavalues_Attributes;") resultData = [] for row in result: - resultData.append([row.InstanceName, row.ObjectType, row.ObjectTypologyCV, row.AttributeName, row.AttributeDataTypeCV, row.ScenarioName, row.SourceName, row.MethodName, row.MasterNetworkName, row.DataValuesMapperID]) + resultData.append([row.InstanceName, row.ObjectType, row.ObjectTypologyCV, row.AttributeName, row.AttributeDataTypeCV, row.ScenarioName, row.SourceName, row.MethodName, row.MasterNetworkName, row.ValuesMapperID]) pass return resultData - def AllDataValuesMapperCount(self, selectedDataset, masterNetworkName): - sql = 'SELECT count(DataValuesMapper.DataValuesMapperID) AS AllDataValuesMapperCount '\ - 'FROM Datasets '\ + def AllValuesMapperCount(self, selectedDataset, masterNetworkName): + sql = 'SELECT count(ValuesMapper.ValuesMapperID) AS AllValuesMapperCount '\ + 'FROM ResourceTypes '\ 'Left JOIN "ObjectTypes" '\ - 'ON "ObjectTypes"."DatasetID"="Datasets"."DatasetID" '\ + 'ON "ObjectTypes"."ResourceTypeID"="ResourceTypes"."ResourceTypeID" '\ 'Left JOIN "Attributes"'\ 'ON "Attributes"."ObjectTypeID"="ObjectTypes"."ObjectTypeID" '\ 'Left JOIN "Mappings" '\ @@ -381,18 +381,18 @@ def AllDataValuesMapperCount(self, selectedDataset, masterNetworkName): 'ON "Scenarios"."ScenarioID"="ScenarioMappings"."ScenarioID" '\ 'Left JOIN "MasterNetworks" '\ 'ON "MasterNetworks"."MasterNetworkID"="Scenarios"."MasterNetworkID" ' \ - 'Left JOIN "DataValuesMapper" ' \ - 'ON "DataValuesMapper"."DataValuesMapperID"="Mappings"."DataValuesMapperID" '\ + 'Left JOIN "ValuesMapper" ' \ + 'ON "ValuesMapper"."ValuesMapperID"="Mappings"."ValuesMapperID" '\ 'WHERE InstanceName is not null and MasterNetworkName="{}"' \ ' and AttributeName!="ObjectTypeInstances"'.format(masterNetworkName) result = self.session.execute(sql) for row in result: - return row.AllDataValuesMapperCount + return row.AllValuesMapperCount return 0 def AllTopologyMetadataCount(self, selectedDataset, masterNetworkName): sql = 'SELECT count(InstanceName) AS AllTopologyMetadataCount ' \ - 'FROM Datasets Left JOIN "ObjectTypes" ' \ - 'ON "ObjectTypes"."DatasetID"="Datasets"."DatasetID" ' \ + 'FROM ResourceTypes Left JOIN "ObjectTypes" ' \ + 'ON "ObjectTypes"."ResourceTypeID"="ResourceTypes"."ResourceTypeID" ' \ 'Left JOIN "Attributes" ' \ 'ON "Attributes"."ObjectTypeID"="ObjectTypes"."ObjectTypeID" ' \ 'Left JOIN "Mappings" ON Mappings.AttributeID= Attributes.AttributeID ' \ @@ -410,8 +410,8 @@ def AllTopologyMetadataCount(self, selectedDataset, masterNetworkName): return 0 def AllMetadataAttributesCount(self , selectedDataset, masterNetworkName): - sql = 'SELECT count(InstanceName) AS AllMetadataAttributesCount FROM Datasets ' \ - 'Left JOIN "ObjectTypes" ON "ObjectTypes"."DatasetID"="Datasets"."DatasetID" ' \ + sql = 'SELECT count(InstanceName) AS AllMetadataAttributesCount FROM ResourceTypes ' \ + 'Left JOIN "ObjectTypes" ON "ObjectTypes"."ResourceTypeID"="ResourceTypes"."ResourceTypeID" ' \ 'Left JOIN "Attributes" ON "Attributes"."ObjectTypeID"="ObjectTypes"."ObjectTypeID" ' \ 'Left JOIN "Mappings" ON Mappings.AttributeID= Attributes.AttributeID ' \ 'Left JOIN "Instances" ON "Instances"."InstanceID"="Mappings"."InstanceID" ' \ diff --git a/src_1.0/controller/wamdamAPI/GetDataStructure.py b/src/controller/wamdamAPI/GetDataStructure.py similarity index 75% rename from src_1.0/controller/wamdamAPI/GetDataStructure.py rename to src/controller/wamdamAPI/GetDataStructure.py index 1bf076a..8299438 100644 --- a/src_1.0/controller/wamdamAPI/GetDataStructure.py +++ b/src/controller/wamdamAPI/GetDataStructure.py @@ -12,70 +12,70 @@ def __init__(self): self.session = self.setup.get_session() self.excel_pointer = None - def getDatasets(self, dset_acro=None): + def getResourceTypes(self, dset_acro=None): ''' - This method is used to get all data in "Datasets" table of sqlite db. + This method is used to get all data in "ResourceTypes" table of sqlite db. :return: list of row ''' try: - result = self.session.query(sq.Datasets).all() + result = self.session.query(sq.ResourceTypes).all() return result except Exception as e: # define.logger.error('Failed metAData load.\n' + e.message) - raise Exception('Could not open Datasets table.\n' + e.message) + raise Exception('Could not open ResourceTypes table.\n' + e.message) print(e) # for row in result: - # print row.DatasetName + # print row.ResourceType def get_excel(self): pass - def getDatasetType(self, selectedDataset): + def getResourceType(self, selectedResourceType): ''' - This method is used to get DatasetTypes by selected DatasetAcronym. - First, It is filtered Datasets table by selected DatasetAcronym. - Next, Get data by comparing SourceID of Sources and Datasets. - :param selectedDataset: value of selected DatasetAcronym. - :return: list of set of DatasetName, DatasetAcronym, SourceName and Description queried + This method is used to get DatasetTypes by selected ResourceTypeAcronym. + First, It is filtered ResourceTypes table by selected ResourceTypeAcronym. + Next, Get data by comparing SourceID of Sources and ResourceTypes. + :param selectedResourceType: value of selected ResourceTypeAcronym. + :return: list of set of ResourceType, ResourceTypeAcronym, SourceName and Description queried ''' try: - result = self.session.query(sq.Datasets.DatasetAcronym, sq.Datasets.DatasetName, - sq.Datasets.Description, sq.Sources.SourceName).filter(sq.Datasets.DatasetAcronym == selectedDataset).\ + result = self.session.query(sq.ResourceTypes.ResourceTypeAcronym, sq.ResourceTypes.ResourceType, + sq.ResourceTypes.Description, sq.Sources.SourceName).filter(sq.ResourceTypes.ResourceTypeAcronym == selectedResourceType).\ join(sq.Sources, - sq.Sources.SourceID == sq.Datasets.SourceID).all() + sq.Sources.SourceID == sq.ResourceTypes.SourceID).all() complete_result = list() nameResult = list() for row in result: isExisting = False for name in nameResult: - if name == row.DatasetAcronym: + if name == row.ResourceTypeAcronym: isExisting = True break if not isExisting: - nameResult.append(row.DatasetAcronym) - complete_result.append([row.DatasetName, row.DatasetAcronym, row.SourceName, row.Description]) + nameResult.append(row.ResourceTypeAcronym) + complete_result.append([row.ResourceType, row.ResourceTypeAcronym, row.SourceName, row.Description]) return complete_result except Exception as e: # define.logger.error('Failed metAData load.\n' + e.message) raise Exception('Error occurred in reading Data Structure.\n' + e.message) pass - def getObjecttypes(self, selectedDataset): + def getObjecttypes(self, selectedResourceType): ''' - This method is used to get ObjectTypes by selected DatasetAcronym. - First, It is filtered Datasets table by selected DatasetAcronym. - Next, Compare DatasetID of ObjectTypes and Datasets tables and join those result. - Next, Compare ObjectCategoryID of ObjectCategory and ObjectTypes tables and join those result. - :param selectedDataset: value of selected DatasetAcronym. + This method is used to get ObjectTypes by selected ResourceTypeAcronym. + First, It is filtered ResourceTypes table by selected ResourceTypeAcronym. + Next, Compare ResourceTypeID of ObjectTypes and ResourceTypes tables and join those result. + Next, Compare ObjectCategoriesID of ObjectCategories and ObjectTypes tables and join those result. + :param selectedResourceType: value of selected ResourceTypeAcronym. :return: list of set of data queried ''' try: - result = self.session.query(sq.Datasets.DatasetAcronym, sq.ObjectTypes.ObjectType, + result = self.session.query(sq.ResourceTypes.ResourceTypeAcronym, sq.ObjectTypes.ObjectType, sq.ObjectTypes.ObjectTypologyCV, sq.ObjectTypes.ObjectTypeCV, - sq.ObjectCategory.ObjectCategoryName, sq.ObjectTypes.Description).filter(sq.Datasets.DatasetAcronym == selectedDataset).\ + sq.ObjectCategories.ObjectCategoriesName, sq.ObjectTypes.Description).filter(sq.ResourceTypes.ResourceTypeAcronym == selectedResourceType).\ join(sq.ObjectTypes, - sq.ObjectTypes.DatasetID == sq.Datasets.DatasetID).\ - join(sq.ObjectCategory, sq.ObjectCategory.ObjectCategoryID == sq.ObjectTypes.ObjectCategoryID).all() + sq.ObjectTypes.ResourceTypeID == sq.ResourceTypes.ResourceTypeID).\ + join(sq.ObjectCategories, sq.ObjectCategories.ObjectCategoriesID == sq.ObjectTypes.ObjectCategoriesID).all() complete_result = list() nameResult = list() @@ -87,28 +87,28 @@ def getObjecttypes(self, selectedDataset): break if not isExisting: nameResult.append(row.ObjectType) - complete_result.append([row.ObjectType, row.ObjectTypologyCV, row.DatasetAcronym, + complete_result.append([row.ObjectType, row.ObjectTypologyCV, row.ResourceTypeAcronym, row.ObjectTypeCV, "", "", - row.ObjectCategoryName, row.Description]) + row.ObjectCategoriesName, row.Description]) return complete_result except Exception as e: # define.logger.error('Failed metAData load.\n' + e.message) raise Exception('Error occurred in reading Data Structure.\n' + e.message) - def getAttributes(self, selectedDataset): + def getAttributes(self, selectedResourceType): ''' - This method is used to get Attributes by selected DatasetAcronym. - :param selectedDataset: value of selected DatasetAcronym. + This method is used to get Attributes by selected ResourceTypeAcronym. + :param selectedResourceType: value of selected ResourceTypeAcronym. :return: list of set of data queried ''' try: - result = self.session.query(sq.Datasets.DatasetAcronym, sq.ObjectTypes.ObjectType, + result = self.session.query(sq.ResourceTypes.ResourceTypeAcronym, sq.ObjectTypes.ObjectType, sq.Attributes.AttributeName, sq.Attributes.AttributeDataTypeCV, - sq.Attributes.AttributeNameCV, sq.Attributes.AttributeCategory, + sq.Attributes.AttributeNameCV, sq.Attributes.AttributeCategories, sq.Attributes.UnitNameCV, sq.Attributes.ModelInputOrOutput, - sq.Attributes.AttributeDescription).filter(sq.Datasets.DatasetAcronym==selectedDataset).\ + sq.Attributes.AttributeDescription).filter(sq.ResourceTypes.ResourceTypeAcronym==selectedResourceType).\ join(sq.ObjectTypes, - sq.ObjectTypes.DatasetID == sq.Datasets.DatasetID).\ + sq.ObjectTypes.ResourceTypeID == sq.ResourceTypes.ResourceTypeID).\ join(sq.Attributes, sq.Attributes.ObjectTypeID == sq.ObjectTypes.ObjectTypeID).all() complete_result = list() @@ -122,10 +122,10 @@ def getAttributes(self, selectedDataset): isExisting = True break if not isExisting: - if row.AttributeCategory != "" and row.AttributeCategory != "FALSE": + if row.AttributeCategories != "" and row.AttributeCategories != "FALSE": nameResult.append(row.AttributeName) complete_result.append([row.ObjectType, row.AttributeName, row.UnitNameCV, - row.AttributeDataTypeCV, row.AttributeNameCV, row.AttributeCategory, + row.AttributeDataTypeCV, row.AttributeNameCV, row.AttributeCategories, row.ModelInputOrOutput, row.AttributeDescription]) return complete_result @@ -133,23 +133,23 @@ def getAttributes(self, selectedDataset): # define.logger.error('Failed metAData load.\n' + e.message) raise Exception('Error occurred in reading Data Structure.\n' + e.message) - def getMasterNetwork(self, selectedDataset): + def getMasterNetwork(self, selectedResourceType): ''' - This method is used to get data from MasterNetworks table by selected DatasetAcronym. - :param selectedDataset: value of selected DatasetAcronym. + This method is used to get data from MasterNetworks table by selected ResourceTypeAcronym. + :param selectedResourceType: value of selected ResourceTypeAcronym. :return: list of MasterNetworkName and set of data queried ''' try: - result = self.session.execute("Select DatasetAcronym,MasterNetworkName, SpatialReferenceNameCV, VerticalDatumCV,'MasterNetworks'.'Description' "\ - "FROM Datasets "\ - "left join ObjectTypes on ObjectTypes.Datasetid=Datasets.Datasetid "\ + result = self.session.execute("Select ResourceTypeAcronym,MasterNetworkName, SpatialReferenceNameCV, VerticalDatumCV,'MasterNetworks'.'Description' "\ + "FROM ResourceTypes "\ + "left join ObjectTypes on ObjectTypes.ResourceTypeid=ResourceTypes.ResourceTypeid "\ "left join Attributes on Attributes.ObjectTypeid = Objecttypes.Objecttypeid "\ "left join Mappings on Mappings.Attributeid = Attributes.Attributeid "\ "left join Instances on instances.instanceid = Mappings.Instanceid "\ "left join Scenariomappings on ScenarioMappings.Mappingid = Mappings.Mappingid "\ "left join Scenarios on Scenarios.ScenarioId=ScenarioMappings.Scenarioid "\ "left join MasterNetworks on MasterNetworks.MasterNetworkid = Scenarios.MasterNetworkid "\ - "WHERE DatasetAcronym='{}' AND ObjectTypologyCV='Network' ".format(selectedDataset)) + "WHERE ResourceTypeAcronym='{}' AND ObjectTypologyCV='Network' ".format(selectedResourceType)) #Get data the remaining data except overlapping MasterNetworkName. nameResult = list() dataResult = list() @@ -163,7 +163,7 @@ def getMasterNetwork(self, selectedDataset): break if not isExisting: nameResult.append(row.MasterNetworkName) - dataResult.append([row.MasterNetworkName, row.DatasetAcronym, + dataResult.append([row.MasterNetworkName, row.ResourceTypeAcronym, row.SpatialReferenceNameCV, row.VerticalDatumCV, row.Description]) @@ -173,18 +173,18 @@ def getMasterNetwork(self, selectedDataset): # define.logger.error('Failed metAData load.\n' + e.message) raise Exception('Error occurred in reading Data Structure.\n' + e.message) - def getScenario(self, selectedDataset, masterNetworkName): + def getScenario(self, selectedResourceType, masterNetworkName): ''' - This method is used to get data from Scenarios table by selected DatasetAcronym and MasterNetworkName. - :param selectedDataset: value of selected DatasetAcronym. + This method is used to get data from Scenarios table by selected ResourceTypeAcronym and MasterNetworkName. + :param selectedResourceType: value of selected ResourceTypeAcronym. :param masterNetworkName: value of selected MasterNetworkName. :return: list of ScenarioName and set of data queried ''' try: - result = self.session.execute("Select DatasetAcronym,ObjectType,ObjectTypologyCV,AttributeName,InstanceName,MasterNetworkName,ScenarioName, "\ + result = self.session.execute("Select ResourceTypeAcronym,ObjectType,ObjectTypologyCV,AttributeName,InstanceName,MasterNetworkName,ScenarioName, "\ "ScenarioEndDate,Sourcename, TimeStepValue, TimeStepUnitCV, 'Scenarios'.'Description', Methodname ,ScenarioStartDate "\ - "FROM Datasets "\ - "left join ObjectTypes on ObjectTypes.Datasetid=Datasets.Datasetid "\ + "FROM ResourceTypes "\ + "left join ObjectTypes on ObjectTypes.ResourceTypeid=ResourceTypes.ResourceTypeid "\ "left join Attributes on Attributes.ObjectTypeid = Objecttypes.Objecttypeid "\ "left join Mappings on Mappings.Attributeid = Attributes.Attributeid "\ "left join Instances on instances.instanceid = Mappings.Instanceid "\ @@ -193,8 +193,8 @@ def getScenario(self, selectedDataset, masterNetworkName): "left join MasterNetworks on MasterNetworks.MasterNetworkid = Scenarios.MasterNetworkid "\ "left join Methods on Methods.Methodid = Mappings.Methodid "\ "left join Sources on Sources.Sourceid = Mappings.Sourceid "\ - "WHERE DatasetAcronym='{}' AND ObjectTypologyCV='Network' AND MasterNetworkName='{}'"\ - "ORDER BY InstanceName DESC".format(selectedDataset, masterNetworkName)) + "WHERE ResourceTypeAcronym='{}' AND ObjectTypologyCV='Network' AND MasterNetworkName='{}'"\ + "ORDER BY InstanceName DESC".format(selectedResourceType, masterNetworkName)) #Get data the remaining data except overlapping ScenarioName. nameResult = list() dataResult = list() @@ -219,22 +219,22 @@ def getScenario(self, selectedDataset, masterNetworkName): # define.logger.error('Failed metAData load.\n' + e.message) raise Exception('Error occurred in reading Data Structure.\n' + e.message) - def getNodes(self, selectedDataset, masterNetworkName, scenarioName): + def getNodes(self, selectedResourceType, masterNetworkName, scenarioName): ''' - This method is used to get data of Nodes by selected DatasetAcronym, MasterNetworkName and ScenarioName. - :param selectedDataset: value of selected DatasetAcronym. + This method is used to get data of Nodes by selected ResourceTypeAcronym, MasterNetworkName and ScenarioName. + :param selectedResourceType: value of selected ResourceTypeAcronym. :param masterNetworkName: value of selected MasterNetworkName. :param scenarioName: value of selected ScenarioName. :return: list of set of data queried and InstanceName ''' try: - result = self.session.query(sq.Datasets.DatasetAcronym, sq.ObjectTypes.ObjectType, sq.Instances.InstanceName, + result = self.session.query(sq.ResourceTypes.ResourceTypeAcronym, sq.ObjectTypes.ObjectType, sq.Instances.InstanceName, sq.Instances.InstanceNameCV, sq.Scenarios.ScenarioName, sq.Sources.SourceName, sq.Methods.MethodName, sq.InstanceCategories.InstanceCategories, sq.Instances.Longitude_x, sq.Instances.Latitude_y, sq.Instances.Description).\ join(sq.ObjectTypes, - sq.ObjectTypes.DatasetID == sq.Datasets.DatasetID).\ + sq.ObjectTypes.ResourceTypeID == sq.ResourceTypes.ResourceTypeID).\ join(sq.Attributes, sq.Attributes.ObjectTypeID == sq.ObjectTypes.ObjectTypeID).\ join(sq.Mappings, @@ -279,10 +279,10 @@ def getNodes(self, selectedDataset, masterNetworkName, scenarioName): # define.logger.error('Failed metAData load.\n' + e.message) raise Exception('Error occurred in reading Data Structure.\n' + e.message) - def getLinkes(self, selectedDataset, masterNetworkName, scenarioName): + def getLinkes(self, selectedResourceType, masterNetworkName, scenarioName): ''' - This method is used to get data of Linkes by selected DatasetAcronym, MasterNetworkName and ScenarioName. - :param selectedDataset: value of selected DatasetAcronym. + This method is used to get data of Linkes by selected ResourceTypeAcronym, MasterNetworkName and ScenarioName. + :param selectedResourceType: value of selected ResourceTypeAcronym. :param masterNetworkName: value of selected MasterNetworkName. :param scenarioName: value of selected ScenarioName. :return: list of set of data queried @@ -298,13 +298,13 @@ def getLinkes(self, selectedDataset, masterNetworkName, scenarioName): ObjectTypeEndNodeInstance = aliased(sq.ObjectTypes) ObjectTypeStartNodeInstance = aliased(sq.ObjectTypes) MetadataEndNodeInstace = aliased(sq.Mappings) - result = self.session.query(sq.Datasets.DatasetAcronym, sq.ObjectTypes.ObjectType, sq.Instances.InstanceName, + result = self.session.query(sq.ResourceTypes.ResourceTypeAcronym, sq.ObjectTypes.ObjectType, sq.Instances.InstanceName, sq.Instances.InstanceNameCV, sq.Scenarios.ScenarioName, sq.Sources.SourceName, sq.Methods.MethodName, StartInstance.InstanceName, EndInstance.InstanceName, sq.InstanceCategories.InstanceCategories, sq.Instances.Description).\ join(sq.ObjectTypes, - sq.ObjectTypes.DatasetID == sq.Datasets.DatasetID).\ + sq.ObjectTypes.ResourceTypeID == sq.ResourceTypes.ResourceTypeID).\ join(sq.Attributes, sq.Attributes.ObjectTypeID == sq.ObjectTypes.ObjectTypeID).\ join(sq.Mappings, @@ -361,18 +361,18 @@ def getLinkes(self, selectedDataset, masterNetworkName, scenarioName): # define.logger.error('Failed metAData load.\n' + e.message) raise Exception('Error occurred in reading Data Structure.\n' + e.message) - def GetOrganizations(self, selectedDataset): + def GetOrganizations(self, selectedResourceType): ''' - This method is used to get data of Organizations by selected DatasetAcronym. - :param selectedDataset: value of selected DatasetAcronym. + This method is used to get data of Organizations by selected ResourceTypeAcronym. + :param selectedResourceType: value of selected ResourceTypeAcronym. :return: list of set of data queried ''' try: - result = self.session.query(sq.Datasets.DatasetAcronym, sq.Organizations.OrganizationName, sq.Organizations.OrganizationType, + result = self.session.query(sq.ResourceTypes.ResourceTypeAcronym, sq.Organizations.OrganizationName, sq.Organizations.OrganizationType, sq.Organizations.OrganizationWebpage, sq.Organizations.Description).\ - filter(sq.Datasets.DatasetAcronym == selectedDataset).\ + filter(sq.ResourceTypes.ResourceTypeAcronym == selectedResourceType).\ join(sq.Sources, - sq.Sources.SourceID == sq.Datasets.SourceID).\ + sq.Sources.SourceID == sq.ResourceTypes.SourceID).\ join(sq.People, sq.People.PersonID == sq.Sources.PersonID).\ join(sq.Organizations, @@ -396,19 +396,19 @@ def GetOrganizations(self, selectedDataset): # define.logger.error('Failed metAData load.\n' + e.message) raise Exception('Error occurred in reading Data Structure.\n' + e.message) - def GetPeople(self, selectedDataset): + def GetPeople(self, selectedResourceType): ''' - This method is used to get data of People by selected DatasetAcronym. - :param selectedDataset: value of selected DatasetAcronym. + This method is used to get data of People by selected ResourceTypeAcronym. + :param selectedResourceType: value of selected ResourceTypeAcronym. :return: list of set of data queried ''' try: - result = self.session.query(sq.Datasets.DatasetAcronym, sq.People.PersonName, sq.People.Address, + result = self.session.query(sq.ResourceTypes.ResourceTypeAcronym, sq.People.PersonName, sq.People.Address, sq.People.Email, sq.People.Phone, sq.People.PersonWebpage, sq.People.Position).\ - filter(sq.Datasets.DatasetAcronym == selectedDataset).\ + filter(sq.ResourceTypes.ResourceTypeAcronym == selectedResourceType).\ join(sq.Sources, - sq.Sources.SourceID == sq.Datasets.SourceID).\ + sq.Sources.SourceID == sq.ResourceTypes.SourceID).\ join(sq.People, sq.People.PersonID == sq.Sources.PersonID).all() #Get data the remaining data except overlapping PersonName. @@ -431,18 +431,18 @@ def GetPeople(self, selectedDataset): # define.logger.error('Failed metAData load.\n' + e.message) raise Exception('Error occurred in reading Data Structure.\n' + e.message) - def GetSources(self, selectedDataset): + def GetSources(self, selectedResourceType): ''' - This method is used to get data of Sources by selected DatasetAcronym. - :param selectedDataset: value of selected DatasetAcronym. + This method is used to get data of Sources by selected ResourceTypeAcronym. + :param selectedResourceType: value of selected ResourceTypeAcronym. :return: list of set of data queried ''' try: - result = self.session.query(sq.Datasets.DatasetAcronym, sq.Sources.SourceName, sq.Sources.SourceWebpage, + result = self.session.query(sq.ResourceTypes.ResourceTypeAcronym, sq.Sources.SourceName, sq.Sources.SourceWebpage, sq.Sources.SourceCitation, sq.Sources.Description).\ - filter(sq.Datasets.DatasetAcronym == selectedDataset).\ + filter(sq.ResourceTypes.ResourceTypeAcronym == selectedResourceType).\ join(sq.Sources, - sq.Sources.SourceID == sq.Datasets.SourceID).all() + sq.Sources.SourceID == sq.ResourceTypes.SourceID).all() #Get data the remaining data except overlapping SourceName. nameResult = list() dataResult = list() @@ -462,18 +462,18 @@ def GetSources(self, selectedDataset): # define.logger.error('Failed metAData load.\n' + e.message) raise Exception('Error occurred in reading Data Structure.\n' + e.message) - def GetMethods(self, selectedDataset): + def GetMethods(self, selectedResourceType): ''' - This method is used to get data of Methods by selected DatasetAcronym. - :param selectedDataset: value of selected DatasetAcronym. + This method is used to get data of Methods by selected ResourceTypeAcronym. + :param selectedResourceType: value of selected ResourceTypeAcronym. :return: list of set of data queried ''' try: - result = self.session.query(sq.Datasets.DatasetAcronym, sq.Methods.MethodName, sq.Methods.MethodWebpage, + result = self.session.query(sq.ResourceTypes.ResourceTypeAcronym, sq.Methods.MethodName, sq.Methods.MethodWebpage, sq.Methods.MethodCitation, sq.Methods.MethodTypeCV, sq.Methods.Description).\ - filter(sq.Datasets.DatasetAcronym == selectedDataset).\ + filter(sq.ResourceTypes.ResourceTypeAcronym == selectedResourceType).\ join(sq.Sources, - sq.Sources.SourceID == sq.Datasets.SourceID).\ + sq.Sources.SourceID == sq.ResourceTypes.SourceID).\ join(sq.Methods, sq.Sources.PersonID == sq.Methods.PersonID).all() #Get data the remaining data except overlapping MethodName. diff --git a/src_1.0/src_1.0_MacOS_test/controller/wamdamAPI/GetDataValues.py b/src/controller/wamdamAPI/GetDataValues.py similarity index 88% rename from src_1.0/src_1.0_MacOS_test/controller/wamdamAPI/GetDataValues.py rename to src/controller/wamdamAPI/GetDataValues.py index c7caef4..40168f1 100644 --- a/src_1.0/src_1.0_MacOS_test/controller/wamdamAPI/GetDataValues.py +++ b/src/controller/wamdamAPI/GetDataValues.py @@ -90,38 +90,38 @@ def exportDualValuesSheet(self, selectedType, selectedAttribute, selectedInstanc :return: None ''' try: - # result = self.session.query(sq.Datasets.DatasetAcronym, sq.Attributes.AttributeName, sq.Attributes.UnitNameCV, + # result = self.session.query(sq.ResourceTypes.DatasetAcronym, sq.Attributes.AttributeName, sq.Attributes.UnitNameCV, # sq.Instances.InstanceName, sq.MasterNetworks.MasterNetworkName, # sq.Scenarios.ScenarioName, sq.Sources.SourceName, sq.Methods.MethodName, # sq.DualValues.DualValuesValueMeaningCV)\ - # .join(sq.ObjectTypes, sq.ObjectTypes.DatasetID == sq.Datasets.DatasetID)\ + # .join(sq.ObjectTypes, sq.ObjectTypes.ResourceTypeID == sq.ResourceTypes.ResourceTypeID)\ # .join(sq.Attributes, sq.Attributes.ObjectTypeID == sq.ObjectTypes.ObjectTypeID)\ # .join(sq.Mapping, sq.Mapping.AttributeID == sq.Attributes.AttributeID)\ - # .join(sq.DataValuesMapper, sq.DataValuesMapper.DataValuesMapperID == sq.Mapping.DataValuesMapperID)\ + # .join(sq.ValuesMapper, sq.ValuesMapper.ValuesMapperID == sq.Mapping.ValuesMapperID)\ # .join(sq.ScenarioMapping, sq.ScenarioMapping.MappingID == sq.Mapping.MappingID)\ # .join(sq.Scenarios, sq.Scenarios.ScenarioID == sq.ScenarioMapping.ScenarioID)\ # .join(sq.MasterNetworks, sq.MasterNetworks.MasterNetworkID == sq.Scenarios.MasterNetworkID)\ # .join(sq.Methods, sq.Methods.MethodID == sq.Mapping.MethodID)\ # .join(sq.Sources, sq.Sources.SourceID == sq.Mapping.SourceID)\ # .join(sq.Instances, sq.Instances.InstanceID == sq.Mapping.InstanceID)\ - # .join(sq.DualValues, sq.DualValues.DataValuesMapperID == sq.DataValuesMapper.DataValuesMapperID)\ + # .join(sq.DualValues, sq.DualValues.ValuesMapperID == sq.ValuesMapper.ValuesMapperID)\ # .join(sq.CV_DualValueMeaning, sq.CV_DualValueMeaning.Name == sq.DualValues.DualValuesValueMeaningCV)\ # .filter(sq.Attributes.AttributeDataTypeCV=='DualValues')\ # .all() sql = 'SELECT AttributeName, SourceName, InstanceName,MasterNetworkName,ScenarioName,MethodName,dualvaluemeaningCV ' \ - 'FROM "Datasets" '\ - 'Left JOIN "ObjectTypes" ON "ObjectTypes"."DatasetID"="Datasets"."DatasetID" '\ + 'FROM "ResourceTypes" '\ + 'Left JOIN "ObjectTypes" ON "ObjectTypes"."ResourceTypeID"="ResourceTypes"."ResourceTypeID" '\ 'Left JOIN "Attributes" ON "Attributes"."ObjectTypeID"="ObjectTypes"."ObjectTypeID" '\ 'Left JOIN "Mappings" ON "Mappings"."AttributeID"= "Attributes"."AttributeID" '\ - 'Left JOIN "DataValuesMapper" ON "DataValuesMapper"."DataValuesMapperID"="Mappings"."DataValuesMapperID" '\ + 'Left JOIN "ValuesMapper" ON "ValuesMapper"."ValuesMapperID"="Mappings"."ValuesMapperID" '\ 'Left JOIN "ScenarioMappings" ON "ScenarioMappings"."MappingID"="Mappings"."MappingID" '\ 'Left JOIN "Scenarios" ON "Scenarios"."ScenarioID"="ScenarioMappings"."ScenarioID" '\ 'Left JOIN "MasterNetworks" ON "MasterNetworks"."MasterNetworkID"="Scenarios"."MasterNetworkID" '\ 'Left JOIN "Methods" ON "Methods"."MethodID"="Mappings"."MethodID" '\ 'Left JOIN "Sources" ON "Sources"."SourceID"="Mappings"."SourceID" '\ 'Left JOIN "Instances" ON "Instances"."InstanceID"="Mappings"."InstanceID" '\ - 'LEFT JOIN "DualValues" ON "DualValues"."DataValuesMapperID" = "DataValuesMapper"."DataValuesMapperID" '\ + 'LEFT JOIN "DualValues" ON "DualValues"."ValuesMapperID" = "ValuesMapper"."ValuesMapperID" '\ 'LEFT JOIN "CV_DualValueMeaning" ON "CV_DualValueMeaning"."Name"= "DualValues"."dualvaluemeaningCV" '\ 'WHERE "AttributeDataTypeCV"="DualValues" AND "ObjectTypeCV" = "{}" AND "InstanceNameCV" = "{}" AND "AttributeNameCV" = "{}"'\ .format( selectedType, selectedInstance, selectedAttribute) @@ -158,18 +158,18 @@ def exportTextConrolledSheet(self, selectedType, selectedAttribute, selectedInst try: sql = 'SELECT Attributes.AttributeName, ObjectType, SourceName, InstanceName,MasterNetworkName,' \ 'ScenarioName,MethodName,descriptorvalueCV ' \ - 'FROM "Datasets" '\ - 'Left JOIN "ObjectTypes" ON "ObjectTypes"."DatasetID"="Datasets"."DatasetID" '\ + 'FROM "ResourceTypes" '\ + 'Left JOIN "ObjectTypes" ON "ObjectTypes"."ResourceTypeID"="ResourceTypes"."ResourceTypeID" '\ 'Left JOIN "Attributes" ON "Attributes"."ObjectTypeID"="ObjectTypes"."ObjectTypeID" '\ 'Left JOIN "Mappings" ON "Mappings"."AttributeID"= "Attributes"."AttributeID" '\ - 'Left JOIN "DataValuesMapper" ON "DataValuesMapper"."DataValuesMapperID"="Mappings"."DataValuesMapperID" '\ + 'Left JOIN "ValuesMapper" ON "ValuesMapper"."ValuesMapperID"="Mappings"."ValuesMapperID" '\ 'Left JOIN "ScenarioMappings" ON "ScenarioMappings"."MappingID"="Mappings"."MappingID" '\ 'Left JOIN "Scenarios" ON "Scenarios"."ScenarioID"="ScenarioMappings"."ScenarioID" '\ 'Left JOIN "MasterNetworks" ON "MasterNetworks"."MasterNetworkID"="Scenarios"."MasterNetworkID" '\ 'Left JOIN "Methods" ON "Methods"."MethodID"="Mappings"."MethodID" '\ 'Left JOIN "Sources" ON "Sources"."SourceID"="Mappings"."SourceID" '\ 'Left JOIN "Instances" ON "Instances"."InstanceID"="Mappings"."InstanceID" '\ - 'LEFT JOIN "DescriptorValues" ON "DescriptorValues"."DataValuesMapperID" = "DataValuesMapper"."DataValuesMapperID" '\ + 'LEFT JOIN "DescriptorValues" ON "DescriptorValues"."ValuesMapperID" = "ValuesMapper"."ValuesMapperID" '\ 'LEFT JOIN "CV_DescriptorValues" ON "CV_DescriptorValues"."Name"= "DescriptorValues"."descriptorvalueCV" '\ 'WHERE "AttributeDataTypeCV"="DescriptorValues" AND "ObjectTypeCV" = "{}" AND "InstanceNameCV" = "{}" AND "AttributeNameCV" = "{}"'\ .format(selectedType, selectedInstance, selectedAttribute) @@ -205,20 +205,20 @@ def exportNumericValuesheet(self, selectedType, selectedAttribute, selectedInsta :return: None ''' try: - sql = 'SELECT "Datasets"."DatasetName", ObjectType,AttributeName, SourceName, InstanceName,MasterNetworkName,' \ + sql = 'SELECT "ResourceTypes"."DatasetName", ObjectType,AttributeName, SourceName, InstanceName,MasterNetworkName,' \ 'ScenarioName,MethodName, NumericValue ' \ - 'FROM "Datasets" '\ - 'Left JOIN "ObjectTypes" ON "ObjectTypes"."DatasetID"="Datasets"."DatasetID" '\ + 'FROM "ResourceTypes" '\ + 'Left JOIN "ObjectTypes" ON "ObjectTypes"."ResourceTypeID"="ResourceTypes"."ResourceTypeID" '\ 'Left JOIN "Attributes" ON "Attributes"."ObjectTypeID"="ObjectTypes"."ObjectTypeID" '\ 'Left JOIN "Mappings" ON "Mappings"."AttributeID"= "Attributes"."AttributeID" '\ - 'Left JOIN "DataValuesMapper" ON "DataValuesMapper"."DataValuesMapperID"="Mappings"."DataValuesMapperID" '\ + 'Left JOIN "ValuesMapper" ON "ValuesMapper"."ValuesMapperID"="Mappings"."ValuesMapperID" '\ 'Left JOIN "ScenarioMappings" ON "ScenarioMappings"."MappingID"="Mappings"."MappingID" '\ 'Left JOIN "Scenarios" ON "Scenarios"."ScenarioID"="ScenarioMappings"."ScenarioID" '\ 'Left JOIN "MasterNetworks" ON "MasterNetworks"."MasterNetworkID"="Scenarios"."MasterNetworkID" '\ 'Left JOIN "Methods" ON "Methods"."MethodID"="Mappings"."MethodID" '\ 'Left JOIN "Sources" ON "Sources"."SourceID"="Mappings"."SourceID" '\ 'Left JOIN "Instances" ON "Instances"."InstanceID"="Mappings"."InstanceID" '\ - 'LEFT JOIN "NumericValues" ON "NumericValues"."DataValuesMapperID" = "DataValuesMapper"."DataValuesMapperID" '\ + 'LEFT JOIN "NumericValues" ON "NumericValues"."ValuesMapperID" = "ValuesMapper"."ValuesMapperID" '\ 'WHERE "AttributeDataTypeCV"="Parameter" AND "ObjectTypeCV" = "{}" AND "InstanceNameCV" = "{}" AND "AttributeNameCV" = "{}"'\ .format(selectedType, selectedInstance, selectedAttribute) @@ -254,18 +254,18 @@ def exportElectronicFilesSheet(self, selectedType, selectedAttribute, selectedIn try: sql = 'SELECT ObjectType, AttributeName, SourceName, InstanceName,MasterNetworkName,' \ 'ScenarioName,MethodName,FileName, ElectronicFileFormatCV, "File"."Description" ' \ - 'FROM "Datasets" '\ - 'Left JOIN "ObjectTypes" ON "ObjectTypes"."DatasetID"="Datasets"."DatasetID" '\ + 'FROM "ResourceTypes" '\ + 'Left JOIN "ObjectTypes" ON "ObjectTypes"."ResourceTypeID"="ResourceTypes"."ResourceTypeID" '\ 'Left JOIN "Attributes" ON "Attributes"."ObjectTypeID"="ObjectTypes"."ObjectTypeID" '\ 'Left JOIN "Mappings" ON "Mappings"."AttributeID"= "Attributes"."AttributeID" '\ - 'Left JOIN "DataValuesMapper" ON "DataValuesMapper"."DataValuesMapperID"="Mappings"."DataValuesMapperID" '\ + 'Left JOIN "ValuesMapper" ON "ValuesMapper"."ValuesMapperID"="Mappings"."ValuesMapperID" '\ 'Left JOIN "ScenarioMappings" ON "ScenarioMappings"."MappingID"="Mappings"."MappingID" '\ 'Left JOIN "Scenarios" ON "Scenarios"."ScenarioID"="ScenarioMappings"."ScenarioID" '\ 'Left JOIN "MasterNetworks" ON "MasterNetworks"."MasterNetworkID"="Scenarios"."MasterNetworkID" '\ 'Left JOIN "Methods" ON "Methods"."MethodID"="Mappings"."MethodID" '\ 'Left JOIN "Sources" ON "Sources"."SourceID"="Mappings"."SourceID" '\ 'Left JOIN "Instances" ON "Instances"."InstanceID"="Mappings"."InstanceID" '\ - 'LEFT JOIN "File" ON "File"."DataValuesMapperID" = "DataValuesMapper"."DataValuesMapperID" '\ + 'LEFT JOIN "File" ON "File"."ValuesMapperID" = "ValuesMapper"."ValuesMapperID" '\ 'Left JOIN "CV_ElectronicFormat" ON "CV_ElectronicFormat"."Name"="File"."ElectronicFileFormatCV" '\ 'WHERE "AttributeDataTypeCV"="File" AND "ObjectTypeCV" = "{}" AND "InstanceNameCV" = "{}" AND "AttributeNameCV" = "{}"'\ .format(selectedType, selectedInstance, selectedAttribute) @@ -305,14 +305,14 @@ def exportSeasonalSheet(self, selectedType, selectedAttribute, selectedInstance, 'FROM "Attributes" '\ 'Left JOIN "ObjectTypes" ON "Attributes"."ObjectTypeID"="ObjectTypes"."ObjectTypeID" '\ 'Left JOIN "Mappings" ON "Mappings"."AttributeID"= "Attributes"."AttributeID" '\ - 'Left JOIN "DataValuesMapper" ON "DataValuesMapper"."DataValuesMapperID"="Mappings"."DataValuesMapperID" '\ + 'Left JOIN "ValuesMapper" ON "ValuesMapper"."ValuesMapperID"="Mappings"."ValuesMapperID" '\ 'Left JOIN "ScenarioMappings" ON "ScenarioMappings"."MappingID"="Mappings"."MappingID" '\ 'Left JOIN "Scenarios" ON "Scenarios"."ScenarioID"="ScenarioMappings"."ScenarioID" '\ 'Left JOIN "MasterNetworks" ON "MasterNetworks"."MasterNetworkID"="Scenarios"."MasterNetworkID" '\ 'Left JOIN "Methods" ON "Methods"."MethodID"="Mappings"."MethodID" '\ 'Left JOIN "Sources" ON "Sources"."SourceID"="Mappings"."SourceID" '\ 'Left JOIN "Instances" ON "Instances"."InstanceID"="Mappings"."InstanceID" '\ - 'LEFT JOIN "SeasonalParameters" ON "SeasonalParameters"."DataValuesMapperID" = "DataValuesMapper"."DataValuesMapperID" '\ + 'LEFT JOIN "SeasonalParameters" ON "SeasonalParameters"."ValuesMapperID" = "ValuesMapper"."ValuesMapperID" '\ 'WHERE "AttributeDataTypeCV"="SeasonalParameter" AND "ObjectTypeCV" = "{}" AND "InstanceNameCV" = "{}" AND "AttributeNameCV" = "{}"'\ .format(selectedType, selectedInstance, selectedAttribute) @@ -349,18 +349,18 @@ def exportTimeSeriesSheet(self, selectedType, selectedAttribute, selectedInstanc sql = 'SELECT DatasetName ObjectType, AttributeName, SourceName, InstanceName,WaterOrCalendarYear,' \ 'ScenarioName,MethodName,AggregationStatisticCV, AggregationInterval, IntervalTimeUnitCV,' \ 'IsRegular, NoDataValue, "TimeSeries"."Description" ' \ - 'FROM "Datasets" '\ - 'Left JOIN "ObjectTypes" ON "ObjectTypes"."DatasetID"="Datasets"."DatasetID" '\ + 'FROM "ResourceTypes" '\ + 'Left JOIN "ObjectTypes" ON "ObjectTypes"."ResourceTypeID"="ResourceTypes"."ResourceTypeID" '\ 'Left JOIN "Attributes" ON "Attributes"."ObjectTypeID"="ObjectTypes"."ObjectTypeID" '\ 'Left JOIN "Mappings" ON "Mappings"."AttributeID"= "Attributes"."AttributeID" '\ - 'Left JOIN "DataValuesMapper" ON "DataValuesMapper"."DataValuesMapperID"="Mappings"."DataValuesMapperID" '\ + 'Left JOIN "ValuesMapper" ON "ValuesMapper"."ValuesMapperID"="Mappings"."ValuesMapperID" '\ 'Left JOIN "ScenarioMappings" ON "ScenarioMappings"."MappingID"="Mappings"."MappingID" '\ 'Left JOIN "Scenarios" ON "Scenarios"."ScenarioID"="ScenarioMappings"."ScenarioID" '\ 'Left JOIN "MasterNetworks" ON "MasterNetworks"."MasterNetworkID"="Scenarios"."MasterNetworkID" '\ 'Left JOIN "Methods" ON "Methods"."MethodID"="Mappings"."MethodID" '\ 'Left JOIN "Sources" ON "Sources"."SourceID"="Mappings"."SourceID" '\ 'Left JOIN "Instances" ON "Instances"."InstanceID"="Mappings"."InstanceID" '\ - 'LEFT JOIN "TimeSeries" ON "TimeSeries"."DataValuesMapperID" = "DataValuesMapper"."DataValuesMapperID" '\ + 'LEFT JOIN "TimeSeries" ON "TimeSeries"."ValuesMapperID" = "ValuesMapper"."ValuesMapperID" '\ 'WHERE AttributeName!="ObjectInstances" AND AttributeDataTypeCV="TimeSeries" ' \ ' AND "ObjectTypeCV" = "{}" AND "InstanceNameCV" = "{}" AND "AttributeNameCV" = "{}"'\ .format(selectedType, selectedInstance, selectedAttribute) @@ -399,18 +399,18 @@ def exportTextFreeSheet(self, selectedType, selectedAttribute, selectedInstance, try: sql = 'SELECT DatasetName ObjectType, AttributeName, SourceName, InstanceName,TextFreeValue,' \ 'ScenarioName,MethodName ' \ - 'FROM "Datasets" '\ - 'Left JOIN "ObjectTypes" ON "ObjectTypes"."DatasetID"="Datasets"."DatasetID" '\ + 'FROM "ResourceTypes" '\ + 'Left JOIN "ObjectTypes" ON "ObjectTypes"."ResourceTypeID"="ResourceTypes"."ResourceTypeID" '\ 'Left JOIN "Attributes" ON "Attributes"."ObjectTypeID"="ObjectTypes"."ObjectTypeID" '\ 'Left JOIN "Mappings" ON "Mappings"."AttributeID"= "Attributes"."AttributeID" '\ - 'Left JOIN "DataValuesMapper" ON "DataValuesMapper"."DataValuesMapperID"="Mappings"."DataValuesMapperID" '\ + 'Left JOIN "ValuesMapper" ON "ValuesMapper"."ValuesMapperID"="Mappings"."ValuesMapperID" '\ 'Left JOIN "ScenarioMappings" ON "ScenarioMappings"."MappingID"="Mappings"."MappingID" '\ 'Left JOIN "Scenarios" ON "Scenarios"."ScenarioID"="ScenarioMappings"."ScenarioID" '\ 'Left JOIN "MasterNetworks" ON "MasterNetworks"."MasterNetworkID"="Scenarios"."MasterNetworkID" '\ 'Left JOIN "Methods" ON "Methods"."MethodID"="Mappings"."MethodID" '\ 'Left JOIN "Sources" ON "Sources"."SourceID"="Mappings"."SourceID" '\ 'Left JOIN "Instances" ON "Instances"."InstanceID"="Mappings"."InstanceID" '\ - 'LEFT JOIN "TextFree" ON "TextFree"."DataValuesMapperID" = "DataValuesMapper"."DataValuesMapperID" '\ + 'LEFT JOIN "TextFree" ON "TextFree"."ValuesMapperID" = "ValuesMapper"."ValuesMapperID" '\ 'WHERE AttributeDataTypeCV="TextFree" ' \ ' AND "ObjectTypeCV" = "{}" AND "InstanceNameCV" = "{}" AND "AttributeNameCV" = "{}"'\ .format(selectedType, selectedInstance, selectedAttribute) @@ -446,20 +446,20 @@ def exportMultiSheet(self, selectedType, selectedAttribute, selectedInstance, ex try: sql = 'SELECT "ObjectTypes"."ObjectType", "Attributes"."AttributeName", SourceName, InstanceName,' \ 'ScenarioName,MethodName, "AttributesColumns"."AttributeName" AS "ColumName", "AttributesColumns"."UnitNameCV" AS "ColUnitName", "Value","ValueOrder" '\ - 'FROM "Datasets" '\ - 'Left JOIN "ObjectTypes" ON "ObjectTypes"."DatasetID"="Datasets"."DatasetID" '\ + 'FROM "ResourceTypes" '\ + 'Left JOIN "ObjectTypes" ON "ObjectTypes"."ResourceTypeID"="ResourceTypes"."ResourceTypeID" '\ 'Left JOIN "Attributes" ON "Attributes"."ObjectTypeID"="ObjectTypes"."ObjectTypeID" '\ 'Left JOIN "Mappings" ON "Mappings"."AttributeID"= "Attributes"."AttributeID" '\ - 'Left JOIN "DataValuesMapper" ON "DataValuesMapper"."DataValuesMapperID"="Mappings"."DataValuesMapperID" '\ + 'Left JOIN "ValuesMapper" ON "ValuesMapper"."ValuesMapperID"="Mappings"."ValuesMapperID" '\ 'Left JOIN "ScenarioMappings" ON "ScenarioMappings"."MappingID"="Mappings"."MappingID" '\ 'Left JOIN "Scenarios" ON "Scenarios"."ScenarioID"="ScenarioMappings"."ScenarioID" '\ 'Left JOIN "MasterNetworks" ON "MasterNetworks"."MasterNetworkID"="Scenarios"."MasterNetworkID" '\ 'Left JOIN "Methods" ON "Methods"."MethodID"="Mappings"."MethodID" '\ 'Left JOIN "Sources" ON "Sources"."SourceID"="Mappings"."SourceID" '\ 'Left JOIN "Instances" ON "Instances"."InstanceID"="Mappings"."InstanceID" '\ - 'Left JOIN "MultiAttributeSeries" ON "MultiAttributeSeries"."DataValuesMapperID"="DataValuesMapper"."DataValuesMapperID" '\ - 'Left JOIN "DataValuesMapper" As "DataValuesMapperColumn" ON "DataValuesMapperColumn"."DataValuesMapperID"="MultiAttributeSeries"."AttriNameID" '\ - 'Left JOIN "Mappings" As "MappingColumns" ON "MappingColumns"."DataValuesMapperID"="DataValuesMapperColumn"."DataValuesMapperID" '\ + 'Left JOIN "MultiAttributeSeries" ON "MultiAttributeSeries"."ValuesMapperID"="ValuesMapper"."ValuesMapperID" '\ + 'Left JOIN "ValuesMapper" As "ValuesMapperColumn" ON "ValuesMapperColumn"."ValuesMapperID"="MultiAttributeSeries"."AttriNameID" '\ + 'Left JOIN "Mappings" As "MappingColumns" ON "MappingColumns"."ValuesMapperID"="ValuesMapperColumn"."ValuesMapperID" '\ 'Left JOIN "Attributes" AS "AttributesColumns" ON "AttributesColumns"."AttributeID"="MappingColumns"."AttributeID" '\ 'Left JOIN "MultiAttributeSeriesValues" ON "MultiAttributeSeriesValues"."MultiAttributeSeriesID"="MultiAttributeSeries"."MultiAttributeSeriesID" '\ 'WHERE Attributes.AttributeDataTypeCV="MultiAttributeSeries" '\ @@ -546,20 +546,20 @@ def exportDualValuesSheet1(self, selectedDataset, selectedNetwork, selectedScena try: sql = 'SELECT AttributeName, SourceName, InstanceName,MasterNetworkName,ScenarioName,MethodName,dualvaluemeaningCV ' \ - 'FROM "Datasets" '\ - 'Left JOIN "ObjectTypes" ON "ObjectTypes"."DatasetID"="Datasets"."DatasetID" '\ + 'FROM "ResourceTypes" '\ + 'Left JOIN "ObjectTypes" ON "ObjectTypes"."ResourceTypeID"="ResourceTypes"."ResourceTypeID" '\ 'Left JOIN "Attributes" ON "Attributes"."ObjectTypeID"="ObjectTypes"."ObjectTypeID" '\ 'Left JOIN "Mappings" ON "Mappings"."AttributeID"= "Attributes"."AttributeID" '\ - 'Left JOIN "DataValuesMapper" ON "DataValuesMapper"."DataValuesMapperID"="Mappings"."DataValuesMapperID" '\ + 'Left JOIN "ValuesMapper" ON "ValuesMapper"."ValuesMapperID"="Mappings"."ValuesMapperID" '\ 'Left JOIN "ScenarioMappings" ON "ScenarioMappings"."MappingID"="Mappings"."MappingID" '\ 'Left JOIN "Scenarios" ON "Scenarios"."ScenarioID"="ScenarioMappings"."ScenarioID" '\ 'Left JOIN "MasterNetworks" ON "MasterNetworks"."MasterNetworkID"="Scenarios"."MasterNetworkID" '\ 'Left JOIN "Methods" ON "Methods"."MethodID"="Mappings"."MethodID" '\ 'Left JOIN "Sources" ON "Sources"."SourceID"="Mappings"."SourceID" '\ 'Left JOIN "Instances" ON "Instances"."InstanceID"="Mappings"."InstanceID" '\ - 'LEFT JOIN "DualValues" ON "DualValues"."DataValuesMapperID" = "DataValuesMapper"."DataValuesMapperID" '\ + 'LEFT JOIN "DualValues" ON "DualValues"."ValuesMapperID" = "ValuesMapper"."ValuesMapperID" '\ 'LEFT JOIN "CV_DualValueMeaning" ON "CV_DualValueMeaning"."Name"= "DualValues"."dualvaluemeaningCV" '\ - 'WHERE "Attributes"."AttributeDataTypeCV"="DualValues" AND "Datasets"."DatasetAcronym" = "{}" AND "MasterNetworkName" = "{}" AND "ScenarioName" = "{}"'\ + 'WHERE "Attributes"."AttributeDataTypeCV"="DualValues" AND "ResourceTypes"."DatasetAcronym" = "{}" AND "MasterNetworkName" = "{}" AND "ScenarioName" = "{}"'\ .format(selectedDataset, selectedNetwork, selectedScenarior) result = self.session.execute(sql) @@ -595,20 +595,20 @@ def exportTextConrolledSheet1(self, selectedDataset, selectedNetwork, selectedSc try: sql = 'SELECT Attributes.AttributeName, ObjectType, SourceName, InstanceName,MasterNetworkName,' \ 'ScenarioName,MethodName,descriptorvalueCV ' \ - 'FROM "Datasets" '\ - 'Left JOIN "ObjectTypes" ON "ObjectTypes"."DatasetID"="Datasets"."DatasetID" '\ + 'FROM "ResourceTypes" '\ + 'Left JOIN "ObjectTypes" ON "ObjectTypes"."ResourceTypeID"="ResourceTypes"."ResourceTypeID" '\ 'Left JOIN "Attributes" ON "Attributes"."ObjectTypeID"="ObjectTypes"."ObjectTypeID" '\ 'Left JOIN "Mappings" ON "Mappings"."AttributeID"= "Attributes"."AttributeID" '\ - 'Left JOIN "DataValuesMapper" ON "DataValuesMapper"."DataValuesMapperID"="Mappings"."DataValuesMapperID" '\ + 'Left JOIN "ValuesMapper" ON "ValuesMapper"."ValuesMapperID"="Mappings"."ValuesMapperID" '\ 'Left JOIN "ScenarioMappings" ON "ScenarioMappings"."MappingID"="Mappings"."MappingID" '\ 'Left JOIN "Scenarios" ON "Scenarios"."ScenarioID"="ScenarioMappings"."ScenarioID" '\ 'Left JOIN "MasterNetworks" ON "MasterNetworks"."MasterNetworkID"="Scenarios"."MasterNetworkID" '\ 'Left JOIN "Methods" ON "Methods"."MethodID"="Mappings"."MethodID" '\ 'Left JOIN "Sources" ON "Sources"."SourceID"="Mappings"."SourceID" '\ 'Left JOIN "Instances" ON "Instances"."InstanceID"="Mappings"."InstanceID" '\ - 'LEFT JOIN "DescriptorValues" ON "DescriptorValues"."DataValuesMapperID" = "DataValuesMapper"."DataValuesMapperID" '\ + 'LEFT JOIN "DescriptorValues" ON "DescriptorValues"."ValuesMapperID" = "ValuesMapper"."ValuesMapperID" '\ 'LEFT JOIN "CV_DescriptorValues" ON "CV_DescriptorValues"."Name"= "DescriptorValues"."descriptorvalueCV" '\ - 'WHERE "Attributes"."AttributeDataTypeCV"="DescriptorValues" AND "Datasets"."DatasetAcronym" = "{}" AND "MasterNetworkName" = "{}" AND "ScenarioName" = "{}"'\ + 'WHERE "Attributes"."AttributeDataTypeCV"="DescriptorValues" AND "ResourceTypes"."DatasetAcronym" = "{}" AND "MasterNetworkName" = "{}" AND "ScenarioName" = "{}"'\ .format(selectedDataset, selectedNetwork, selectedScenarior) result = self.session.execute(sql) @@ -641,21 +641,21 @@ def exportNumericValuesheet1(self, selectedDataset, selectedNetwork, selectedSce :return: None ''' try: - sql = 'SELECT "Datasets"."DatasetName", ObjectType,AttributeName, SourceName, InstanceName,MasterNetworkName,' \ + sql = 'SELECT "ResourceTypes"."DatasetName", ObjectType,AttributeName, SourceName, InstanceName,MasterNetworkName,' \ 'ScenarioName,MethodName, NumericValue ' \ - 'FROM "Datasets" '\ - 'Left JOIN "ObjectTypes" ON "ObjectTypes"."DatasetID"="Datasets"."DatasetID" '\ + 'FROM "ResourceTypes" '\ + 'Left JOIN "ObjectTypes" ON "ObjectTypes"."ResourceTypeID"="ResourceTypes"."ResourceTypeID" '\ 'Left JOIN "Attributes" ON "Attributes"."ObjectTypeID"="ObjectTypes"."ObjectTypeID" '\ 'Left JOIN "Mappings" ON "Mappings"."AttributeID"= "Attributes"."AttributeID" '\ - 'Left JOIN "DataValuesMapper" ON "DataValuesMapper"."DataValuesMapperID"="Mappings"."DataValuesMapperID" '\ + 'Left JOIN "ValuesMapper" ON "ValuesMapper"."ValuesMapperID"="Mappings"."ValuesMapperID" '\ 'Left JOIN "ScenarioMappings" ON "ScenarioMappings"."MappingID"="Mappings"."MappingID"'\ 'Left JOIN "Scenarios" ON "Scenarios"."ScenarioID"="ScenarioMappings"."ScenarioID" '\ 'Left JOIN "MasterNetworks" ON "MasterNetworks"."MasterNetworkID"="Scenarios"."MasterNetworkID" '\ 'Left JOIN "Methods" ON "Methods"."MethodID"="Mappings"."MethodID" '\ 'Left JOIN "Sources" ON "Sources"."SourceID"="Mappings"."SourceID" '\ 'Left JOIN "Instances" ON "Instances"."InstanceID"="Mappings"."InstanceID" '\ - 'LEFT JOIN "NumericValues" ON "NumericValues"."DataValuesMapperID" = "DataValuesMapper"."DataValuesMapperID" '\ - 'WHERE "Attributes"."AttributeDataTypeCV"="Parameter" AND "Datasets"."DatasetAcronym" = "{}" AND "MasterNetworkName" = "{}" AND "ScenarioName" = "{}"'\ + 'LEFT JOIN "NumericValues" ON "NumericValues"."ValuesMapperID" = "ValuesMapper"."ValuesMapperID" '\ + 'WHERE "Attributes"."AttributeDataTypeCV"="Parameter" AND "ResourceTypes"."DatasetAcronym" = "{}" AND "MasterNetworkName" = "{}" AND "ScenarioName" = "{}"'\ .format(selectedDataset, selectedNetwork, selectedScenarior) result = self.session.execute(sql) @@ -690,20 +690,20 @@ def exportElectronicFilesSheet1(self, selectedDataset, selectedNetwork, selected try: sql = 'SELECT ObjectType, AttributeName, SourceName, InstanceName,MasterNetworkName,' \ 'ScenarioName,MethodName,FileName, ElectronicFileFormatCV, "File"."Description" ' \ - 'FROM "Datasets" '\ - 'Left JOIN "ObjectTypes" ON "ObjectTypes"."DatasetID"="Datasets"."DatasetID" '\ + 'FROM "ResourceTypes" '\ + 'Left JOIN "ObjectTypes" ON "ObjectTypes"."ResourceTypeID"="ResourceTypes"."ResourceTypeID" '\ 'Left JOIN "Attributes" ON "Attributes"."ObjectTypeID"="ObjectTypes"."ObjectTypeID" '\ 'Left JOIN "Mappings" ON "Mappings"."AttributeID"= "Attributes"."AttributeID" '\ - 'Left JOIN "DataValuesMapper" ON "DataValuesMapper"."DataValuesMapperID"="Mappings"."DataValuesMapperID" '\ + 'Left JOIN "ValuesMapper" ON "ValuesMapper"."ValuesMapperID"="Mappings"."ValuesMapperID" '\ 'Left JOIN "ScenarioMappings" ON "ScenarioMappings"."MappingID"="Mappings"."MappingID" '\ 'Left JOIN "Scenarios" ON "Scenarios"."ScenarioID"="ScenarioMappings"."ScenarioID" '\ 'Left JOIN "MasterNetworks" ON "MasterNetworks"."MasterNetworkID"="Scenarios"."MasterNetworkID" '\ 'Left JOIN "Methods" ON "Methods"."MethodID"="Mappings"."MethodID" '\ 'Left JOIN "Sources" ON "Sources"."SourceID"="Mappings"."SourceID" '\ 'Left JOIN "Instances" ON "Instances"."InstanceID"="Mappings"."InstanceID" '\ - 'LEFT JOIN "Files" ON "File"."DataValuesMapperID" = "DataValuesMapper"."DataValuesMapperID" '\ + 'LEFT JOIN "Files" ON "File"."ValuesMapperID" = "ValuesMapper"."ValuesMapperID" '\ 'Left JOIN "CV_ElectronicFormat" ON "CV_ElectronicFormat"."Name"="File"."ElectronicFileFormatCV" '\ - 'WHERE "Attributes"."AttributeDataTypeCV"="File" AND "Datasets"."DatasetAcronym" = "{}" AND "MasterNetworkName" = "{}" AND "ScenarioName" = "{}"'\ + 'WHERE "Attributes"."AttributeDataTypeCV"="File" AND "ResourceTypes"."DatasetAcronym" = "{}" AND "MasterNetworkName" = "{}" AND "ScenarioName" = "{}"'\ .format(selectedDataset, selectedNetwork, selectedScenarior) result = self.session.execute(sql) @@ -742,14 +742,14 @@ def exportSeasonalSheet1(self, selectedDataset, selectedNetwork, selectedScenari 'FROM "Attributes" '\ 'Left JOIN "ObjectTypes" ON "Attributes"."ObjectTypeID"="ObjectTypes"."ObjectTypeID" '\ 'Left JOIN "Mappings" ON "Mappings"."AttributeID"= "Attributes"."AttributeID" '\ - 'Left JOIN "DataValuesMapper" ON "DataValuesMapper"."DataValuesMapperID"="Mappings"."DataValuesMapperID" '\ + 'Left JOIN "ValuesMapper" ON "ValuesMapper"."ValuesMapperID"="Mappings"."ValuesMapperID" '\ 'Left JOIN "ScenarioMappings" ON "ScenarioMappings"."MappingID"="Mappings"."MappingID" '\ 'Left JOIN "Scenarios" ON "Scenarios"."ScenarioID"="ScenarioMappings"."ScenarioID" '\ 'Left JOIN "MasterNetworks" ON "MasterNetworks"."MasterNetworkID"="Scenarios"."MasterNetworkID" '\ 'Left JOIN "Methods" ON "Methods"."MethodID"="Mappings"."MethodID" '\ 'Left JOIN "Sources" ON "Sources"."SourceID"="Mappings"."SourceID" '\ 'Left JOIN "Instances" ON "Instances"."InstanceID"="Mappings"."InstanceID" '\ - 'LEFT JOIN "SeasonalParameters" ON "SeasonalParameters"."DataValuesMapperID" = "DataValuesMapper"."DataValuesMapperID" '\ + 'LEFT JOIN "SeasonalParameters" ON "SeasonalParameters"."ValuesMapperID" = "ValuesMapper"."ValuesMapperID" '\ 'WHERE "AttributeDataTypeCV"="SeasonalParameter" AND "MasterNetworkName" = "{}" AND "ScenarioName" = "{}"'\ .format(selectedNetwork, selectedScenarior) @@ -786,18 +786,18 @@ def exportTimeSeriesSheet1(self, selectedDataset, selectedNetwork, selectedScena sql = 'SELECT DatasetName ObjectType, AttributeName, SourceName, InstanceName,WaterOrCalendarYear,' \ 'ScenarioName,MethodName,AggregationStatisticCV, AggregationInterval, IntervalTimeUnitCV,' \ 'IsRegular, NoDataValue, "TimeSeries"."Description" ' \ - 'FROM "Datasets" '\ - 'Left JOIN "ObjectTypes" ON "ObjectTypes"."DatasetID"="Datasets"."DatasetID" '\ + 'FROM "ResourceTypes" '\ + 'Left JOIN "ObjectTypes" ON "ObjectTypes"."ResourceTypeID"="ResourceTypes"."ResourceTypeID" '\ 'Left JOIN "Attributes" ON "Attributes"."ObjectTypeID"="ObjectTypes"."ObjectTypeID" '\ 'Left JOIN "Mappings" ON "Mappings"."AttributeID"= "Attributes"."AttributeID" '\ - 'Left JOIN "DataValuesMapper" ON "DataValuesMapper"."DataValuesMapperID"="Mappings"."DataValuesMapperID" '\ + 'Left JOIN "ValuesMapper" ON "ValuesMapper"."ValuesMapperID"="Mappings"."ValuesMapperID" '\ 'Left JOIN "ScenarioMappings" ON "ScenarioMappings"."MappingID"="Mappings"."MappingID" '\ 'Left JOIN "Scenarios" ON "Scenarios"."ScenarioID"="ScenarioMappings"."ScenarioID" '\ 'Left JOIN "MasterNetworks" ON "MasterNetworks"."MasterNetworkID"="Scenarios"."MasterNetworkID" '\ 'Left JOIN "Methods" ON "Methods"."MethodID"="Mappings"."MethodID" '\ 'Left JOIN "Sources" ON "Sources"."SourceID"="Mappings"."SourceID" '\ 'Left JOIN "Instances" ON "Instances"."InstanceID"="Mappings"."InstanceID" '\ - 'LEFT JOIN "TimeSeries" ON "TimeSeries"."DataValuesMapperID" = "DataValuesMapper"."DataValuesMapperID" '\ + 'LEFT JOIN "TimeSeries" ON "TimeSeries"."ValuesMapperID" = "ValuesMapper"."ValuesMapperID" '\ 'WHERE AttributeName!="ObjectInstances" AND AttributeDataTypeCV="TimeSeries" ' \ 'AND "DatasetAcronym" = "{}" AND "MasterNetworkName" = "{}" AND "ScenarioName" = "{}"'\ .format(selectedDataset, selectedNetwork, selectedScenarior) @@ -836,20 +836,20 @@ def exportMultiSheet1(self, selectedDataset, selectedNetwork, selectedScenarior, try: sql = 'SELECT "ObjectTypes"."ObjectType", "Attributes"."AttributeName", SourceName, InstanceName,' \ 'ScenarioName,MethodName, "AttributesColumns"."AttributeName" AS "ColumName", "AttributesColumns"."UnitNameCV" AS "ColUnitName", "Value","ValueOrder" '\ - 'FROM "Datasets" '\ - 'Left JOIN "ObjectTypes" ON "ObjectTypes"."DatasetID"="Datasets"."DatasetID" '\ + 'FROM "ResourceTypes" '\ + 'Left JOIN "ObjectTypes" ON "ObjectTypes"."ResourceTypeID"="ResourceTypes"."ResourceTypeID" '\ 'Left JOIN "Attributes" ON "Attributes"."ObjectTypeID"="ObjectTypes"."ObjectTypeID" '\ 'Left JOIN "Mappings" ON "Mappings"."AttributeID"= "Attributes"."AttributeID" '\ - 'Left JOIN "DataValuesMapper" ON "DataValuesMapper"."DataValuesMapperID"="Mappings"."DataValuesMapperID" '\ + 'Left JOIN "ValuesMapper" ON "ValuesMapper"."ValuesMapperID"="Mappings"."ValuesMapperID" '\ 'Left JOIN "ScenarioMappings" ON "ScenarioMappings"."MappingID"="Mappings"."MappingID" '\ 'Left JOIN "Scenarios" ON "Scenarios"."ScenarioID"="ScenarioMappings"."ScenarioID" '\ 'Left JOIN "MasterNetworks" ON "MasterNetworks"."MasterNetworkID"="Scenarios"."MasterNetworkID" '\ 'Left JOIN "Methods" ON "Methods"."MethodID"="Mappings"."MethodID" '\ 'Left JOIN "Sources" ON "Sources"."SourceID"="Mappings"."SourceID" '\ 'Left JOIN "Instances" ON "Instances"."InstanceID"="Mappings"."InstanceID" '\ - 'Left JOIN "MultiAttributeSeries" ON "MultiAttributeSeries"."DataValuesMapperID"="DataValuesMapper"."DataValuesMapperID" '\ - 'Left JOIN "DataValuesMapper" As "DataValuesMapperColumn" ON "DataValuesMapperColumn"."DataValuesMapperID"="MultiAttributeSeries"."AttriNameID" '\ - 'Left JOIN "Mappings" As "MappingColumns" ON "MappingColumns"."DataValuesMapperID"="DataValuesMapperColumn"."DataValuesMapperID" '\ + 'Left JOIN "MultiAttributeSeries" ON "MultiAttributeSeries"."ValuesMapperID"="ValuesMapper"."ValuesMapperID" '\ + 'Left JOIN "ValuesMapper" As "ValuesMapperColumn" ON "ValuesMapperColumn"."ValuesMapperID"="MultiAttributeSeries"."AttriNameID" '\ + 'Left JOIN "Mappings" As "MappingColumns" ON "MappingColumns"."ValuesMapperID"="ValuesMapperColumn"."ValuesMapperID" '\ 'Left JOIN "Attributes" AS "AttributesColumns" ON "AttributesColumns"."AttributeID"="MappingColumns"."AttributeID" '\ 'Left JOIN "MultiAttributeSeriesValues" ON "MultiAttributeSeriesValues"."MultiAttributeSeriesID"="MultiAttributeSeries"."MultiAttributeSeriesID" '\ 'WHERE Attributes.AttributeDataTypeCV="MultiAttributeSeries" '\ diff --git a/src_1.0/controller/wamdamAPI/GetMetadata.py b/src/controller/wamdamAPI/GetMetadata.py similarity index 100% rename from src_1.0/controller/wamdamAPI/GetMetadata.py rename to src/controller/wamdamAPI/GetMetadata.py diff --git a/src_1.0/src_1.0_MacOS_test/controller/wamdamAPI/GetNodeLinks.py b/src/controller/wamdamAPI/GetNodeLinks.py similarity index 93% rename from src_1.0/src_1.0_MacOS_test/controller/wamdamAPI/GetNodeLinks.py rename to src/controller/wamdamAPI/GetNodeLinks.py index d233abd..f0937b4 100644 --- a/src_1.0/src_1.0_MacOS_test/controller/wamdamAPI/GetNodeLinks.py +++ b/src/controller/wamdamAPI/GetNodeLinks.py @@ -40,11 +40,11 @@ def getMasterNetwork(self, CV_ObjectType, xmin, ymin, xmax, ymax): :return: list of row (queried) ''' try: - result = self.session.query(sq.Datasets.DatasetAcronym, sq.ObjectTypes.ObjectType, sq.Attributes.AttributeName, + result = self.session.query(sq.ResourceTypes.ResourceTypeAcronym, sq.ObjectTypes.ObjectType, sq.Attributes.AttributeName, sq.Instances.InstanceName, sq.MasterNetworks.MasterNetworkName, sq.MasterNetworks.SpatialReferenceNameCV, sq.Scenarios.ScenarioName, sq.MasterNetworks.VerticalDatumCV, sq.MasterNetworks.Description, sq.Sources.SourceName, sq.Methods.MethodName)\ - .join(sq.ObjectTypes, sq.ObjectTypes.DatasetID == sq.Datasets.DatasetID)\ + .join(sq.ObjectTypes, sq.ObjectTypes.ResourceTypeID == sq.ResourceTypes.ResourceTypeID)\ .join(sq.Attributes, sq.Attributes.ObjectTypeID == sq.ObjectTypes.ObjectTypeID)\ .join(sq.Mappings, sq.Mappings.AttributeID == sq.Attributes.AttributeID)\ .join(sq.Instances, sq.Instances.InstanceID == sq.Mappings.InstanceID)\ @@ -68,7 +68,7 @@ def getMasterNetwork(self, CV_ObjectType, xmin, ymin, xmax, ymax): break if not isExisting: nameResult.append(row.MasterNetworkName) - complete_result.append([row.MasterNetworkName, row.DatasetAcronym, row.SpatialReferenceNameCV, + complete_result.append([row.MasterNetworkName, row.ResourceTypeAcronym, row.SpatialReferenceNameCV, row.VerticalDatumCV, row.Description]) return complete_result except Exception as e: @@ -85,13 +85,13 @@ def GetScenaroisResult(self, CV_ObjectType, xmin, ymin, xmax, ymax): :return: list of row (queried) ''' try: - result = self.session.query(sq.Datasets.DatasetAcronym, sq.ObjectTypes.ObjectType, sq.ObjectTypes.ObjectTypeCV, + result = self.session.query(sq.ResourceTypes.ResourceTypeAcronym, sq.ObjectTypes.ObjectType, sq.ObjectTypes.ObjectTypeCV, sq.ObjectTypes.ObjectTypologyCV, sq.Attributes.AttributeName, sq.Instances.InstanceName, sq.Scenarios.ScenarioStartDate, sq.Scenarios.ScenarioEndDate, sq.Scenarios.Description, sq.Scenarios.TimeStepValue, sq.Scenarios.TimeStepUnitCV, sq.MasterNetworks.MasterNetworkName, sq.Scenarios.ScenarioName, sq.Sources.SourceName, sq.Methods.MethodName)\ - .join(sq.ObjectTypes, sq.ObjectTypes.DatasetID == sq.Datasets.DatasetID)\ + .join(sq.ObjectTypes, sq.ObjectTypes.ResourceTypeID == sq.ResourceTypes.ResourceTypeID)\ .join(sq.Attributes, sq.Attributes.ObjectTypeID == sq.ObjectTypes.ObjectTypeID)\ .join(sq.Mappings, sq.Mappings.AttributeID == sq.Attributes.AttributeID)\ .join(sq.Instances, sq.Instances.InstanceID == sq.Mappings.InstanceID)\ @@ -133,12 +133,12 @@ def GetNodesResult(self, CV_ObjectType, xmin, ymin, xmax, ymax): :return: list of row (queried) ''' try: - result = self.session.query(sq.Datasets.DatasetAcronym, sq.ObjectTypes.ObjectType, sq.Attributes.AttributeName, + result = self.session.query(sq.ResourceTypes.ResourceTypeAcronym, sq.ObjectTypes.ObjectType, sq.Attributes.AttributeName, sq.Instances.InstanceName, sq.Instances.InstanceNameCV, sq.MasterNetworks.MasterNetworkName, sq.Scenarios.ScenarioName, sq.InstanceCategories.InstanceCategory, sq.Sources.SourceName, sq.Methods.MethodName, sq.Instances.Longitude_x, sq.Instances.Latitude_y, sq.Instances.Description)\ - .join(sq.ObjectTypes, sq.ObjectTypes.DatasetID == sq.Datasets.DatasetID)\ + .join(sq.ObjectTypes, sq.ObjectTypes.ResourceTypeID == sq.ResourceTypes.ResourceTypeID)\ .join(sq.Attributes, sq.Attributes.ObjectTypeID == sq.ObjectTypes.ObjectTypeID)\ .join(sq.Mappings, sq.Mappings.AttributeID == sq.Attributes.AttributeID)\ .join(sq.Instances, sq.Instances.InstanceID == sq.Mappings.InstanceID)\ @@ -191,13 +191,13 @@ def GetLinksResult(self, CV_ObjectType, xmin, ymin, xmax, ymax): ObjectTypeEndNodeInstance = aliased(sq.ObjectTypes) ObjectTypeStartNodeInstance = aliased(sq.ObjectTypes) MetadataEndNodeInstace = aliased(sq.Mappings) - result = self.session.query(sq.Datasets.DatasetAcronym, sq.ObjectTypes.ObjectType, sq.Instances.InstanceName, + result = self.session.query(sq.ResourceTypes.ResourceTypeAcronym, sq.ObjectTypes.ObjectType, sq.Instances.InstanceName, sq.Instances.InstanceNameCV, sq.Scenarios.ScenarioName, sq.Sources.SourceName, sq.Methods.MethodName, StartInstance.InstanceName, EndInstance.InstanceName, sq.InstanceCategories.InstanceCategory, sq.Instances.Description).\ join(sq.ObjectTypes, - sq.ObjectTypes.DatasetID == sq.Datasets.DatasetID).\ + sq.ObjectTypes.ResourceTypeID == sq.ResourceTypes.ResourceTypeID).\ join(sq.Attributes, sq.Attributes.ObjectTypeID == sq.ObjectTypes.ObjectTypeID).\ join(sq.Mappings, diff --git a/src_1.0/controller/wamdamAPI/__init__.py b/src/controller/wamdamAPI/__init__.py similarity index 100% rename from src_1.0/controller/wamdamAPI/__init__.py rename to src/controller/wamdamAPI/__init__.py diff --git a/src_1.0/controller/wamdamAPI/helper.py b/src/controller/wamdamAPI/helper.py similarity index 100% rename from src_1.0/controller/wamdamAPI/helper.py rename to src/controller/wamdamAPI/helper.py diff --git a/src_1.0/src_1.0_MacOS_test/define.py b/src/define.py similarity index 71% rename from src_1.0/src_1.0_MacOS_test/define.py rename to src/define.py index c5170bd..0e4feaf 100644 --- a/src_1.0/src_1.0_MacOS_test/define.py +++ b/src/define.py @@ -1,8 +1,5 @@ # define.py -# This file - -# [[ Describe the logic or idea of how this file works]] import logging, os @@ -22,7 +19,11 @@ def create_logger(selectedDBName): if not fileCheck: logFileFullPath = os.getcwdu() + "/wamdam_log_" + selectedDBName +".log" logfile = open(logFileFullPath, "w") - content = "\nWaMDaM: The Water Management Data Model 1.0\nemail: amabdalah@aggiemail.usu.edu\n\n" + content = """WaMDaM: The Water Management Data Model Version 1.01 + See the schema at http://schema.wamdam.org/diagrams/01_WaMDaM.html + Instructions at http://docs.wamdam.org/Getting_started/Steps + Adel M. Abdallah + email: amabdallah@aggiemail.usu.edu /n """ logfile.write(content) logfile.flush() logfile.close() @@ -42,5 +43,7 @@ def create_logger(selectedDBName): return logger0 logger = None dbName = "" -version = 1.0 +# WaMDaM schema version +# http://schema.wamdam.org/diagrams/01_WaMDaM.html +version = 1.01 datasetName = "" \ No newline at end of file diff --git a/src_1.0/icons/ImportHydra.png b/src/icons/ImportHydra.png similarity index 100% rename from src_1.0/icons/ImportHydra.png rename to src/icons/ImportHydra.png diff --git a/src_1.0/icons/README b/src/icons/README similarity index 100% rename from src_1.0/icons/README rename to src/icons/README diff --git a/src_1.0/icons/__init__.py b/src/icons/__init__.py similarity index 100% rename from src_1.0/icons/__init__.py rename to src/icons/__init__.py diff --git a/src_1.0/icons/icons.py b/src/icons/icons.py similarity index 100% rename from src_1.0/icons/icons.py rename to src/icons/icons.py diff --git a/src_1.0/icons/icons1.py b/src/icons/icons1.py similarity index 100% rename from src_1.0/icons/icons1.py rename to src/icons/icons1.py diff --git a/src_1.0/icons/icons_png/AddDatabase.png b/src/icons/icons_png/AddDatabase.png similarity index 100% rename from src_1.0/icons/icons_png/AddDatabase.png rename to src/icons/icons_png/AddDatabase.png diff --git a/src_1.0/icons/icons_png/AddModel.png b/src/icons/icons_png/AddModel.png similarity index 100% rename from src_1.0/icons/icons_png/AddModel.png rename to src/icons/icons_png/AddModel.png diff --git a/src_1.0/icons/icons_png/AddSource.png b/src/icons/icons_png/AddSource.png similarity index 100% rename from src_1.0/icons/icons_png/AddSource.png rename to src/icons/icons_png/AddSource.png diff --git a/src_1.0/icons/icons_png/AllSteps.png b/src/icons/icons_png/AllSteps.png similarity index 100% rename from src_1.0/icons/icons_png/AllSteps.png rename to src/icons/icons_png/AllSteps.png diff --git a/src_1.0/icons/icons_png/CI_WATER.png b/src/icons/icons_png/CI_WATER.png similarity index 100% rename from src_1.0/icons/icons_png/CI_WATER.png rename to src/icons/icons_png/CI_WATER.png diff --git a/src_1.0/icons/icons_png/Close.png b/src/icons/icons_png/Close.png similarity index 100% rename from src_1.0/icons/icons_png/Close.png rename to src/icons/icons_png/Close.png diff --git a/src_1.0/icons/icons_png/ExisitngDB.png b/src/icons/icons_png/ExisitngDB.png similarity index 100% rename from src_1.0/icons/icons_png/ExisitngDB.png rename to src/icons/icons_png/ExisitngDB.png diff --git a/src_1.0/icons/icons_png/Exit.png b/src/icons/icons_png/Exit.png similarity index 100% rename from src_1.0/icons/icons_png/Exit.png rename to src/icons/icons_png/Exit.png diff --git a/src_1.0/icons/icons_png/Help.png b/src/icons/icons_png/Help.png similarity index 100% rename from src_1.0/icons/icons_png/Help.png rename to src/icons/icons_png/Help.png diff --git a/src_1.0/icons/icons_png/ImportExcel.png b/src/icons/icons_png/ImportExcel.png similarity index 100% rename from src_1.0/icons/icons_png/ImportExcel.png rename to src/icons/icons_png/ImportExcel.png diff --git a/src_1.0/icons/icons_png/ImportHydra.png b/src/icons/icons_png/ImportHydra.png similarity index 100% rename from src_1.0/icons/icons_png/ImportHydra.png rename to src/icons/icons_png/ImportHydra.png diff --git a/src_1.0/icons/icons_png/ImportRwise.png b/src/icons/icons_png/ImportRwise.png similarity index 100% rename from src_1.0/icons/icons_png/ImportRwise.png rename to src/icons/icons_png/ImportRwise.png diff --git a/src_1.0/icons/icons_png/Query.png b/src/icons/icons_png/Query.png similarity index 100% rename from src_1.0/icons/icons_png/Query.png rename to src/icons/icons_png/Query.png diff --git a/src_1.0/icons/icons_png/Seasonal.png b/src/icons/icons_png/Seasonal.png similarity index 100% rename from src_1.0/icons/icons_png/Seasonal.png rename to src/icons/icons_png/Seasonal.png diff --git a/src_1.0/icons/icons_png/ShapeFileToExcel.png b/src/icons/icons_png/ShapeFileToExcel.png similarity index 100% rename from src_1.0/icons/icons_png/ShapeFileToExcel.png rename to src/icons/icons_png/ShapeFileToExcel.png diff --git a/src_1.0/icons/icons_png/Step1.png b/src/icons/icons_png/Step1.png similarity index 100% rename from src_1.0/icons/icons_png/Step1.png rename to src/icons/icons_png/Step1.png diff --git a/src_1.0/icons/icons_png/Step2.png b/src/icons/icons_png/Step2.png similarity index 100% rename from src_1.0/icons/icons_png/Step2.png rename to src/icons/icons_png/Step2.png diff --git a/src_1.0/icons/icons_png/Step3.png b/src/icons/icons_png/Step3.png similarity index 100% rename from src_1.0/icons/icons_png/Step3.png rename to src/icons/icons_png/Step3.png diff --git a/src_1.0/icons/icons_png/Step4.png b/src/icons/icons_png/Step4.png similarity index 100% rename from src_1.0/icons/icons_png/Step4.png rename to src/icons/icons_png/Step4.png diff --git a/src_1.0/icons/icons_png/Step5.png b/src/icons/icons_png/Step5.png similarity index 100% rename from src_1.0/icons/icons_png/Step5.png rename to src/icons/icons_png/Step5.png diff --git a/src_1.0/icons/icons_png/TimeSeries.png b/src/icons/icons_png/TimeSeries.png similarity index 100% rename from src_1.0/icons/icons_png/TimeSeries.png rename to src/icons/icons_png/TimeSeries.png diff --git a/src_1.0/icons/icons_png/WASH.png b/src/icons/icons_png/WASH.png similarity index 100% rename from src_1.0/icons/icons_png/WASH.png rename to src/icons/icons_png/WASH.png diff --git a/src_1.0/icons/icons_png/WEAP.png b/src/icons/icons_png/WEAP.png similarity index 100% rename from src_1.0/icons/icons_png/WEAP.png rename to src/icons/icons_png/WEAP.png diff --git a/src_1.0/icons/icons_png/WaMDaM_Logo.PNG b/src/icons/icons_png/WaMDaM_Logo.PNG similarity index 100% rename from src_1.0/icons/icons_png/WaMDaM_Logo.PNG rename to src/icons/icons_png/WaMDaM_Logo.PNG diff --git a/src_1.0/icons/icons_png/about.png b/src/icons/icons_png/about.png similarity index 100% rename from src_1.0/icons/icons_png/about.png rename to src/icons/icons_png/about.png diff --git a/src_1.0/icons/icons_png/dissconnetDB.png b/src/icons/icons_png/dissconnetDB.png similarity index 100% rename from src_1.0/icons/icons_png/dissconnetDB.png rename to src/icons/icons_png/dissconnetDB.png diff --git a/src_1.0/icons/icons_png/error.png b/src/icons/icons_png/error.png similarity index 100% rename from src_1.0/icons/icons_png/error.png rename to src/icons/icons_png/error.png diff --git a/src_1.0/icons/icons_png/iUTAH.png b/src/icons/icons_png/iUTAH.png similarity index 100% rename from src_1.0/icons/icons_png/iUTAH.png rename to src/icons/icons_png/iUTAH.png diff --git a/src_1.0/icons/icons_png/licence.png b/src/icons/icons_png/licence.png similarity index 100% rename from src_1.0/icons/icons_png/licence.png rename to src/icons/icons_png/licence.png diff --git a/src_1.0/icons/icons_png/nsf.png b/src/icons/icons_png/nsf.png similarity index 100% rename from src_1.0/icons/icons_png/nsf.png rename to src/icons/icons_png/nsf.png diff --git a/src_1.0/icons/icons_png/ok.png b/src/icons/icons_png/ok.png similarity index 100% rename from src_1.0/icons/icons_png/ok.png rename to src/icons/icons_png/ok.png diff --git a/src_1.0/icons/icons_png/success.png b/src/icons/icons_png/success.png similarity index 100% rename from src_1.0/icons/icons_png/success.png rename to src/icons/icons_png/success.png diff --git a/src_1.0/icons/icons_png/usu.png b/src/icons/icons_png/usu.png similarity index 100% rename from src_1.0/icons/icons_png/usu.png rename to src/icons/icons_png/usu.png diff --git a/src_1.0/icons/icons_png/uwrl.png b/src/icons/icons_png/uwrl.png similarity index 100% rename from src_1.0/icons/icons_png/uwrl.png rename to src/icons/icons_png/uwrl.png diff --git a/src_1.0/icons/icons_png/warnning.png b/src/icons/icons_png/warnning.png similarity index 100% rename from src_1.0/icons/icons_png/warnning.png rename to src/icons/icons_png/warnning.png diff --git a/src_1.0/icons/img2py.py b/src/icons/img2py.py similarity index 100% rename from src_1.0/icons/img2py.py rename to src/icons/img2py.py diff --git a/src_1.0/model/README b/src/model/README similarity index 100% rename from src_1.0/model/README rename to src/model/README diff --git a/src_1.0/model/SqlAlchemy.py b/src/model/SqlAlchemy.py similarity index 85% rename from src_1.0/model/SqlAlchemy.py rename to src/model/SqlAlchemy.py index e74652c..bd765c1 100644 --- a/src_1.0/model/SqlAlchemy.py +++ b/src/model/SqlAlchemy.py @@ -102,15 +102,6 @@ class CV_AttributeName(Base): SourceVocabularyURI = Column(String(255)) -class CV_DualValueMeaning(Base): - __tablename__ = 'CV_DualValueMeaning' - - Name = Column(String(255), primary_key=True) - Term = Column(String(255), primary_key=True) - BooleanValue = Column(String(5), nullable=False) - Definition = Column(String(5000)) - Category = Column(String(255)) - SourceVocabularyURI = Column(String(255)) class CV_ElectronicFileFormat(Base): @@ -243,7 +234,7 @@ class Attributes(Base): AttributeDataTypeCV = Column(ForeignKey('CV_AttributeDataType.Name'), nullable=False) AttributeCategoryID = Column(ForeignKey('AttributeCategories.AttributeCategoryID')) ModelInputOrOutput = Column(String(50)) - AttributeDescription = Column(Text) + Description = Column(Text) ObjectTypes = relationship('ObjectTypes') Units = relationship('CV_Units') @@ -252,16 +243,16 @@ class Attributes(Base): AttributeNames = relationship('CV_AttributeName') -class Datasets(Base): - __tablename__ = 'Datasets' +class ResourceTypes(Base): + __tablename__ = 'ResourceTypes' - DatasetID = Column(Integer, primary_key=True) - DatasetName = Column(String(255), nullable=False) - DatasetAcronym = Column(String(255), nullable=False) - SourceID = Column(ForeignKey('Sources.SourceID'), nullable=False) + ResourceTypeID = Column(Integer, primary_key=True) + ResourceType = Column(String(255), nullable=False) + ResourceTypeAcronym = Column(String(255), nullable=False) + MethodID = Column(ForeignKey('Methods.MethodID'), nullable=False) Description = Column(Text) - Sources = relationship('Sources') + Methods = relationship('Methods') class ObjectCategories(Base): @@ -279,12 +270,12 @@ class ObjectTypes(Base): ObjectType = Column(String(255), nullable=False) ObjectTypeCV = Column(ForeignKey('CV_ObjectType.Name')) ObjectTypologyCV = Column(ForeignKey('CV_ObjectTypology.Name'), nullable=False) - icon = Column(BLOB) + Layout = Column(String(1000)) Description = Column(Text) ObjectCategoryID = Column(ForeignKey('ObjectCategories.ObjectCategoryID')) - DatasetID = Column(ForeignKey('Datasets.DatasetID'), nullable=False) + ResourceTypeID = Column(ForeignKey('ResourceTypes.ResourceTypeID'), nullable=False) - Datasets = relationship('Datasets') + ResourceTypes = relationship('ResourceTypes') ObjectCategories = relationship('ObjectCategories') ObjectTypes = relationship('CV_ObjectType') ObjectTypology = relationship('CV_ObjectTypology') @@ -299,22 +290,11 @@ class ObjectTypes(Base): -class DualValues(Base): - __tablename__ = 'DualValues' - - BooleanValueID = Column(Integer, primary_key=True) - Dualvalue = Column(String(5), nullable=False) - DualvalueMeaningCV = Column(ForeignKey('CV_DualValueMeaning.Name')) - DataValuesMapperID = Column(ForeignKey('DataValuesMapper.DataValuesMapperID'), nullable=False) - - DualValueMeaning = relationship('CV_DualValueMeaning') - DataValuesMapper = relationship('DataValuesMapper') - -class DataValuesMapper(Base): - __tablename__ = 'DataValuesMapper' +class ValuesMapper(Base): + __tablename__ = 'ValuesMapper' - DataValuesMapperID = Column(Integer, primary_key=True) + ValuesMapperID = Column(Integer, primary_key=True) class ElectronicFiles(Base): @@ -325,9 +305,9 @@ class ElectronicFiles(Base): ElectronicFile = Column(BLOB, nullable=False) ElectronicFileFormatCV = Column(ForeignKey('CV_ElectronicFileFormat.Name')) Description = Column(Text) - DataValuesMapperID = Column(ForeignKey('DataValuesMapper.DataValuesMapperID'), nullable=False) + ValuesMapperID = Column(ForeignKey('ValuesMapper.ValuesMapperID'), nullable=False) - DataValuesMapper = relationship('DataValuesMapper') + ValuesMapper = relationship('ValuesMapper') ElectronicFileFormat = relationship('CV_ElectronicFileFormat') @@ -335,20 +315,20 @@ class MultiAttributeSeries(Base): __tablename__ = 'MultiAttributeSeries' MultiAttributeSeriesID = Column(Integer, primary_key=True) - AttributeNameID = Column(ForeignKey('DataValuesMapper.DataValuesMapperID'), nullable=False) - DataValuesMapperID = Column(ForeignKey('DataValuesMapper.DataValuesMapperID'), nullable=False) + MappingID_Attribute = Column(ForeignKey('ValuesMapper.ValuesMapperID'), nullable=False) + ValuesMapperID = Column(ForeignKey('ValuesMapper.ValuesMapperID'), nullable=False) - DataValuesMapper = relationship('DataValuesMapper', - primaryjoin='MultiAttributeSeries.AttributeNameID == DataValuesMapper.DataValuesMapperID') - DataValuesMapper1 = relationship('DataValuesMapper', - primaryjoin='MultiAttributeSeries.DataValuesMapperID == DataValuesMapper.DataValuesMapperID') + ValuesMapper = relationship('ValuesMapper', + primaryjoin='MultiAttributeSeries.MappingID_Attribute == ValuesMapper.ValuesMapperID') + ValuesMapper1 = relationship('ValuesMapper', + primaryjoin='MultiAttributeSeries.ValuesMapperID == ValuesMapper.ValuesMapperID') class MultiAttributeSeriesValues(Base): __tablename__ = 'MultiAttributeSeriesValues' - MultiAttributeSeriesValuesID = Column(Integer, primary_key=True) - Value = Column(String(255), nullable=False) + MultiAttributeSeriesValueID = Column(Integer, primary_key=True) + DataValue = Column(String(255), nullable=False) ValueOrder = Column(Integer, nullable=False) MultiAttributeSeriesID = Column(ForeignKey('MultiAttributeSeries.MultiAttributeSeriesID'), nullable=False) @@ -360,9 +340,9 @@ class NumericValues(Base): NumericValueID = Column(Integer, primary_key=True) NumericValue = Column(Float, nullable=False) - DataValuesMapperID = Column(ForeignKey('DataValuesMapper.DataValuesMapperID'), nullable=False) + ValuesMapperID = Column(ForeignKey('ValuesMapper.ValuesMapperID'), nullable=False) - DataValuesMapper = relationship('DataValuesMapper') + ValuesMapper = relationship('ValuesMapper') class SeasonalNumericValues(Base): @@ -373,21 +353,22 @@ class SeasonalNumericValues(Base): SeasonNameCV = Column(ForeignKey('CV_SeasonName.Name')) SeasonOrder = Column(Integer) SeasonNumericValue = Column(String(500), nullable=False) - DataValuesMapperID = Column(ForeignKey('DataValuesMapper.DataValuesMapperID'), nullable=False) + ValuesMapperID = Column(ForeignKey('ValuesMapper.ValuesMapperID'), nullable=False) - DataValuesMapper = relationship('DataValuesMapper') + ValuesMapper = relationship('ValuesMapper') SeasonNames = relationship('CV_SeasonName') class DescriptorValues(Base): __tablename__ = 'DescriptorValues' - DescriptorValuesID = Column(Integer, primary_key=True) + DescriptorValueID = Column(Integer, primary_key=True) DescriptorValue = Column(String(500), nullable=False) - DescriptorvalueCV = Column(ForeignKey('CV_DescriptorValues.Term')) - DataValuesMapperID = Column(ForeignKey('DataValuesMapper.DataValuesMapperID'), nullable=False) + DescriptorValueCV = Column(ForeignKey('CV_DescriptorValues.Name')) + ValuesMapperID = Column(ForeignKey('ValuesMapper.ValuesMapperID'), nullable=False) + ValuesMapperID = Column(ForeignKey('ValuesMapper.ValuesMapperID'), nullable=False) - DataValuesMapper = relationship('DataValuesMapper') + ValuesMapper = relationship('ValuesMapper') DescriptorValues = relationship('CV_DescriptorValues') @@ -405,10 +386,10 @@ class TimeSeries(Base): IsRegular = Column(Integer) NoDataValue = Column(String(50)) Description = Column(Text) - DataValuesMapperID = Column(ForeignKey('DataValuesMapper.DataValuesMapperID'), nullable=False) + ValuesMapperID = Column(ForeignKey('ValuesMapper.ValuesMapperID'), nullable=False) AggregationStatistic = relationship('CV_AggregationStatistic') - DataValuesMapper = relationship('DataValuesMapper') + ValuesMapper = relationship('ValuesMapper') Units = relationship('CV_Units') @@ -418,7 +399,7 @@ class TimeSeriesValues(Base): TimeSeriesValueID = Column(Integer, primary_key=True) TimeSeriesID = Column(ForeignKey('TimeSeries.TimeSeriesID'), nullable=False) DateTimeStamp = Column(Date, nullable=False) - Value = Column(Float, nullable=False) + DataValue = Column(Float, nullable=False) TimeSeries = relationship('TimeSeries') @@ -440,7 +421,7 @@ class Methods(Base): MethodName = Column(String(255), nullable=False) MethodWebpage = Column(String(255)) MethodCitation = Column(String(500)) - MethodTypeCV = Column(ForeignKey('CV_MethodType.Name'), nullable=False) + MethodTypeCV = Column(ForeignKey('CV_MethodType.Name')) PersonID = Column(ForeignKey('People.PersonID'), nullable=False) Description = Column(Text) @@ -538,9 +519,9 @@ class Mappings(Base): InstanceID = Column(ForeignKey('Instances.InstanceID'), nullable=False) SourceID = Column(ForeignKey('Sources.SourceID'), nullable=False) MethodID = Column(ForeignKey('Methods.MethodID'), nullable=False) - DataValuesMapperID = Column(ForeignKey('DataValuesMapper.DataValuesMapperID')) + ValuesMapperID = Column(ForeignKey('ValuesMapper.ValuesMapperID')) - DataValuesMapper = relationship('DataValuesMapper') + ValuesMapper = relationship('ValuesMapper') Instances = relationship('Instances') Methods = relationship('Methods') Attributes = relationship('Attributes') diff --git a/src_1.0/model/__init__.py b/src/model/__init__.py similarity index 100% rename from src_1.0/model/__init__.py rename to src/model/__init__.py diff --git a/src_1.0/requirements.md b/src/requirements.md similarity index 100% rename from src_1.0/requirements.md rename to src/requirements.md diff --git a/src_1.0/src_1.0_MacOS_test/setup_cx.py b/src/setup_cx.py similarity index 79% rename from src_1.0/src_1.0_MacOS_test/setup_cx.py rename to src/setup_cx.py index d1ddc49..beeed10 100644 --- a/src_1.0/src_1.0_MacOS_test/setup_cx.py +++ b/src/setup_cx.py @@ -21,11 +21,11 @@ shortcut_table = [ ("DesktopShortcut", # Shortcut "DesktopFolder", # Directory_ - "WaMDaM", # Name + "WaMDaM_v1.01", # Name "TARGETDIR", # Component_ - "[TARGETDIR]wamdam.exe",# Target + "[TARGETDIR]WaMDaM.exe",# Target None, # Arguments - None, # Description + "The Water Management Data Model (WaMDaM)", # Description None, # Hotkey None, # Icon None, # IconIndex @@ -44,9 +44,9 @@ if sys.platform == 'win32': base = 'Win32GUI' setup( - name="WaMDaM_Main_Setup", - version="1.0.0", - description="", + name="WaMDaM_v1.01_UtahStateUniversity", + version="1.01", + description="The Water Management Data Model (WaMDaM)", options={'build_exe': build_exe_options, 'bdist_msi': bdist_msi_options}, - executables=[Executable("wamdam.py", base=base, icon="WaMDaM_Wizard.ico")] + executables=[Executable("WaMDaM.py", base=base, icon="WaMDaM_Wizard.ico")] ) diff --git a/src_1.0/site-packages.zip b/src/site-packages.zip similarity index 100% rename from src_1.0/site-packages.zip rename to src/site-packages.zip diff --git a/src_1.0/src_1.0_MacOS_test/viewer/Messages_forms/Messages_Jan4.fbp b/src/viewer/Messages_forms/Messages_Jan4.fbp similarity index 100% rename from src_1.0/src_1.0_MacOS_test/viewer/Messages_forms/Messages_Jan4.fbp rename to src/viewer/Messages_forms/Messages_Jan4.fbp diff --git a/src_1.0/src_1.0_MacOS_test/model/README b/src/viewer/Messages_forms/README similarity index 100% rename from src_1.0/src_1.0_MacOS_test/model/README rename to src/viewer/Messages_forms/README diff --git a/src_1.0/viewer/Messages_forms/Validations.py b/src/viewer/Messages_forms/Validations.py similarity index 100% rename from src_1.0/viewer/Messages_forms/Validations.py rename to src/viewer/Messages_forms/Validations.py diff --git a/src_1.0/src_1.0_MacOS_test/controller/__init__.py b/src/viewer/Messages_forms/__init__.py similarity index 100% rename from src_1.0/src_1.0_MacOS_test/controller/__init__.py rename to src/viewer/Messages_forms/__init__.py diff --git a/src_1.0/src_1.0_MacOS_test/viewer/Messages_forms/generalMsgDlg.py b/src/viewer/Messages_forms/generalMsgDlg.py similarity index 100% rename from src_1.0/src_1.0_MacOS_test/viewer/Messages_forms/generalMsgDlg.py rename to src/viewer/Messages_forms/generalMsgDlg.py diff --git a/src_1.0/src_1.0_MacOS_test/viewer/Messages_forms/msg_connSQLiteInvalid.py b/src/viewer/Messages_forms/msg_connSQLiteInvalid.py similarity index 100% rename from src_1.0/src_1.0_MacOS_test/viewer/Messages_forms/msg_connSQLiteInvalid.py rename to src/viewer/Messages_forms/msg_connSQLiteInvalid.py diff --git a/src_1.0/src_1.0_MacOS_test/viewer/Messages_forms/msg_connSQLiteSuccs.py b/src/viewer/Messages_forms/msg_connSQLiteSuccs.py similarity index 100% rename from src_1.0/src_1.0_MacOS_test/viewer/Messages_forms/msg_connSQLiteSuccs.py rename to src/viewer/Messages_forms/msg_connSQLiteSuccs.py diff --git a/src_1.0/src_1.0_MacOS_test/viewer/Messages_forms/msg_duplicateEnties.py b/src/viewer/Messages_forms/msg_duplicateEnties.py similarity index 100% rename from src_1.0/src_1.0_MacOS_test/viewer/Messages_forms/msg_duplicateEnties.py rename to src/viewer/Messages_forms/msg_duplicateEnties.py diff --git a/src_1.0/src_1.0_MacOS_test/viewer/Messages_forms/msg_emptyRequiredField.py b/src/viewer/Messages_forms/msg_emptyRequiredField.py similarity index 100% rename from src_1.0/src_1.0_MacOS_test/viewer/Messages_forms/msg_emptyRequiredField.py rename to src/viewer/Messages_forms/msg_emptyRequiredField.py diff --git a/src_1.0/src_1.0_MacOS_test/viewer/Messages_forms/msg_infos.py b/src/viewer/Messages_forms/msg_infos.py similarity index 100% rename from src_1.0/src_1.0_MacOS_test/viewer/Messages_forms/msg_infos.py rename to src/viewer/Messages_forms/msg_infos.py diff --git a/src_1.0/src_1.0_MacOS_test/viewer/Messages_forms/msg_loading.py b/src/viewer/Messages_forms/msg_loading.py similarity index 100% rename from src_1.0/src_1.0_MacOS_test/viewer/Messages_forms/msg_loading.py rename to src/viewer/Messages_forms/msg_loading.py diff --git a/src_1.0/src_1.0_MacOS_test/viewer/Messages_forms/msg_loadingToExit.py b/src/viewer/Messages_forms/msg_loadingToExit.py similarity index 100% rename from src_1.0/src_1.0_MacOS_test/viewer/Messages_forms/msg_loadingToExit.py rename to src/viewer/Messages_forms/msg_loadingToExit.py diff --git a/src_1.0/src_1.0_MacOS_test/viewer/Messages_forms/msg_registerCVs.py b/src/viewer/Messages_forms/msg_registerCVs.py similarity index 100% rename from src_1.0/src_1.0_MacOS_test/viewer/Messages_forms/msg_registerCVs.py rename to src/viewer/Messages_forms/msg_registerCVs.py diff --git a/src_1.0/src_1.0_MacOS_test/viewer/Messages_forms/msg_selectDatabaseFirst.py b/src/viewer/Messages_forms/msg_selectDatabaseFirst.py similarity index 100% rename from src_1.0/src_1.0_MacOS_test/viewer/Messages_forms/msg_selectDatabaseFirst.py rename to src/viewer/Messages_forms/msg_selectDatabaseFirst.py diff --git a/src_1.0/src_1.0_MacOS_test/viewer/Messages_forms/msg_selectWorkbokFirst.py b/src/viewer/Messages_forms/msg_selectWorkbokFirst.py similarity index 100% rename from src_1.0/src_1.0_MacOS_test/viewer/Messages_forms/msg_selectWorkbokFirst.py rename to src/viewer/Messages_forms/msg_selectWorkbokFirst.py diff --git a/src_1.0/src_1.0_MacOS_test/viewer/Messages_forms/msg_somethigWrong.py b/src/viewer/Messages_forms/msg_somethigWrong.py similarity index 100% rename from src_1.0/src_1.0_MacOS_test/viewer/Messages_forms/msg_somethigWrong.py rename to src/viewer/Messages_forms/msg_somethigWrong.py diff --git a/src_1.0/src_1.0_MacOS_test/viewer/Messages_forms/msg_successLoadDatabase.py b/src/viewer/Messages_forms/msg_successLoadDatabase.py similarity index 100% rename from src_1.0/src_1.0_MacOS_test/viewer/Messages_forms/msg_successLoadDatabase.py rename to src/viewer/Messages_forms/msg_successLoadDatabase.py diff --git a/src_1.0/src_1.0_MacOS_test/viewer/Messages_forms/msg_sureToExit.py b/src/viewer/Messages_forms/msg_sureToExit.py similarity index 100% rename from src_1.0/src_1.0_MacOS_test/viewer/Messages_forms/msg_sureToExit.py rename to src/viewer/Messages_forms/msg_sureToExit.py diff --git a/src_1.0/src_1.0_MacOS_test/viewer/Messages_forms/msg_workbookInvalid.py b/src/viewer/Messages_forms/msg_workbookInvalid.py similarity index 100% rename from src_1.0/src_1.0_MacOS_test/viewer/Messages_forms/msg_workbookInvalid.py rename to src/viewer/Messages_forms/msg_workbookInvalid.py diff --git a/src_1.0/src_1.0_MacOS_test/viewer/README b/src/viewer/README similarity index 100% rename from src_1.0/src_1.0_MacOS_test/viewer/README rename to src/viewer/README diff --git a/src_1.0/viewer/WaMDaMWizard.py b/src/viewer/WaMDaMWizard.py similarity index 99% rename from src_1.0/viewer/WaMDaMWizard.py rename to src/viewer/WaMDaMWizard.py index a63575e..8c768cb 100644 --- a/src_1.0/viewer/WaMDaMWizard.py +++ b/src/viewer/WaMDaMWizard.py @@ -36,7 +36,7 @@ def scale_bitmap(bitmap, width, height): class frm_Home ( wx.Frame ): def __init__( self, parent ): - wx.Frame.__init__ ( self, parent, id = 1, title = u"WaMDaM Wizard 1.0", pos = wx.DefaultPosition, size = wx.Size( 892,700 ), style = wx.DEFAULT_FRAME_STYLE|wx.MAXIMIZE_BOX|wx.MINIMIZE_BOX|wx.TAB_TRAVERSAL ) + wx.Frame.__init__ ( self, parent, id = 1, title = u"WaMDaM Wizard 1.01", pos = wx.DefaultPosition, size = wx.Size( 892,700 ), style = wx.DEFAULT_FRAME_STYLE|wx.MAXIMIZE_BOX|wx.MINIMIZE_BOX|wx.TAB_TRAVERSAL ) self.SetSizeHintsSz( wx.DefaultSize, wx.DefaultSize ) # self.SetWindowStyle(wx.STAY_ON_TOP) @@ -2058,6 +2058,7 @@ def btn_cancelOnButtonClick( self, event ): class dlg_ShapefileToWaMDaM ( wx.Dialog ): def __init__( self, parent ): + wx.Dialog.__init__ ( self, parent, id = 92, title = u"Convert Shapefile Data To WaMDaM spreadsheet", pos = wx.DefaultPosition, size = wx.Size( 554,321 ), style = wx.DEFAULT_DIALOG_STYLE ) self.SetSizeHintsSz( wx.DefaultSize, wx.DefaultSize ) @@ -2288,7 +2289,7 @@ def __init__( self, parent ): bSizer10 = wx.BoxSizer( wx.VERTICAL ) - self.m_staticText7 = wx.StaticText( self, wx.ID_ANY, u"Check out the instructions here at http://docs.wamdam.org/Getting_started/Use_Wizard/", wx.DefaultPosition, wx.DefaultSize, 0 ) + self.m_staticText7 = wx.StaticText( self, wx.ID_ANY, u"Check out the instructions here at http://docs.wamdam.org/Getting_started/Steps/", wx.DefaultPosition, wx.DefaultSize, 0 ) self.m_staticText7.Wrap( -1 ) bSizer10.Add( self.m_staticText7, 1, wx.ALL|wx.EXPAND, 5 ) @@ -2335,7 +2336,7 @@ def __init__( self, parent ): bSizer10 = wx.BoxSizer( wx.VERTICAL ) - self.m_staticText7 = wx.StaticText( self, wx.ID_ANY, u"License\n\nCopyright (c) 2017, Utah State University and WaMDaM development team: Adel M. Abdallah and David E. Rosenberg All rights reserved.\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nNeither the name of Utah State University, WaMDaM, nor its contributors may be used to endorse or promote products derived from this software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.", wx.DefaultPosition, wx.DefaultSize, 0 ) + self.m_staticText7 = wx.StaticText( self, wx.ID_ANY, u"License\n\nCopyright (c) 2018, Utah State University and WaMDaM development team: Adel M. Abdallah and David E. Rosenberg All rights reserved.\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nNeither the name of Utah State University, WaMDaM, nor its contributors may be used to endorse or promote products derived from this software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.", wx.DefaultPosition, wx.DefaultSize, 0 ) self.m_staticText7.Wrap( -1 ) bSizer10.Add( self.m_staticText7, 1, wx.ALL|wx.EXPAND, 5 ) diff --git a/src_1.0/src_1.0_MacOS_test/__init__.py b/src/viewer/__init__.py similarity index 100% rename from src_1.0/src_1.0_MacOS_test/__init__.py rename to src/viewer/__init__.py diff --git a/src_1.0/src_1.0_MacOS_test/viewer/dlg_About.py b/src/viewer/dlg_About.py similarity index 100% rename from src_1.0/src_1.0_MacOS_test/viewer/dlg_About.py rename to src/viewer/dlg_About.py diff --git a/src_1.0/src_1.0_MacOS_test/viewer/dlg_ConnectExistingDatabaseMySQL.py b/src/viewer/dlg_ConnectExistingDatabaseMySQL.py similarity index 100% rename from src_1.0/src_1.0_MacOS_test/viewer/dlg_ConnectExistingDatabaseMySQL.py rename to src/viewer/dlg_ConnectExistingDatabaseMySQL.py diff --git a/src_1.0/viewer/dlg_ConnectExistingDatabaseSQLite.py b/src/viewer/dlg_ConnectExistingDatabaseSQLite.py similarity index 99% rename from src_1.0/viewer/dlg_ConnectExistingDatabaseSQLite.py rename to src/viewer/dlg_ConnectExistingDatabaseSQLite.py index d0753c9..55e8e64 100644 --- a/src_1.0/viewer/dlg_ConnectExistingDatabaseSQLite.py +++ b/src/viewer/dlg_ConnectExistingDatabaseSQLite.py @@ -81,7 +81,7 @@ def check_database(self, db_name): sql = 'SELECT DISTINCT VersionNumber FROM "WaMDaMVersion"' result = temp_session.execute(sql) for row in result: - if row.VersionNumber != 1.0: + if row.VersionNumber != 1.01: define.logger.error('Failed database connect.\n\nError: Version of database is not matched.') raise Exception('\n\nError: Version of database is not matched.') diff --git a/src_1.0/viewer/dlg_ConnectNewDatabaseSQLite.py b/src/viewer/dlg_ConnectNewDatabaseSQLite.py similarity index 93% rename from src_1.0/viewer/dlg_ConnectNewDatabaseSQLite.py rename to src/viewer/dlg_ConnectNewDatabaseSQLite.py index 8852d79..e0aa4e5 100644 --- a/src_1.0/viewer/dlg_ConnectNewDatabaseSQLite.py +++ b/src/viewer/dlg_ConnectNewDatabaseSQLite.py @@ -46,9 +46,9 @@ def btn_connectOnButtonClick(self, event): setup = DB_Setup() if setup.get_session(): define.logger.error( - 'Failed database connection.\n\nError: You are already connected to a database. \n\n to use another' + 'Failed database connection.\n\n Error: You are already connected to a database. \n\n to use another' 'database, you need to disconnect from the current one') - msg_somethigWrong(topframe, msg='\n\nError: You are already connected to a database. \n\n to use another' + msg_somethigWrong(topframe, msg='\n\n Error: You are already connected to a database. \n\n to use another' 'database, you need to disconnect from the current one').Show() return @@ -89,7 +89,7 @@ def btn_connectOnButtonClick(self, event): from Messages_forms.msg_connSQLiteSuccs import msg_connSQLiteSuccs msgdlg = msg_connSQLiteSuccs(topframe) - msgdlg.setMessage(u"\n\n\n\n\nYou are successfully connected to " + db_path.split('\\')[-1] + u".") + msgdlg.setMessage(u"\n\n\n\n\n You are successfully connected to " + db_path.split('\\')[-1] + u".") msgdlg.Show() '''Report the connected db name to the logfile''' define.logger.info("'" + db_path.split('\\')[-1] + "'was connected successfully.\n") diff --git a/src_1.0/viewer/dlg_CrossTabSeasonalToWaMDaM.py b/src/viewer/dlg_CrossTabSeasonalToWaMDaM.py similarity index 88% rename from src_1.0/viewer/dlg_CrossTabSeasonalToWaMDaM.py rename to src/viewer/dlg_CrossTabSeasonalToWaMDaM.py index 109b047..ecdd402 100644 --- a/src_1.0/viewer/dlg_CrossTabSeasonalToWaMDaM.py +++ b/src/viewer/dlg_CrossTabSeasonalToWaMDaM.py @@ -3,7 +3,15 @@ import wx import WaMDaMWizard from Messages_forms.msg_somethigWrong import msg_somethigWrong -from controller.seasonalData_shaper import SeasonalDataShaperFunc + +import os +import sys + +sys.path.append(os.path.abspath(os.path.dirname(__file__) + '/' + '../..')) + +from controller import seasonalData_shaper + +# from controller.seasonalData_shaper import SeasonalDataShaperFunc # Implementing dlg_CrossTabSeasonalToWaMDaM class dlg_CrossTabSeasonalToWaMDaM( WaMDaMWizard.dlg_CrossTabSeasonalToWaMDaM ): @@ -26,7 +34,7 @@ def btn_convertCrossTabulatedSeasonalOnButtonClick( self, event ): # TODO: Implement btn_convertCrossTabulatedSeasonalOnButtonClick if self.cross_file: try: - SeasonalDataShaperFunc(workbook=self.cross_file) + seasonalData_shaper.SeasonalDataShaperFunc(workbook=self.cross_file) self.allDone() # self.Destroy() except Exception as e: diff --git a/src_1.0/src_1.0_MacOS_test/viewer/dlg_CrossTabTimeSeriesToWaMDaM.py b/src/viewer/dlg_CrossTabTimeSeriesToWaMDaM.py similarity index 100% rename from src_1.0/src_1.0_MacOS_test/viewer/dlg_CrossTabTimeSeriesToWaMDaM.py rename to src/viewer/dlg_CrossTabTimeSeriesToWaMDaM.py diff --git a/src_1.0/src_1.0_MacOS_test/viewer/dlg_ExportScenarioDataToHydra.py b/src/viewer/dlg_ExportScenarioDataToHydra.py similarity index 100% rename from src_1.0/src_1.0_MacOS_test/viewer/dlg_ExportScenarioDataToHydra.py rename to src/viewer/dlg_ExportScenarioDataToHydra.py diff --git a/src_1.0/src_1.0_MacOS_test/viewer/dlg_Help.py b/src/viewer/dlg_Help.py similarity index 100% rename from src_1.0/src_1.0_MacOS_test/viewer/dlg_Help.py rename to src/viewer/dlg_Help.py diff --git a/src_1.0/src_1.0_MacOS_test/viewer/dlg_ImportFromCUAHS.py b/src/viewer/dlg_ImportFromCUAHS.py similarity index 100% rename from src_1.0/src_1.0_MacOS_test/viewer/dlg_ImportFromCUAHS.py rename to src/viewer/dlg_ImportFromCUAHS.py diff --git a/src_1.0/src_1.0_MacOS_test/viewer/dlg_ImportFromWaDE.py b/src/viewer/dlg_ImportFromWaDE.py similarity index 100% rename from src_1.0/src_1.0_MacOS_test/viewer/dlg_ImportFromWaDE.py rename to src/viewer/dlg_ImportFromWaDE.py diff --git a/src_1.0/src_1.0_MacOS_test/viewer/dlg_ImportRwise.py b/src/viewer/dlg_ImportRwise.py similarity index 100% rename from src_1.0/src_1.0_MacOS_test/viewer/dlg_ImportRwise.py rename to src/viewer/dlg_ImportRwise.py diff --git a/src_1.0/src_1.0_MacOS_test/viewer/dlg_ImportSpreadsheetAdvanced.py b/src/viewer/dlg_ImportSpreadsheetAdvanced.py similarity index 100% rename from src_1.0/src_1.0_MacOS_test/viewer/dlg_ImportSpreadsheetAdvanced.py rename to src/viewer/dlg_ImportSpreadsheetAdvanced.py diff --git a/src_1.0/viewer/dlg_ImportSpreadsheetBasic.py b/src/viewer/dlg_ImportSpreadsheetBasic.py similarity index 95% rename from src_1.0/viewer/dlg_ImportSpreadsheetBasic.py rename to src/viewer/dlg_ImportSpreadsheetBasic.py index b6aee7c..840557d 100644 --- a/src_1.0/viewer/dlg_ImportSpreadsheetBasic.py +++ b/src/viewer/dlg_ImportSpreadsheetBasic.py @@ -9,8 +9,9 @@ from controller.stp2_loadDataStructure import Load_Struct_To_DB from controller.stp3_loadNetworks import Load_Networks_Data from controller.stp0_loadCVs import Load_CV_To_DB -# from controller.stp4_loadDataValues import * +from controller.ConnectDB_ParseExcel import DB_Setup from controller.stp4_loadDataValue import * +from controller.stp4_loadDataValue.loadDescriptorValues import LoadDescriptorValues from controller.ReadWorkbook_SheetsNames import * from Messages_forms.msg_somethigWrong import msg_somethigWrong from Messages_forms.msg_loading import msg_loading @@ -231,22 +232,22 @@ def timeSeriesValueData(msgDlg): # message.Show() raise Exception(e.message) - def dualValues(msgDlg): - define.logger.info("Start booleanData load.") - try: - instance = LoadDualValues(obj) - instance.load_data() - msgDlg.guage.SetValue(11) - define.logger.info("BooleanData load was finished successfully.") - return instance - except Exception as e: - define.logger.error('Failed booleanData load.\n' + e.message) - print(e) - # message = messageDlg(None) - # message.SetTitle(u"Sorry: something went wrong") - # message.setMessage(u'{} \n\n [*] Could not Load Boolean Data'.format(e)) - # message.Show() - raise Exception(e.message) + # def dualValues(msgDlg): + # define.logger.info("Start booleanData load.") + # try: + # instance = LoadDualValues(obj) + # instance.load_data() + # msgDlg.guage.SetValue(11) + # define.logger.info("BooleanData load was finished successfully.") + # return instance + # except Exception as e: + # define.logger.error('Failed booleanData load.\n' + e.message) + # print(e) + # # message = messageDlg(None) + # # message.SetTitle(u"Sorry: something went wrong") + # # message.setMessage(u'{} \n\n [*] Could not Load Boolean Data'.format(e)) + # # message.Show() + # raise Exception(e.message) def multiColumnArrayData(msgDlg): define.logger.info("Start MultiAttributeSeriesData load.") @@ -299,7 +300,7 @@ def electronicFiles(msgDlg): instance_seasonParamsData = seasonalNumericValues(self.msgDlg) instance_timeSeriesData = timeSeriesData(self.msgDlg) instance_timeSeriesValueData = timeSeriesValueData(self.msgDlg) - instance_booleanData = dualValues(self.msgDlg) + # instance_booleanData = dualValues(self.msgDlg) instance_fileData = electronicFiles(self.msgDlg) instance_multiColumnArrayData = multiColumnArrayData(self.msgDlg) pass @@ -332,7 +333,7 @@ def electronicFiles(msgDlg): instance_seasonParamsData = seasonalNumericValues(self.msgDlg) instance_timeSeriesData = timeSeriesData(self.msgDlg) instance_timeSeriesValueData = timeSeriesValueData(self.msgDlg) - instance_booleanData = dualValues(self.msgDlg) + # instance_booleanData = dualValues(self.msgDlg) instance_fileData = electronicFiles(self.msgDlg) instance_multiColumnArrayData = multiColumnArrayData(self.msgDlg) @@ -348,7 +349,7 @@ def electronicFiles(msgDlg): instance_seasonParamsData.add_data() instance_timeSeriesData.add_data() instance_timeSeriesValueData.add_data() - instance_booleanData.add_data() + # instance_booleanData.add_data() instance_fileData.add_data() instance_multiColumnArrayData.add_data() pass diff --git a/src_1.0/src_1.0_MacOS_test/viewer/dlg_License.py b/src/viewer/dlg_License.py similarity index 100% rename from src_1.0/src_1.0_MacOS_test/viewer/dlg_License.py rename to src/viewer/dlg_License.py diff --git a/src_1.0/src_1.0_MacOS_test/viewer/dlg_SearchDataValues.py b/src/viewer/dlg_SearchDataValues.py similarity index 100% rename from src_1.0/src_1.0_MacOS_test/viewer/dlg_SearchDataValues.py rename to src/viewer/dlg_SearchDataValues.py diff --git a/src_1.0/src_1.0_MacOS_test/viewer/dlg_SearchNodesLinks.py b/src/viewer/dlg_SearchNodesLinks.py similarity index 100% rename from src_1.0/src_1.0_MacOS_test/viewer/dlg_SearchNodesLinks.py rename to src/viewer/dlg_SearchNodesLinks.py diff --git a/src_1.0/viewer/dlg_ShapefileToWaMDaM.py b/src/viewer/dlg_ShapefileToWaMDaM.py similarity index 87% rename from src_1.0/viewer/dlg_ShapefileToWaMDaM.py rename to src/viewer/dlg_ShapefileToWaMDaM.py index 4c07313..7ab278b 100644 --- a/src_1.0/viewer/dlg_ShapefileToWaMDaM.py +++ b/src/viewer/dlg_ShapefileToWaMDaM.py @@ -5,10 +5,20 @@ from Messages_forms.msg_somethigWrong import msg_somethigWrong from controller.shapefileExporter import shapefileExporter + +# import wx, define, threading +# import WaMDaMWizard +# from Messages_forms.msg_somethigWrong import msg_somethigWrong +# from controller.ConnectDB_ParseExcel import DB_Setup +# from Messages_forms.msg_loadingToExit import msg_sureToExit +# from controller.RWISE_importer import RWISE_importer + # Implementing dlg_ShapefileToWaMDaM class dlg_ShapefileToWaMDaM( WaMDaMWizard.dlg_ShapefileToWaMDaM ): def __init__( self, parent ): + WaMDaMWizard.dlg_ShapefileToWaMDaM.__init__( self, parent ) + self.shape_file = None # Handlers for dlg_ShapefileToWaMDaM events. @@ -53,7 +63,9 @@ def btn_ConvertShapefileDataOnButtonClick( self, event ): instance.Destroy() # instance.Show() def load_data(self): - shapefileExporter(workbook=self.shape_file) + shp_export = shapefileExporter() + shp_export.shapefileExporter(self.shape_file) + # shapefileExporter(workbook=self.shape_file) # Call allDone method once loading is done wx.CallAfter(self.allDone) diff --git a/src_1.0/viewer/dlg_compare_scenarios.py b/src/viewer/dlg_compare_scenarios.py similarity index 81% rename from src_1.0/viewer/dlg_compare_scenarios.py rename to src/viewer/dlg_compare_scenarios.py index 93953d8..d081814 100644 --- a/src_1.0/viewer/dlg_compare_scenarios.py +++ b/src/viewer/dlg_compare_scenarios.py @@ -20,12 +20,12 @@ def __init__( self, parent ): try: ''' init model combobox''' self.dataStructure = GetDataStructure() - self.datasets = self.dataStructure.getDatasets() + self.datasets = self.dataStructure.getResourceTypes() self.compareScenarios = GetComapreScenarios() list_acromy = list() for row in self.datasets: - list_acromy.append(row.DatasetAcronym) + list_acromy.append(row.ResourceTypeAcronym) if list_acromy.__len__() > 0: self.comboBox_selectModel.SetItems(list_acromy) except Exception as e: @@ -159,7 +159,7 @@ def btn_compare_scenariosOnButtonClick( self, event ): '''get changed metadata''' changeInMetadataList = self.compareScenarios.GetChangeInMetadata_Topology(selectedDataset, selectedMasterNetworkName,selectedScenarioName1, selectedScenarioName2) - changeInMetadataValueList = self.compareScenarios.GetChangeInMetadataValues_Attributes(selectedDataset, selectedMasterNetworkName,selectedScenarioName1, selectedScenarioName2) + changeInMetadataValueList = self.compareScenarios.GetChangeInMetaValues_Attributes(selectedDataset, selectedMasterNetworkName,selectedScenarioName1, selectedScenarioName2) ''' init metadata''' changeInMetadataList_result = [] @@ -226,7 +226,7 @@ def btn_compare_scenariosOnButtonClick( self, event ): try: additionsToTopologySheet = workbook.get_sheet(0) #[[[additionsToTopologySheet change it to unique to Scenario x]]] changeInMetadataToTopologySheet = workbook.get_sheet(1) - changeInMetadataValuesTopologySheet = workbook.get_sheet(2) + changeInMetavaluesTopologySheet = workbook.get_sheet(2) except: message = msg_somethigWrong(None, msg="Please select a valid Excel File") message.ShowModal() @@ -298,7 +298,7 @@ def btn_compare_scenariosOnButtonClick( self, event ): for row_id, row in enumerate(changeInMetadataValueList): for col_id, cell in enumerate(row): - changeInMetadataValuesTopologySheet.write(row_id + 3, col_id + 0, cell) + changeInMetavaluesTopologySheet.write(row_id + 3, col_id + 0, cell) changeInMetadataToTopologySheet.write(1, 4, selectedScenarioName1) changeInMetadataToTopologySheet.write(1, 5, selectedScenarioName2) @@ -311,8 +311,8 @@ def btn_compare_scenariosOnButtonClick( self, event ): try: additionsToTopologySheet = book2.get_sheet_by_name("ChangeInTopology") changeInMetadataToTopologySheet = book2.get_sheet_by_name("ChangeInMetadata_Topology") - changeInMetadataValuesTopologySheet = book2.get_sheet_by_name("ChangeInMetadata_Attributes") - changeInDataValuesSheet = book2.get_sheet_by_name("ChangeInDataValues") + changeInMetavaluesTopologySheet = book2.get_sheet_by_name("ChangeInMetadata_Attributes") + changeInValuesSheet = book2.get_sheet_by_name("ChangeInValues") except: message = msg_somethigWrong(None, msg="Please select a valid Excel File") message.ShowModal() @@ -360,20 +360,20 @@ def btn_compare_scenariosOnButtonClick( self, event ): for col_id, cell in enumerate(row): if col_id < 4: changeInMetadataToTopologySheet.cell(row=i + 6, column=col_id + 1, value=cell) - # changeInMetadataValuesTopologySheet.cell(row=i + 6, column=col_id + 1, value=cell) + # changeInMetavaluesTopologySheet.cell(row=i + 6, column=col_id + 1, value=cell) elif col_id == 4: if cell == selectedScenarioName1: changeInMetadataToTopologySheet.cell(row=i + 6, column=col_id + 1, value=row[5]) changeInMetadataToTopologySheet.cell(row=i + 6, column=7, value=row[6]) - # changeInMetadataValuesTopologySheet.cell(row=i + 6, column=col_id + 1, value=row[5]) - # changeInMetadataValuesTopologySheet.cell(row=i + 6, column=7, value=row[6]) + # changeInMetavaluesTopologySheet.cell(row=i + 6, column=col_id + 1, value=row[5]) + # changeInMetavaluesTopologySheet.cell(row=i + 6, column=7, value=row[6]) if not row[5] is None and row[5] != '': count_first_source += 1 if not row[6] is None and row[6] != '': count_first_method += 1 else: changeInMetadataToTopologySheet.cell(row=i + 6, column=col_id + 2, value=row[5]) changeInMetadataToTopologySheet.cell(row=i + 6, column=8, value=row[6]) - # changeInMetadataValuesTopologySheet.cell(row=i + 6, column=col_id + 2, value=row[5]) - # changeInMetadataValuesTopologySheet.cell(row=i + 6, column=8, value=row[6]) + # changeInMetavaluesTopologySheet.cell(row=i + 6, column=col_id + 2, value=row[5]) + # changeInMetavaluesTopologySheet.cell(row=i + 6, column=8, value=row[6]) if not row[5] is None and row[5] != '': count_second_method += 1 if not row[6] is None and row[6] != '': count_second_source += 1 # if len(row) < 10: @@ -382,15 +382,15 @@ def btn_compare_scenariosOnButtonClick( self, event ): if cell == selectedScenarioName1: changeInMetadataToTopologySheet.cell(row=i + 6, column=5, value=row[10]) changeInMetadataToTopologySheet.cell(row=i + 6, column=7, value=row[11]) - # changeInMetadataValuesTopologySheet.cell(row=i + 6, column=5, value=row[10]) - # changeInMetadataValuesTopologySheet.cell(row=i + 6, column=7, value=row[11]) + # changeInMetavaluesTopologySheet.cell(row=i + 6, column=5, value=row[10]) + # changeInMetavaluesTopologySheet.cell(row=i + 6, column=7, value=row[11]) if not row[10] is None and row[10] != '': count_first_source += 1 if not row[11] is None and row[11] != '': count_first_method += 1 else: changeInMetadataToTopologySheet.cell(row=i + 6, column=6, value=row[10]) changeInMetadataToTopologySheet.cell(row=i + 6, column=8, value=row[11]) - # changeInMetadataValuesTopologySheet.cell(row=i + 6, column=6, value=row[10]) - # changeInMetadataValuesTopologySheet.cell(row=i + 6, column=8, value=row[11]) + # changeInMetavaluesTopologySheet.cell(row=i + 6, column=6, value=row[10]) + # changeInMetavaluesTopologySheet.cell(row=i + 6, column=8, value=row[11]) if not row[10] is None and row[10] != '': count_second_method += 1 if not row[11] is None and row[11] != '': count_second_source += 1 break @@ -399,9 +399,9 @@ def btn_compare_scenariosOnButtonClick( self, event ): changeInMetadataToTopologySheet.cell(row=i + 6, column=5, value="") changeInMetadataToTopologySheet.cell(row=i + 6, column=6, value="") - # changeInMetadataValuesTopologySheet.cell(row=i + 6, column=9, value=row[10]) - # changeInMetadataValuesTopologySheet.cell(row=i + 6, column=5, value="") - # changeInMetadataValuesTopologySheet.cell(row=i + 6, column=6, value="") + # changeInMetavaluesTopologySheet.cell(row=i + 6, column=9, value=row[10]) + # changeInMetavaluesTopologySheet.cell(row=i + 6, column=5, value="") + # changeInMetavaluesTopologySheet.cell(row=i + 6, column=6, value="") count_common_source += 1 count_first_source -= 1 count_second_source -= 1 @@ -410,9 +410,9 @@ def btn_compare_scenariosOnButtonClick( self, event ): changeInMetadataToTopologySheet.cell(row=i + 6, column=7, value="") changeInMetadataToTopologySheet.cell(row=i + 6, column=8, value="") - # changeInMetadataValuesTopologySheet.cell(row=i + 6, column=10, value=row[11]) - # changeInMetadataValuesTopologySheet.cell(row=i + 6, column=7, value="") - # changeInMetadataValuesTopologySheet.cell(row=i + 6, column=8, value="") + # changeInMetavaluesTopologySheet.cell(row=i + 6, column=10, value=row[11]) + # changeInMetavaluesTopologySheet.cell(row=i + 6, column=7, value="") + # changeInMetavaluesTopologySheet.cell(row=i + 6, column=8, value="") count_first_method -= 1 count_second_method -= 1 count_common_method += 1 @@ -434,16 +434,16 @@ def btn_compare_scenariosOnButtonClick( self, event ): for col_id, cell in enumerate(row): if col_id < 4: # changeInMetadataToTopologySheet.cell(row=i + 6, column=col_id + 1, value=cell) - changeInMetadataValuesTopologySheet.cell(row=i + 6, column=col_id + 1, value=cell) + changeInMetavaluesTopologySheet.cell(row=i + 6, column=col_id + 1, value=cell) elif col_id == 5: if cell == selectedScenarioName1: - changeInMetadataValuesTopologySheet.cell(row=i + 6, column=5, value=row[6]) - changeInMetadataValuesTopologySheet.cell(row=i + 6, column=7, value=row[7]) + changeInMetavaluesTopologySheet.cell(row=i + 6, column=5, value=row[6]) + changeInMetavaluesTopologySheet.cell(row=i + 6, column=7, value=row[7]) if not row[6] is None and row[6] != '': count_first_source_attr += 1 if not row[7] is None and row[7] != '': count_first_method_attr += 1 else: - changeInMetadataValuesTopologySheet.cell(row=i + 6, column=6, value=row[6]) - changeInMetadataValuesTopologySheet.cell(row=i + 6, column=8, value=row[7]) + changeInMetavaluesTopologySheet.cell(row=i + 6, column=6, value=row[6]) + changeInMetavaluesTopologySheet.cell(row=i + 6, column=8, value=row[7]) if not row[6] is None and row[6] != '': count_second_method_attr += 1 if not row[7] is None and row[7] != '': count_second_source_attr += 1 # if len(row) < 10: @@ -452,15 +452,15 @@ def btn_compare_scenariosOnButtonClick( self, event ): if cell == selectedScenarioName1: # changeInMetadataToTopologySheet.cell(row=i + 6, column=5, value=row[10]) # changeInMetadataToTopologySheet.cell(row=i + 6, column=7, value=row[11]) - changeInMetadataValuesTopologySheet.cell(row=i + 6, column=5, value=row[11]) - changeInMetadataValuesTopologySheet.cell(row=i + 6, column=7, value=row[12]) + changeInMetavaluesTopologySheet.cell(row=i + 6, column=5, value=row[11]) + changeInMetavaluesTopologySheet.cell(row=i + 6, column=7, value=row[12]) if not row[11] is None and row[11] != '': count_first_source_attr += 1 if not row[12] is None and row[12] != '': count_first_method_attr += 1 else: # changeInMetadataToTopologySheet.cell(row=i + 6, column=6, value=row[11]) # changeInMetadataToTopologySheet.cell(row=i + 6, column=8, value=row[12]) - changeInMetadataValuesTopologySheet.cell(row=i + 6, column=6, value=row[11]) - changeInMetadataValuesTopologySheet.cell(row=i + 6, column=8, value=row[12]) + changeInMetavaluesTopologySheet.cell(row=i + 6, column=6, value=row[11]) + changeInMetavaluesTopologySheet.cell(row=i + 6, column=8, value=row[12]) if not row[11] is None and row[11] != '': count_second_method_attr += 1 if not row[12] is None and row[12] != '': count_second_source_attr += 1 break @@ -469,9 +469,9 @@ def btn_compare_scenariosOnButtonClick( self, event ): # changeInMetadataToTopologySheet.cell(row=i + 6, column=5, value="") # changeInMetadataToTopologySheet.cell(row=i + 6, column=6, value="") - changeInMetadataValuesTopologySheet.cell(row=i + 6, column=9, value=row[11]) - changeInMetadataValuesTopologySheet.cell(row=i + 6, column=5, value="") - changeInMetadataValuesTopologySheet.cell(row=i + 6, column=6, value="") + changeInMetavaluesTopologySheet.cell(row=i + 6, column=9, value=row[11]) + changeInMetavaluesTopologySheet.cell(row=i + 6, column=5, value="") + changeInMetavaluesTopologySheet.cell(row=i + 6, column=6, value="") count_common_source_attr += 1 count_first_source_attr -= 1 count_second_source_attr -= 1 @@ -480,9 +480,9 @@ def btn_compare_scenariosOnButtonClick( self, event ): # changeInMetadataToTopologySheet.cell(row=i + 6, column=7, value="") # changeInMetadataToTopologySheet.cell(row=i + 6, column=8, value="") - changeInMetadataValuesTopologySheet.cell(row=i + 6, column=10, value=row[12]) - changeInMetadataValuesTopologySheet.cell(row=i + 6, column=7, value="") - changeInMetadataValuesTopologySheet.cell(row=i + 6, column=8, value="") + changeInMetavaluesTopologySheet.cell(row=i + 6, column=10, value=row[12]) + changeInMetavaluesTopologySheet.cell(row=i + 6, column=7, value="") + changeInMetavaluesTopologySheet.cell(row=i + 6, column=8, value="") count_common_method_attr += 1 count_second_method_attr -= 1 count_first_method_attr -= 1 @@ -526,21 +526,21 @@ def btn_compare_scenariosOnButtonClick( self, event ): for row_id, row in enumerate(list_changInValue): for col_id, cell in enumerate(row): - changeInDataValuesSheet.cell(row=row_id + 6, column=col_id+1, value=cell) + changeInValuesSheet.cell(row=row_id + 6, column=col_id+1, value=cell) - changeInDataValuesSheet.cell(row=2, column=6, value=selectedScenarioName1) - changeInDataValuesSheet.cell(row=2, column=7, value=selectedScenarioName2) - allValueCount = self.compareScenarios.AllDataValuesMapperCount(selectedDataset, selectedMasterNetworkName) - changeInDataValuesSheet.cell(row=2, column=6, value=first_scenario_value_count) - changeInDataValuesSheet.cell(row=3, column=6, value=str(round(float(first_scenario_value_count)*100.0/ float(allValueCount) , 2)) + '%') - changeInDataValuesSheet.cell(row=2, column=7, value=second_scenario_value_count) - changeInDataValuesSheet.cell(row=3, column=7, value=str(round(float(second_scenario_value_count)*100/ float(allValueCount), 2)) + '%') + changeInValuesSheet.cell(row=2, column=6, value=selectedScenarioName1) + changeInValuesSheet.cell(row=2, column=7, value=selectedScenarioName2) + allValueCount = self.compareScenarios.AllValuesMapperCount(selectedDataset, selectedMasterNetworkName) + changeInValuesSheet.cell(row=2, column=6, value=first_scenario_value_count) + changeInValuesSheet.cell(row=3, column=6, value=str(round(float(first_scenario_value_count)*100.0/ float(allValueCount) , 2)) + '%') + changeInValuesSheet.cell(row=2, column=7, value=second_scenario_value_count) + changeInValuesSheet.cell(row=3, column=7, value=str(round(float(second_scenario_value_count)*100/ float(allValueCount), 2)) + '%') common_count = allValueCount - first_scenario_value_count - second_scenario_value_count - changeInDataValuesSheet.cell(row=2, column=8, value=common_count) - changeInDataValuesSheet.cell(row=3, column=8, value=str(round(float(common_count) * 100/ float(allValueCount), 2)) + '%') - changeInDataValuesSheet.cell(row=2, column=9, value=allValueCount) - changeInDataValuesSheet.cell(row=3, column=9, value='100%') + changeInValuesSheet.cell(row=2, column=8, value=common_count) + changeInValuesSheet.cell(row=3, column=8, value=str(round(float(common_count) * 100/ float(allValueCount), 2)) + '%') + changeInValuesSheet.cell(row=2, column=9, value=allValueCount) + changeInValuesSheet.cell(row=3, column=9, value='100%') additionsToTopologySheet.cell(row=2, column=2, value=selectedScenarioName1) additionsToTopologySheet.cell(row=2, column=8, value=selectedScenarioName2) @@ -550,10 +550,10 @@ def btn_compare_scenariosOnButtonClick( self, event ): changeInMetadataToTopologySheet.cell(row=4, column=7, value=selectedScenarioName1) changeInMetadataToTopologySheet.cell(row=4, column=8, value=selectedScenarioName2) - changeInMetadataValuesTopologySheet.cell(row=4, column=5, value=selectedScenarioName1) - changeInMetadataValuesTopologySheet.cell(row=4, column=6, value=selectedScenarioName2) - changeInMetadataValuesTopologySheet.cell(row=4, column=7, value=selectedScenarioName1) - changeInMetadataValuesTopologySheet.cell(row=4, column=8, value=selectedScenarioName2) + changeInMetavaluesTopologySheet.cell(row=4, column=5, value=selectedScenarioName1) + changeInMetavaluesTopologySheet.cell(row=4, column=6, value=selectedScenarioName2) + changeInMetavaluesTopologySheet.cell(row=4, column=7, value=selectedScenarioName1) + changeInMetavaluesTopologySheet.cell(row=4, column=8, value=selectedScenarioName2) allMetaValueCount = self.compareScenarios.AllTopologyMetadataCount(selectedDataset, selectedMasterNetworkName) changeInMetadataToTopologySheet.cell(row=2, column=5, value=count_first_source) @@ -578,28 +578,28 @@ def btn_compare_scenariosOnButtonClick( self, event ): changeInMetadataToTopologySheet.cell(row=3, column=11, value='100%') allAttrVauleCount = self.compareScenarios.AllMetadataAttributesCount(selectedDataset, selectedMasterNetworkName) - changeInMetadataValuesTopologySheet.cell(row=2, column=5, value=count_first_source_attr) - changeInMetadataValuesTopologySheet.cell(row=3, column=5, value=str(round( + changeInMetavaluesTopologySheet.cell(row=2, column=5, value=count_first_source_attr) + changeInMetavaluesTopologySheet.cell(row=3, column=5, value=str(round( float(count_first_source_attr) * 100/ float(allAttrVauleCount - count_common_source_attr), 2)) + '%') - changeInMetadataValuesTopologySheet.cell(row=2, column=6, value=count_second_source_attr) - changeInMetadataValuesTopologySheet.cell(row=3, column=6, value=str(round( + changeInMetavaluesTopologySheet.cell(row=2, column=6, value=count_second_source_attr) + changeInMetavaluesTopologySheet.cell(row=3, column=6, value=str(round( float(count_second_source_attr) * 100/ float(allAttrVauleCount - count_common_source_attr), 2)) + '%') - changeInMetadataValuesTopologySheet.cell(row=2, column=7, value=count_first_method_attr) - changeInMetadataValuesTopologySheet.cell(row=3, column=7, value=str(round( + changeInMetavaluesTopologySheet.cell(row=2, column=7, value=count_first_method_attr) + changeInMetavaluesTopologySheet.cell(row=3, column=7, value=str(round( float(count_first_method_attr) * 100/ float(allAttrVauleCount - count_common_method_attr), 2)) + '%') - changeInMetadataValuesTopologySheet.cell(row=2, column=8, value=count_second_method_attr) - changeInMetadataValuesTopologySheet.cell(row=3, column=8, value=str(round( + changeInMetavaluesTopologySheet.cell(row=2, column=8, value=count_second_method_attr) + changeInMetavaluesTopologySheet.cell(row=3, column=8, value=str(round( float(count_second_method_attr) * 100/ float(allAttrVauleCount - count_common_method_attr), 2)) + '%') rest_source_att = allAttrVauleCount - count_first_source_attr - count_second_source_attr - changeInMetadataValuesTopologySheet.cell(row=2, column=9, value=count_common_source) - changeInMetadataValuesTopologySheet.cell(row=3, column=9, value=str(round( + changeInMetavaluesTopologySheet.cell(row=2, column=9, value=count_common_source) + changeInMetavaluesTopologySheet.cell(row=3, column=9, value=str(round( float(rest_source_att) * 100/ float(allAttrVauleCount), 2)) + '%') rest_method_attr = allAttrVauleCount - count_first_method_attr - count_second_method_attr - changeInMetadataValuesTopologySheet.cell(row=2, column=10, value=count_common_method) - changeInMetadataValuesTopologySheet.cell(row=3, column=10, value=str(round( + changeInMetavaluesTopologySheet.cell(row=2, column=10, value=count_common_method) + changeInMetavaluesTopologySheet.cell(row=3, column=10, value=str(round( float(rest_method_attr) * 100/ float(allAttrVauleCount), 2)) + '%') - changeInMetadataValuesTopologySheet.cell(row=2, column=11, value=allAttrVauleCount) - changeInMetadataValuesTopologySheet.cell(row=3, column=11, value='100%') + changeInMetavaluesTopologySheet.cell(row=2, column=11, value=allAttrVauleCount) + changeInMetavaluesTopologySheet.cell(row=3, column=11, value='100%') try: book2.save(self.path) diff --git a/src_1.0/src_1.0_MacOS_test/viewer/dlg_exit_DB.py b/src/viewer/dlg_exit_DB.py similarity index 100% rename from src_1.0/src_1.0_MacOS_test/viewer/dlg_exit_DB.py rename to src/viewer/dlg_exit_DB.py diff --git a/src_1.0/src_1.0_MacOS_test/viewer/dlg_query_metadata.py b/src/viewer/dlg_query_metadata.py similarity index 100% rename from src_1.0/src_1.0_MacOS_test/viewer/dlg_query_metadata.py rename to src/viewer/dlg_query_metadata.py diff --git a/src_1.0/src_1.0_MacOS_test/viewer/dlg_query_model.py b/src/viewer/dlg_query_model.py similarity index 100% rename from src_1.0/src_1.0_MacOS_test/viewer/dlg_query_model.py rename to src/viewer/dlg_query_model.py diff --git a/src_1.0/src_1.0_MacOS_test/viewer/dlg_query_network.py b/src/viewer/dlg_query_network.py similarity index 100% rename from src_1.0/src_1.0_MacOS_test/viewer/dlg_query_network.py rename to src/viewer/dlg_query_network.py diff --git a/src_1.0/viewer/frm_Home.py b/src/viewer/frm_Home.py similarity index 99% rename from src_1.0/viewer/frm_Home.py rename to src/viewer/frm_Home.py index c48e45d..568cd63 100644 --- a/src_1.0/viewer/frm_Home.py +++ b/src/viewer/frm_Home.py @@ -51,6 +51,7 @@ def rtbn_ShapefileToWaMDaMOnRibbonButtonClicked( self, event ): sh=fSH.dlg_ShapefileToWaMDaM(None) sh.ShowModal() + def rtbnCrossTabSeasonalToWaMDaMOnRibbonButtonClicked( self, event ): import dlg_CrossTabSeasonalToWaMDaM as fCTS CTS=fCTS.dlg_CrossTabSeasonalToWaMDaM(None) diff --git a/src_1.0/controller/stp4_loadDataValue/loadDualValues.py b/src_1.0/controller/stp4_loadDataValue/loadDualValues.py deleted file mode 100644 index 71a893b..0000000 --- a/src_1.0/controller/stp4_loadDataValue/loadDualValues.py +++ /dev/null @@ -1,252 +0,0 @@ -# loadDualValues.py - -# Provides helper functions for datavalues loading -from .helper import LoadingUtils - -# Import the classes from ConnectDB_ParseExcel.py. These classes are inherited by LoadMetaData -from ..ConnectDB_ParseExcel import * - -# The and_ method is used to query the database with multiple conditions -from sqlalchemy import and_ - -# Import required variables (this are the metadata sheet names and their start values in the excel file) -from ..ReadWorkbook_SheetsNames import * - -from model import SqlAlchemy - - -class LoadDualValues(Parse_Excel_File, LoadingUtils): - """ - Class used to load Binary data to tables. - ::: Inherits From ::: - Parse_Excel_File: Class used to parse Excel files - DB_Setup: Class used to setup and create a connection - to the database. - """ - - def __init__(self, filename): - """ - This is the LoadBinary Constructor used to initialize inherited - classes and some variables. - :param filename: Sent to Parse_Excel_File class during instantiation - :return: - """ - super(LoadDualValues, self).__init__(filename) - self.setup = DB_Setup() - # self.__session = self.init() - self.__session = self.setup.get_session() - self.work_sheet = self.parse_object_control_value([datavalues_sheets_ordered[5]]) - - def load_data(self): - """ - This method is used to parse data from each sheet to its - appropriate table in the database. - Due to the structure of the excel file, some hard coding - was done to get data accurately. - It functions by iterating over the work_sheet dictionary - and getting each corresponding sheet_name and sheetrows to - load the table. - It starts by querying for id's of the datavalue properties. - then using some tests to load the data value appropriately to - avoid data duplication and creating links between tables. - :return: None - """ - for sheet_name, sheet_rows in self.work_sheet.items(): - temp = sheet_rows[:] - - # Detecting start of data in the DataValues sheet - for row_id, row in enumerate(temp): - temp_row = [cell.value for cell in row] - if 'DualValues_table' in temp_row: - temp = sheet_rows[row_id + 4:] - break - - if len(temp) < 1: - continue - # rows are stored for comparison to determine if a row is similar to others or different - temp_row = [cell.value for cell in temp[0]] - temp_row.pop(2) - stored_rows = [temp_row] - scenario_name = temp[0][2] - for row_id, row in enumerate(temp): - - if all('' == cell.value for cell in row): - break - - if any('' == cell.value for cell in row[:-1]): - raise Exception( - "Some Empty Fields where found in Dual Values.\n Please fill all Required fields in " + sheet_name) - - if row[-1].value is None: - continue - - if row[0].value == "": - raise Exception('Error in {} row of "DualValues_table" of sheet "{}"\nField named "ObjectType" is empty.\nThis field should not be empty.\nPlease fill this field to a value.' - .format(row_id, sheet_name)) - if row[1].value == "": - raise Exception('Error in {} row of "DualValues_table" of sheet "{}"\nField named "InstancenName" is empty.\nThis field should not be empty.\nPlease fill this field to a value.' - .format(row_id, sheet_name)) - if row[2].value == "": - raise Exception('Error in {} row of "DualValues_table" of sheet "{}"\nField named "ScenarioName" is empty.\nThis field should not be empty.\nPlease fill this field to a value.' - .format(row_id, sheet_name)) - if row[3].value == "": - raise Exception('Error in {} row of "DualValues_table" of sheet "{}"\nField named "AttributeName" is empty.\nThis field should not be empty.\nPlease fill this field to a value.' - .format(row_id, sheet_name)) - if row[4].value == "": - raise Exception('Error in {} row of "DualValues_table" of sheet "{}"\nField named "SourceName" is empty.\nThis field should not be empty.\nPlease fill this field to a value.' - .format(row_id, sheet_name)) - if row[5].value == "": - raise Exception('Error in {} row of "DualValues_table" of sheet "{}"\nField named "MethodName" is empty.\nThis field should not be empty.\nPlease fill this field to a value.' - .format(row_id, sheet_name)) - if row[6].value == "": - raise Exception('Error in {} row of "DualValues_table" of sheet "{}"\nField named "DualValue" is empty.\nThis field should not be empty.\nPlease fill this field to a value.' - .format(row_id, sheet_name)) - - # test for datatype - if not self.data_type_test(self.__session, row, 'DualValues'): - raise Exception("'{}' attribute is not associated to {} Datatype". - format(row[3].value, 'DualValues')) - - diff_scene = False - temp_row = [cell.value for cell in row[:]] - temp_row.pop(2) - - # Checking row against stored rows to determine if its different or similar - for each in stored_rows: - if temp_row == each: # checking if current row is same as any previous rows - if row[2].value != scenario_name.value: # basing difference in terms of scenario name - diff_scene = True - break - break - - stored_rows.append(temp_row) - - boolean = SqlAlchemy.DualValues() - attrib_id, instance_id, scenario_id, source_id, method_id = self.get_ids(row, self.__session, sheet_name, row_id) - - # Test if the provided attribute name belongs to object type - self.test_properties(self.__session, row, sheet_name) - - # getting datavaluemapper id using the above params fro Mapping table - datavalues = self.__session.query(SqlAlchemy.Mappings).filter( - and_( - SqlAlchemy.Mappings.AttributeID == attrib_id, - SqlAlchemy.Mappings.InstanceID == instance_id, - SqlAlchemy.Mappings.SourceID == source_id, - SqlAlchemy.Mappings.MethodID == method_id - ) - ).all() - - ''' - The Idea in creating link used here is to query the datavalue - table to get the DataValueMapperID using a combination of - (aggregattionstatisticcvid, aggreationInterval, Internvaltimeunitcvid) - for the current value combination. Only required fields are considered. - if the value already exists in the table, the Mapping id is - selected and loaded with the scenario id else a new record - is created in the Mapping table and link in the scenarioMapping - table. - ''' - - value = None - datavalues_id = None - found = False - try: - # skips searching datavaluemapperid for required field if its attribs are not found in mapping table - # this means a new datavaluemapperID will be created. this occurs when the ros is different - if not datavalues: - raise Exception - - # If the mapperID exists for the attribs in the current row, we then search if the value exists for - # the row is stored in the db, if yes we then try to match with the mappingid to get datavaluemapper - datavalues_id = self.__session.query(SqlAlchemy.DualValues).filter( - SqlAlchemy.DualValues.DualvaluemeaningCV == row[6].value - ).all() - - result = [datavaluemapper.DataValuesMapperID for datavaluemapper in datavalues_id] - - # check for mapping with same datavaluesmapper as the data value. - # if found, reuse of mapping id is emminent. - for mapping in datavalues: - if found: - break - for each in result[:]: - if mapping.DataValuesMapperID == each: - datavalues = mapping - found = True - break - - # if the current value datvaluesmapperID is not found matching. - # if its not found, new entry is created - if not found: - raise Exception - - value = True - except Exception as e: - datavalues = None - datavalues_id = None - - # Creating New entry, datavaluemapperID and mappingID - if not datavalues and not diff_scene: - datavalmapper = self.load_data_values(self.__session) - dataval_map = SqlAlchemy.Mappings() - dataval_map.AttributeID = attrib_id - dataval_map.InstanceID = instance_id - dataval_map.SourceID = source_id - dataval_map.MethodID = method_id - # creating new datavaluemapper if the row is in a different block - if datavalues_id is None and not diff_scene: - self.setup.push_data(datavalmapper) - datavalues_id = datavalmapper.DataValuesMapperID - dataval_map.DataValuesMapperID = datavalmapper.DataValuesMapperID - elif not diff_scene: - dataval_map.DataValuesMapperID = datavalues_id - self.setup.push_data(dataval_map) - - else: - datavalues_id = datavalues.DataValuesMapperID - - # Creating new scenariomapping if scenarioID-mappingID does not exists. - # Starts by searchine for the mappingID in case its just been created, then tests to see if a - # scenarioID-mappingID exists, if yes, it skips, if no, it creates an entry - scenariomap = SqlAlchemy.ScenarioMappings() - scenariomap.ScenarioID = scenario_id - - if datavalues: - scenariomap.MappingID = datavalues.MappingID - else: - scenariomap.MappingID = self.__session.query(SqlAlchemy.Mappings).filter( - and_( - SqlAlchemy.Mappings.AttributeID == attrib_id, - SqlAlchemy.Mappings.InstanceID == instance_id, - SqlAlchemy.Mappings.SourceID == source_id, - SqlAlchemy.Mappings.MethodID == method_id, - SqlAlchemy.Mappings.DataValuesMapperID == datavalues_id - ) - ).first().MappingID - - # test to ensure there is no scenarioID-mappingID relationship existing yet. - try: - test = self.__session.query(SqlAlchemy.ScenarioMappings).filter( - and_( - SqlAlchemy.ScenarioMappings.MappingID == scenariomap.MappingID, - SqlAlchemy.ScenarioMappings.ScenarioID == scenariomap.ScenarioID - ) - ).first().ScenarioMappingID - except: - self.setup.push_data(scenariomap) - - if row[6].value is not None: - # insert a value if only the value cell is not none, the value does not exists in the database - # and the row holding the value is similar. if any of this conditions fails, the value not inserted - if not value or not diff_scene: - boolean.Dualvalue = row[6].value - boolean.DualvaluemeaningCV = self.__session.query(SqlAlchemy.CV_DualValueMeaning).filter( - SqlAlchemy.CV_DualValueMeaning.Name == row[7].value - ).first().Name - boolean.DataValuesMapperID = datavalues_id - self.setup.push_data(boolean) - value = False - - def add_data(self): - self.setup.add_data() diff --git a/src_1.0/src_1.0_MacOS_test/controller/ConnectDB_ParseExcel.pyc b/src_1.0/src_1.0_MacOS_test/controller/ConnectDB_ParseExcel.pyc deleted file mode 100644 index ecb1cdd..0000000 Binary files a/src_1.0/src_1.0_MacOS_test/controller/ConnectDB_ParseExcel.pyc and /dev/null differ diff --git a/src_1.0/src_1.0_MacOS_test/controller/ReadWorkbook_SheetsNames.pyc b/src_1.0/src_1.0_MacOS_test/controller/ReadWorkbook_SheetsNames.pyc deleted file mode 100644 index 7c89ce4..0000000 Binary files a/src_1.0/src_1.0_MacOS_test/controller/ReadWorkbook_SheetsNames.pyc and /dev/null differ diff --git a/src_1.0/src_1.0_MacOS_test/controller/__init__.pyc b/src_1.0/src_1.0_MacOS_test/controller/__init__.pyc deleted file mode 100644 index de93164..0000000 Binary files a/src_1.0/src_1.0_MacOS_test/controller/__init__.pyc and /dev/null differ diff --git a/src_1.0/src_1.0_MacOS_test/controller/shapefileExporter.py b/src_1.0/src_1.0_MacOS_test/controller/shapefileExporter.py deleted file mode 100644 index 2a88112..0000000 --- a/src_1.0/src_1.0_MacOS_test/controller/shapefileExporter.py +++ /dev/null @@ -1,116 +0,0 @@ - - -""" - The shapefileExporter.py is a python script use to reshape - a shapefile data and write the output result in the appropriate - excel sheets for WaMDaM template. it is made up of: - - - shapefileExporter(): This is the function which shapes the excel file - by looking for distinct attribute types and doing a cross - multiplication with the file properties and the attributes - values using the corresponding object code. - Warning: if format of file changes, script will fail to work - - - write_data(): This is a helper function used in accomplishing shapefileExporter() - all it does is write the data to the appropriate sheets -""" - -# The xlrd library is used for only reading data in excel files. its is quite fast at that -import xlrd as excel - -# This library is used here to write data to an excel file -from openpyxl import load_workbook - - -def shapefileExporter(workbook, input_sheet='Shapefile_input'): - """ - This function parses the input file for shapefileExporter and get all required - matrices and control data. the user must make sure that the excel file - has sheetnames ('DualValues', 'NumericValues' and 'DescriptorValues') - :param workbook: holds the excel file - :param input_sheet: holds the input sheet - :return: None - """ - book = excel.open_workbook(workbook) - try: - sheet = book.sheet_by_name(input_sheet) - except: - raise Exception('Input sheet {} not found in the provided Excel file \n Please select valid excel file'.format(input_sheet)) - - rows = [rows for rows in sheet.get_rows()] - - - sources = [cell for cell in rows[1][3:]] - - methods = [cell for cell in rows[3][3:]] - - attributes = [str(cell.value) for cell in rows[5][3:]] - - attrib_code = [cell for cell in rows[7][3:]] - - left_data = [row[0:3] for row in rows[8:]] - - - right_data = [row[3:] for row in rows[8:]] - - book2 = load_workbook(workbook) - - max_row = [9, 9, 9, 9] - try: - for ida, attrib in enumerate(attributes): - - if attrib == 'DualValues': - # write_data('4_DualValues', book2, ida, attrib_code, sources, methods, left_data, right_data, max_row[1]) - max_row[1] = write_data('4_DualValues', book2, ida, attrib_code, sources, methods, left_data, right_data, max_row[1] + 1) - - elif attrib == 'NumericValues': - # write_data('4_NumericValues', book2, ida, attrib_code, sources, methods, left_data, right_data, max_row[2]) - max_row[2] = write_data('4_NumericValues', book2, ida, attrib_code, sources, methods, left_data, right_data, max_row[2] + 1) - - elif attrib == 'DescriptorValues': - # write_data('4_DescriptorValues', book2, ida, attrib_code, sources, methods, left_data, right_data, max_row[3]) - max_row[3] = write_data('4_DescriptorValues', book2, ida, attrib_code, sources, methods, left_data, right_data, max_row[3] + 1) - except Exception as e: - raise Exception(e.message) - - - book2.save(workbook) - - -def write_data(sheet_name, workbook, ida, attrib_code, sources, methods, left_data, right_data, max_row): - """ - This is a helper function for shapefileExporter to write data in - the appropriate excel sheet. - :param sheet_name: Sheet name sent from shapefileExporter() function - :param workbook: The excel workbook in question - :param ida: Attribute index (integer) - :param attrib_code: Attribute code (eg 'DAM_ID_DamUtah') - :param left_data: utahDams properties - :param right_data: Attribute values - :return: - """ - try: - sheet = workbook.get_sheet_by_name(sheet_name) - except: - raise Exception('Output sheet {} not found in Excel File\nPlease select a valid excel file'.format(sheet_name)) - temp = list() - for idd, data in enumerate(left_data): - content = data[:] - content.append(attrib_code[ida]) - content.append(sources[ida]) - content.append(methods[ida]) - content += [right_data[idd][ida]] - temp.append(content) - - # writing parsing result to appropriate excel sheet - - for rowID, row in enumerate(temp): - for colID, cell in enumerate(row): - try: - sheet.cell(row=rowID + max_row, column=colID + 1, value=unicode(cell.value)) - except Exception as e: - if e.args[0] == 'ascii': - # raise Exception(e) - raise Exception("There is word '" + e.args[1] + "' that is not a unicode type in the sheet. Please fix the word.") - raise Exception(e) - return rowID + max_row diff --git a/src_1.0/src_1.0_MacOS_test/controller/stp0_loadCVs.pyc b/src_1.0/src_1.0_MacOS_test/controller/stp0_loadCVs.pyc deleted file mode 100644 index 80b77c3..0000000 Binary files a/src_1.0/src_1.0_MacOS_test/controller/stp0_loadCVs.pyc and /dev/null differ diff --git a/src_1.0/src_1.0_MacOS_test/controller/stp1_loadMetadata.pyc b/src_1.0/src_1.0_MacOS_test/controller/stp1_loadMetadata.pyc deleted file mode 100644 index 844a926..0000000 Binary files a/src_1.0/src_1.0_MacOS_test/controller/stp1_loadMetadata.pyc and /dev/null differ diff --git a/src_1.0/src_1.0_MacOS_test/controller/stp2_loadDataStructure.pyc b/src_1.0/src_1.0_MacOS_test/controller/stp2_loadDataStructure.pyc deleted file mode 100644 index 9eec6ef..0000000 Binary files a/src_1.0/src_1.0_MacOS_test/controller/stp2_loadDataStructure.pyc and /dev/null differ diff --git a/src_1.0/src_1.0_MacOS_test/controller/stp3_loadNetworks.pyc b/src_1.0/src_1.0_MacOS_test/controller/stp3_loadNetworks.pyc deleted file mode 100644 index 8bd07ad..0000000 Binary files a/src_1.0/src_1.0_MacOS_test/controller/stp3_loadNetworks.pyc and /dev/null differ diff --git a/src_1.0/src_1.0_MacOS_test/controller/stp4_loadDataValue/MultiAttributeSeries.pyc b/src_1.0/src_1.0_MacOS_test/controller/stp4_loadDataValue/MultiAttributeSeries.pyc deleted file mode 100644 index 81c2250..0000000 Binary files a/src_1.0/src_1.0_MacOS_test/controller/stp4_loadDataValue/MultiAttributeSeries.pyc and /dev/null differ diff --git a/src_1.0/src_1.0_MacOS_test/controller/stp4_loadDataValue/__init__.pyc b/src_1.0/src_1.0_MacOS_test/controller/stp4_loadDataValue/__init__.pyc deleted file mode 100644 index 781d11a..0000000 Binary files a/src_1.0/src_1.0_MacOS_test/controller/stp4_loadDataValue/__init__.pyc and /dev/null differ diff --git a/src_1.0/src_1.0_MacOS_test/controller/stp4_loadDataValue/helper.pyc b/src_1.0/src_1.0_MacOS_test/controller/stp4_loadDataValue/helper.pyc deleted file mode 100644 index c006450..0000000 Binary files a/src_1.0/src_1.0_MacOS_test/controller/stp4_loadDataValue/helper.pyc and /dev/null differ diff --git a/src_1.0/src_1.0_MacOS_test/controller/stp4_loadDataValue/loadDescriptorValues.pyc b/src_1.0/src_1.0_MacOS_test/controller/stp4_loadDataValue/loadDescriptorValues.pyc deleted file mode 100644 index d6490c1..0000000 Binary files a/src_1.0/src_1.0_MacOS_test/controller/stp4_loadDataValue/loadDescriptorValues.pyc and /dev/null differ diff --git a/src_1.0/src_1.0_MacOS_test/controller/stp4_loadDataValue/loadDualValues.pyc b/src_1.0/src_1.0_MacOS_test/controller/stp4_loadDataValue/loadDualValues.pyc deleted file mode 100644 index 39c6593..0000000 Binary files a/src_1.0/src_1.0_MacOS_test/controller/stp4_loadDataValue/loadDualValues.pyc and /dev/null differ diff --git a/src_1.0/src_1.0_MacOS_test/controller/stp4_loadDataValue/loadElectronicFiles.pyc b/src_1.0/src_1.0_MacOS_test/controller/stp4_loadDataValue/loadElectronicFiles.pyc deleted file mode 100644 index adf8845..0000000 Binary files a/src_1.0/src_1.0_MacOS_test/controller/stp4_loadDataValue/loadElectronicFiles.pyc and /dev/null differ diff --git a/src_1.0/src_1.0_MacOS_test/controller/stp4_loadDataValue/loadNumericValues.pyc b/src_1.0/src_1.0_MacOS_test/controller/stp4_loadDataValue/loadNumericValues.pyc deleted file mode 100644 index 2e41c9d..0000000 Binary files a/src_1.0/src_1.0_MacOS_test/controller/stp4_loadDataValue/loadNumericValues.pyc and /dev/null differ diff --git a/src_1.0/src_1.0_MacOS_test/controller/stp4_loadDataValue/loadSeasonalNumericValues.pyc b/src_1.0/src_1.0_MacOS_test/controller/stp4_loadDataValue/loadSeasonalNumericValues.pyc deleted file mode 100644 index 8815638..0000000 Binary files a/src_1.0/src_1.0_MacOS_test/controller/stp4_loadDataValue/loadSeasonalNumericValues.pyc and /dev/null differ diff --git a/src_1.0/src_1.0_MacOS_test/controller/stp4_loadDataValue/loadTimeSeries.pyc b/src_1.0/src_1.0_MacOS_test/controller/stp4_loadDataValue/loadTimeSeries.pyc deleted file mode 100644 index 90fca26..0000000 Binary files a/src_1.0/src_1.0_MacOS_test/controller/stp4_loadDataValue/loadTimeSeries.pyc and /dev/null differ diff --git a/src_1.0/src_1.0_MacOS_test/controller/wamdamAPI/GetComapreScenarios.pyc b/src_1.0/src_1.0_MacOS_test/controller/wamdamAPI/GetComapreScenarios.pyc deleted file mode 100644 index 64b8a76..0000000 Binary files a/src_1.0/src_1.0_MacOS_test/controller/wamdamAPI/GetComapreScenarios.pyc and /dev/null differ diff --git a/src_1.0/src_1.0_MacOS_test/controller/wamdamAPI/__init__.pyc b/src_1.0/src_1.0_MacOS_test/controller/wamdamAPI/__init__.pyc deleted file mode 100644 index aaa4f4c..0000000 Binary files a/src_1.0/src_1.0_MacOS_test/controller/wamdamAPI/__init__.pyc and /dev/null differ diff --git a/src_1.0/src_1.0_MacOS_test/icons/__init__.pyc b/src_1.0/src_1.0_MacOS_test/icons/__init__.pyc deleted file mode 100644 index 3d646b3..0000000 Binary files a/src_1.0/src_1.0_MacOS_test/icons/__init__.pyc and /dev/null differ diff --git a/src_1.0/src_1.0_MacOS_test/icons/icons.pyc b/src_1.0/src_1.0_MacOS_test/icons/icons.pyc deleted file mode 100644 index c4e3af8..0000000 Binary files a/src_1.0/src_1.0_MacOS_test/icons/icons.pyc and /dev/null differ diff --git a/src_1.0/src_1.0_MacOS_test/model/SqlAlchemy.pyc b/src_1.0/src_1.0_MacOS_test/model/SqlAlchemy.pyc deleted file mode 100644 index bb9b39f..0000000 Binary files a/src_1.0/src_1.0_MacOS_test/model/SqlAlchemy.pyc and /dev/null differ diff --git a/src_1.0/src_1.0_MacOS_test/model/__init__.pyc b/src_1.0/src_1.0_MacOS_test/model/__init__.pyc deleted file mode 100644 index 684d20b..0000000 Binary files a/src_1.0/src_1.0_MacOS_test/model/__init__.pyc and /dev/null differ diff --git a/src_1.0/src_1.0_MacOS_test/viewer/Messages_forms/Validations.pyc b/src_1.0/src_1.0_MacOS_test/viewer/Messages_forms/Validations.pyc deleted file mode 100644 index b211d5d..0000000 Binary files a/src_1.0/src_1.0_MacOS_test/viewer/Messages_forms/Validations.pyc and /dev/null differ diff --git a/src_1.0/src_1.0_MacOS_test/viewer/Messages_forms/__init__.pyc b/src_1.0/src_1.0_MacOS_test/viewer/Messages_forms/__init__.pyc deleted file mode 100644 index c3c1540..0000000 Binary files a/src_1.0/src_1.0_MacOS_test/viewer/Messages_forms/__init__.pyc and /dev/null differ diff --git a/src_1.0/src_1.0_MacOS_test/viewer/Messages_forms/msg_connSQLiteSuccs.pyc b/src_1.0/src_1.0_MacOS_test/viewer/Messages_forms/msg_connSQLiteSuccs.pyc deleted file mode 100644 index a06acf6..0000000 Binary files a/src_1.0/src_1.0_MacOS_test/viewer/Messages_forms/msg_connSQLiteSuccs.pyc and /dev/null differ diff --git a/src_1.0/src_1.0_MacOS_test/viewer/Messages_forms/msg_loading.pyc b/src_1.0/src_1.0_MacOS_test/viewer/Messages_forms/msg_loading.pyc deleted file mode 100644 index ff4138c..0000000 Binary files a/src_1.0/src_1.0_MacOS_test/viewer/Messages_forms/msg_loading.pyc and /dev/null differ diff --git a/src_1.0/src_1.0_MacOS_test/viewer/Messages_forms/msg_loadingToExit.pyc b/src_1.0/src_1.0_MacOS_test/viewer/Messages_forms/msg_loadingToExit.pyc deleted file mode 100644 index cc6d2c8..0000000 Binary files a/src_1.0/src_1.0_MacOS_test/viewer/Messages_forms/msg_loadingToExit.pyc and /dev/null differ diff --git a/src_1.0/src_1.0_MacOS_test/viewer/Messages_forms/msg_selectWorkbokFirst.pyc b/src_1.0/src_1.0_MacOS_test/viewer/Messages_forms/msg_selectWorkbokFirst.pyc deleted file mode 100644 index 8091d16..0000000 Binary files a/src_1.0/src_1.0_MacOS_test/viewer/Messages_forms/msg_selectWorkbokFirst.pyc and /dev/null differ diff --git a/src_1.0/src_1.0_MacOS_test/viewer/Messages_forms/msg_somethigWrong.pyc b/src_1.0/src_1.0_MacOS_test/viewer/Messages_forms/msg_somethigWrong.pyc deleted file mode 100644 index 0f54f55..0000000 Binary files a/src_1.0/src_1.0_MacOS_test/viewer/Messages_forms/msg_somethigWrong.pyc and /dev/null differ diff --git a/src_1.0/src_1.0_MacOS_test/viewer/Messages_forms/msg_successLoadDatabase.pyc b/src_1.0/src_1.0_MacOS_test/viewer/Messages_forms/msg_successLoadDatabase.pyc deleted file mode 100644 index 0f6586a..0000000 Binary files a/src_1.0/src_1.0_MacOS_test/viewer/Messages_forms/msg_successLoadDatabase.pyc and /dev/null differ diff --git a/src_1.0/src_1.0_MacOS_test/viewer/Messages_forms/msg_sureToExit.pyc b/src_1.0/src_1.0_MacOS_test/viewer/Messages_forms/msg_sureToExit.pyc deleted file mode 100644 index 971d201..0000000 Binary files a/src_1.0/src_1.0_MacOS_test/viewer/Messages_forms/msg_sureToExit.pyc and /dev/null differ diff --git a/src_1.0/src_1.0_MacOS_test/viewer/WaMDaMWizard.pyc b/src_1.0/src_1.0_MacOS_test/viewer/WaMDaMWizard.pyc deleted file mode 100644 index 88902d2..0000000 Binary files a/src_1.0/src_1.0_MacOS_test/viewer/WaMDaMWizard.pyc and /dev/null differ diff --git a/src_1.0/src_1.0_MacOS_test/viewer/__init__.pyc b/src_1.0/src_1.0_MacOS_test/viewer/__init__.pyc deleted file mode 100644 index b97b271..0000000 Binary files a/src_1.0/src_1.0_MacOS_test/viewer/__init__.pyc and /dev/null differ diff --git a/src_1.0/src_1.0_MacOS_test/viewer/dlg_ConnectExistingDatabaseMySQL.pyc b/src_1.0/src_1.0_MacOS_test/viewer/dlg_ConnectExistingDatabaseMySQL.pyc deleted file mode 100644 index 21e6623..0000000 Binary files a/src_1.0/src_1.0_MacOS_test/viewer/dlg_ConnectExistingDatabaseMySQL.pyc and /dev/null differ diff --git a/src_1.0/src_1.0_MacOS_test/viewer/dlg_ConnectExistingDatabaseSQLite.pyc b/src_1.0/src_1.0_MacOS_test/viewer/dlg_ConnectExistingDatabaseSQLite.pyc deleted file mode 100644 index e291f0a..0000000 Binary files a/src_1.0/src_1.0_MacOS_test/viewer/dlg_ConnectExistingDatabaseSQLite.pyc and /dev/null differ diff --git a/src_1.0/src_1.0_MacOS_test/viewer/dlg_ConnectNewDatabaseSQLite.pyc b/src_1.0/src_1.0_MacOS_test/viewer/dlg_ConnectNewDatabaseSQLite.pyc deleted file mode 100644 index 8680625..0000000 Binary files a/src_1.0/src_1.0_MacOS_test/viewer/dlg_ConnectNewDatabaseSQLite.pyc and /dev/null differ diff --git a/src_1.0/src_1.0_MacOS_test/viewer/dlg_ImportRwise.pyc b/src_1.0/src_1.0_MacOS_test/viewer/dlg_ImportRwise.pyc deleted file mode 100644 index 38978b8..0000000 Binary files a/src_1.0/src_1.0_MacOS_test/viewer/dlg_ImportRwise.pyc and /dev/null differ diff --git a/src_1.0/src_1.0_MacOS_test/viewer/dlg_ImportSpreadsheetAdvanced.pyc b/src_1.0/src_1.0_MacOS_test/viewer/dlg_ImportSpreadsheetAdvanced.pyc deleted file mode 100644 index 91ab619..0000000 Binary files a/src_1.0/src_1.0_MacOS_test/viewer/dlg_ImportSpreadsheetAdvanced.pyc and /dev/null differ diff --git a/src_1.0/src_1.0_MacOS_test/viewer/dlg_ImportSpreadsheetBasic.pyc b/src_1.0/src_1.0_MacOS_test/viewer/dlg_ImportSpreadsheetBasic.pyc deleted file mode 100644 index 2378a9a..0000000 Binary files a/src_1.0/src_1.0_MacOS_test/viewer/dlg_ImportSpreadsheetBasic.pyc and /dev/null differ diff --git a/src_1.0/src_1.0_MacOS_test/viewer/dlg_ShapefileToWaMDaM.pyc b/src_1.0/src_1.0_MacOS_test/viewer/dlg_ShapefileToWaMDaM.pyc deleted file mode 100644 index a9a2f5c..0000000 Binary files a/src_1.0/src_1.0_MacOS_test/viewer/dlg_ShapefileToWaMDaM.pyc and /dev/null differ diff --git a/src_1.0/src_1.0_MacOS_test/viewer/dlg_exit_DB.pyc b/src_1.0/src_1.0_MacOS_test/viewer/dlg_exit_DB.pyc deleted file mode 100644 index e87d957..0000000 Binary files a/src_1.0/src_1.0_MacOS_test/viewer/dlg_exit_DB.pyc and /dev/null differ diff --git a/src_1.0/src_1.0_MacOS_test/viewer/frm_Home.pyc b/src_1.0/src_1.0_MacOS_test/viewer/frm_Home.pyc deleted file mode 100644 index 6ad5e57..0000000 Binary files a/src_1.0/src_1.0_MacOS_test/viewer/frm_Home.pyc and /dev/null differ diff --git a/src_1.0/src_1.0_MacOS_test/wamdam.spec b/src_1.0/src_1.0_MacOS_test/wamdam.spec deleted file mode 100644 index b305f45..0000000 --- a/src_1.0/src_1.0_MacOS_test/wamdam.spec +++ /dev/null @@ -1,33 +0,0 @@ -# -*- mode: python -*- - -block_cipher = None - - -a = Analysis(['wamdam.py'], - pathex=['/Users/cupcakes/Downloads/WaMDaM_Wizard-master/src_1.0'], - binaries=[], - datas=[], - hiddenimports=[], - hookspath=[], - runtime_hooks=[], - excludes=[], - win_no_prefer_redirects=False, - win_private_assemblies=False, - cipher=block_cipher) -pyz = PYZ(a.pure, a.zipped_data, - cipher=block_cipher) -exe = EXE(pyz, - a.scripts, - a.binaries, - a.zipfiles, - a.datas, - name='wamdam', - debug=False, - strip=False, - upx=False, - runtime_tmpdir=None, - console=False , icon='WaMDaM_Wizard.ico') -app = BUNDLE(exe, - name='wamdam.app', - icon='WaMDaM_Wizard.ico', - bundle_identifier=None) diff --git a/src_MacOS/.DS_Store b/src_MacOS/.DS_Store new file mode 100644 index 0000000..20a074b Binary files /dev/null and b/src_MacOS/.DS_Store differ diff --git a/src_1.0/src_1.0_MacOS_test/CreateInstaller.md b/src_MacOS/CreateInstaller.md similarity index 100% rename from src_1.0/src_1.0_MacOS_test/CreateInstaller.md rename to src_MacOS/CreateInstaller.md diff --git a/src_1.0/src_1.0_MacOS_test/ReadME.md b/src_MacOS/ReadME.md similarity index 100% rename from src_1.0/src_1.0_MacOS_test/ReadME.md rename to src_MacOS/ReadME.md diff --git a/src_1.0/src_1.0_MacOS_test/SqliteDDL_hooks_path.PNG b/src_MacOS/SqliteDDL_hooks_path.PNG similarity index 100% rename from src_1.0/src_1.0_MacOS_test/SqliteDDL_hooks_path.PNG rename to src_MacOS/SqliteDDL_hooks_path.PNG diff --git a/src_1.0/src_1.0_MacOS_test/Validations_README b/src_MacOS/Validations_README similarity index 100% rename from src_1.0/src_1.0_MacOS_test/Validations_README rename to src_MacOS/Validations_README diff --git a/src_1.0/src_1.0_MacOS_test/WaMDaM_Wizard.ico b/src_MacOS/WaMDaM_Wizard.ico similarity index 100% rename from src_1.0/src_1.0_MacOS_test/WaMDaM_Wizard.ico rename to src_MacOS/WaMDaM_Wizard.ico diff --git a/src_1.0/src_1.0_MacOS_test/controller/wamdamAPI/__init__.py b/src_MacOS/__init__.py similarity index 100% rename from src_1.0/src_1.0_MacOS_test/controller/wamdamAPI/__init__.py rename to src_MacOS/__init__.py diff --git a/src_MacOS/a.sqlite b/src_MacOS/a.sqlite new file mode 100644 index 0000000..fa148b1 Binary files /dev/null and b/src_MacOS/a.sqlite differ diff --git a/src_MacOS/abc.sqlite b/src_MacOS/abc.sqlite new file mode 100644 index 0000000..fa148b1 Binary files /dev/null and b/src_MacOS/abc.sqlite differ diff --git a/src_1.0/controller/CUAHS_importer.py b/src_MacOS/controller/CUAHS_importer.py similarity index 100% rename from src_1.0/controller/CUAHS_importer.py rename to src_MacOS/controller/CUAHS_importer.py diff --git a/src_1.0/controller/ConnectDB_ParseExcel.py b/src_MacOS/controller/ConnectDB_ParseExcel.py similarity index 100% rename from src_1.0/controller/ConnectDB_ParseExcel.py rename to src_MacOS/controller/ConnectDB_ParseExcel.py diff --git a/src_1.0/src_1.0_MacOS_test/controller/Hydra_importer.py b/src_MacOS/controller/Hydra_importer.py similarity index 100% rename from src_1.0/src_1.0_MacOS_test/controller/Hydra_importer.py rename to src_MacOS/controller/Hydra_importer.py diff --git a/src_1.0/src_1.0_MacOS_test/controller/Logic_loadingDataStructure b/src_MacOS/controller/Logic_loadingDataStructure similarity index 100% rename from src_1.0/src_1.0_MacOS_test/controller/Logic_loadingDataStructure rename to src_MacOS/controller/Logic_loadingDataStructure diff --git a/src_1.0/src_1.0_MacOS_test/controller/Logic_loadingMetadata b/src_MacOS/controller/Logic_loadingMetadata similarity index 100% rename from src_1.0/src_1.0_MacOS_test/controller/Logic_loadingMetadata rename to src_MacOS/controller/Logic_loadingMetadata diff --git a/src_1.0/src_1.0_MacOS_test/controller/Logic_loadingNetworks.md b/src_MacOS/controller/Logic_loadingNetworks.md similarity index 100% rename from src_1.0/src_1.0_MacOS_test/controller/Logic_loadingNetworks.md rename to src_MacOS/controller/Logic_loadingNetworks.md diff --git a/src_1.0/src_1.0_MacOS_test/controller/README b/src_MacOS/controller/README similarity index 100% rename from src_1.0/src_1.0_MacOS_test/controller/README rename to src_MacOS/controller/README diff --git a/src_1.0/controller/RWISE_importer.py b/src_MacOS/controller/RWISE_importer.py similarity index 100% rename from src_1.0/controller/RWISE_importer.py rename to src_MacOS/controller/RWISE_importer.py diff --git a/src_1.0/controller/ReadWorkbook_SheetsNames.py b/src_MacOS/controller/ReadWorkbook_SheetsNames.py similarity index 100% rename from src_1.0/controller/ReadWorkbook_SheetsNames.py rename to src_MacOS/controller/ReadWorkbook_SheetsNames.py diff --git a/src_1.0/src_1.0_MacOS_test/controller/WaDE_importer.py b/src_MacOS/controller/WaDE_importer.py similarity index 100% rename from src_1.0/src_1.0_MacOS_test/controller/WaDE_importer.py rename to src_MacOS/controller/WaDE_importer.py diff --git a/src_1.0/src_1.0_MacOS_test/viewer/Messages_forms/__init__.py b/src_MacOS/controller/__init__.py similarity index 100% rename from src_1.0/src_1.0_MacOS_test/viewer/Messages_forms/__init__.py rename to src_MacOS/controller/__init__.py diff --git a/src_1.0/src_1.0_MacOS_test/controller/seasonalData_shaper.py b/src_MacOS/controller/seasonalData_shaper.py similarity index 100% rename from src_1.0/src_1.0_MacOS_test/controller/seasonalData_shaper.py rename to src_MacOS/controller/seasonalData_shaper.py diff --git a/src_1.0/controller/shapefileExporter.py b/src_MacOS/controller/shapefileExporter.py similarity index 100% rename from src_1.0/controller/shapefileExporter.py rename to src_MacOS/controller/shapefileExporter.py diff --git a/src_1.0/src_1.0_MacOS_test/controller/stp0_loadCVs.py b/src_MacOS/controller/stp0_loadCVs.py similarity index 100% rename from src_1.0/src_1.0_MacOS_test/controller/stp0_loadCVs.py rename to src_MacOS/controller/stp0_loadCVs.py diff --git a/src_1.0/src_1.0_MacOS_test/controller/stp1_loadMetadata.py b/src_MacOS/controller/stp1_loadMetadata.py similarity index 100% rename from src_1.0/src_1.0_MacOS_test/controller/stp1_loadMetadata.py rename to src_MacOS/controller/stp1_loadMetadata.py diff --git a/src_1.0/controller/stp2_loadDataStructure.py b/src_MacOS/controller/stp2_loadDataStructure.py similarity index 100% rename from src_1.0/controller/stp2_loadDataStructure.py rename to src_MacOS/controller/stp2_loadDataStructure.py diff --git a/src_1.0/controller/stp3_loadNetworks.py b/src_MacOS/controller/stp3_loadNetworks.py similarity index 100% rename from src_1.0/controller/stp3_loadNetworks.py rename to src_MacOS/controller/stp3_loadNetworks.py diff --git a/src_1.0/src_1.0_MacOS_test/controller/stp4_loadDataValue/Logic_loadingDataValues.md b/src_MacOS/controller/stp4_loadDataValue/Logic_loadingDataValues.md similarity index 100% rename from src_1.0/src_1.0_MacOS_test/controller/stp4_loadDataValue/Logic_loadingDataValues.md rename to src_MacOS/controller/stp4_loadDataValue/Logic_loadingDataValues.md diff --git a/src_1.0/controller/stp4_loadDataValue/MultiAttributeSeries.py b/src_MacOS/controller/stp4_loadDataValue/MultiAttributeSeries.py similarity index 100% rename from src_1.0/controller/stp4_loadDataValue/MultiAttributeSeries.py rename to src_MacOS/controller/stp4_loadDataValue/MultiAttributeSeries.py diff --git a/src_1.0/controller/stp4_loadDataValue/__init__.py b/src_MacOS/controller/stp4_loadDataValue/__init__.py similarity index 100% rename from src_1.0/controller/stp4_loadDataValue/__init__.py rename to src_MacOS/controller/stp4_loadDataValue/__init__.py diff --git a/src_1.0/src_1.0_MacOS_test/controller/stp4_loadDataValue/helper.py b/src_MacOS/controller/stp4_loadDataValue/helper.py similarity index 100% rename from src_1.0/src_1.0_MacOS_test/controller/stp4_loadDataValue/helper.py rename to src_MacOS/controller/stp4_loadDataValue/helper.py diff --git a/src_1.0/controller/stp4_loadDataValue/loadDescriptorValues.py b/src_MacOS/controller/stp4_loadDataValue/loadDescriptorValues.py similarity index 100% rename from src_1.0/controller/stp4_loadDataValue/loadDescriptorValues.py rename to src_MacOS/controller/stp4_loadDataValue/loadDescriptorValues.py diff --git a/src_1.0/src_1.0_MacOS_test/controller/stp4_loadDataValue/loadDualValues.py b/src_MacOS/controller/stp4_loadDataValue/loadDualValues.py similarity index 100% rename from src_1.0/src_1.0_MacOS_test/controller/stp4_loadDataValue/loadDualValues.py rename to src_MacOS/controller/stp4_loadDataValue/loadDualValues.py diff --git a/src_1.0/controller/stp4_loadDataValue/loadElectronicFiles.py b/src_MacOS/controller/stp4_loadDataValue/loadElectronicFiles.py similarity index 100% rename from src_1.0/controller/stp4_loadDataValue/loadElectronicFiles.py rename to src_MacOS/controller/stp4_loadDataValue/loadElectronicFiles.py diff --git a/src_1.0/controller/stp4_loadDataValue/loadNumericValues.py b/src_MacOS/controller/stp4_loadDataValue/loadNumericValues.py similarity index 100% rename from src_1.0/controller/stp4_loadDataValue/loadNumericValues.py rename to src_MacOS/controller/stp4_loadDataValue/loadNumericValues.py diff --git a/src_1.0/controller/stp4_loadDataValue/loadSeasonalNumericValues.py b/src_MacOS/controller/stp4_loadDataValue/loadSeasonalNumericValues.py similarity index 100% rename from src_1.0/controller/stp4_loadDataValue/loadSeasonalNumericValues.py rename to src_MacOS/controller/stp4_loadDataValue/loadSeasonalNumericValues.py diff --git a/src_1.0/controller/stp4_loadDataValue/loadTimeSeries.py b/src_MacOS/controller/stp4_loadDataValue/loadTimeSeries.py similarity index 100% rename from src_1.0/controller/stp4_loadDataValue/loadTimeSeries.py rename to src_MacOS/controller/stp4_loadDataValue/loadTimeSeries.py diff --git a/src_1.0/src_1.0_MacOS_test/controller/timeSeriesData_shaper.py b/src_MacOS/controller/timeSeriesData_shaper.py similarity index 100% rename from src_1.0/src_1.0_MacOS_test/controller/timeSeriesData_shaper.py rename to src_MacOS/controller/timeSeriesData_shaper.py diff --git a/src_1.0/src_1.0_MacOS_test/controller/wamdamAPI/GetComapreScenarios.py b/src_MacOS/controller/wamdamAPI/GetComapreScenarios.py similarity index 100% rename from src_1.0/src_1.0_MacOS_test/controller/wamdamAPI/GetComapreScenarios.py rename to src_MacOS/controller/wamdamAPI/GetComapreScenarios.py diff --git a/src_1.0/src_1.0_MacOS_test/controller/wamdamAPI/GetDataStructure.py b/src_MacOS/controller/wamdamAPI/GetDataStructure.py similarity index 100% rename from src_1.0/src_1.0_MacOS_test/controller/wamdamAPI/GetDataStructure.py rename to src_MacOS/controller/wamdamAPI/GetDataStructure.py diff --git a/src_1.0/controller/wamdamAPI/GetDataValues.py b/src_MacOS/controller/wamdamAPI/GetDataValues.py similarity index 100% rename from src_1.0/controller/wamdamAPI/GetDataValues.py rename to src_MacOS/controller/wamdamAPI/GetDataValues.py diff --git a/src_1.0/src_1.0_MacOS_test/controller/wamdamAPI/GetMetadata.py b/src_MacOS/controller/wamdamAPI/GetMetadata.py similarity index 100% rename from src_1.0/src_1.0_MacOS_test/controller/wamdamAPI/GetMetadata.py rename to src_MacOS/controller/wamdamAPI/GetMetadata.py diff --git a/src_1.0/controller/wamdamAPI/GetNodeLinks.py b/src_MacOS/controller/wamdamAPI/GetNodeLinks.py similarity index 100% rename from src_1.0/controller/wamdamAPI/GetNodeLinks.py rename to src_MacOS/controller/wamdamAPI/GetNodeLinks.py diff --git a/src_1.0/src_1.0_MacOS_test/icons/__init__.py b/src_MacOS/controller/wamdamAPI/__init__.py similarity index 100% rename from src_1.0/src_1.0_MacOS_test/icons/__init__.py rename to src_MacOS/controller/wamdamAPI/__init__.py diff --git a/src_1.0/src_1.0_MacOS_test/controller/wamdamAPI/helper.py b/src_MacOS/controller/wamdamAPI/helper.py similarity index 100% rename from src_1.0/src_1.0_MacOS_test/controller/wamdamAPI/helper.py rename to src_MacOS/controller/wamdamAPI/helper.py diff --git a/src_1.0/define.py b/src_MacOS/define.py similarity index 100% rename from src_1.0/define.py rename to src_MacOS/define.py diff --git a/src_MacOS/ff.sqlite b/src_MacOS/ff.sqlite new file mode 100644 index 0000000..fa148b1 Binary files /dev/null and b/src_MacOS/ff.sqlite differ diff --git a/src_1.0/src_1.0_MacOS_test/icons/ImportHydra.png b/src_MacOS/icons/ImportHydra.png similarity index 100% rename from src_1.0/src_1.0_MacOS_test/icons/ImportHydra.png rename to src_MacOS/icons/ImportHydra.png diff --git a/src_1.0/src_1.0_MacOS_test/icons/README b/src_MacOS/icons/README similarity index 100% rename from src_1.0/src_1.0_MacOS_test/icons/README rename to src_MacOS/icons/README diff --git a/src_1.0/src_1.0_MacOS_test/model/__init__.py b/src_MacOS/icons/__init__.py similarity index 100% rename from src_1.0/src_1.0_MacOS_test/model/__init__.py rename to src_MacOS/icons/__init__.py diff --git a/src_1.0/src_1.0_MacOS_test/icons/icons.py b/src_MacOS/icons/icons.py similarity index 100% rename from src_1.0/src_1.0_MacOS_test/icons/icons.py rename to src_MacOS/icons/icons.py diff --git a/src_1.0/src_1.0_MacOS_test/icons/icons1.py b/src_MacOS/icons/icons1.py similarity index 100% rename from src_1.0/src_1.0_MacOS_test/icons/icons1.py rename to src_MacOS/icons/icons1.py diff --git a/src_1.0/src_1.0_MacOS_test/icons/icons_png/AddDatabase.png b/src_MacOS/icons/icons_png/AddDatabase.png similarity index 100% rename from src_1.0/src_1.0_MacOS_test/icons/icons_png/AddDatabase.png rename to src_MacOS/icons/icons_png/AddDatabase.png diff --git a/src_1.0/src_1.0_MacOS_test/icons/icons_png/AddModel.png b/src_MacOS/icons/icons_png/AddModel.png similarity index 100% rename from src_1.0/src_1.0_MacOS_test/icons/icons_png/AddModel.png rename to src_MacOS/icons/icons_png/AddModel.png diff --git a/src_1.0/src_1.0_MacOS_test/icons/icons_png/AddSource.png b/src_MacOS/icons/icons_png/AddSource.png similarity index 100% rename from src_1.0/src_1.0_MacOS_test/icons/icons_png/AddSource.png rename to src_MacOS/icons/icons_png/AddSource.png diff --git a/src_1.0/src_1.0_MacOS_test/icons/icons_png/AllSteps.png b/src_MacOS/icons/icons_png/AllSteps.png similarity index 100% rename from src_1.0/src_1.0_MacOS_test/icons/icons_png/AllSteps.png rename to src_MacOS/icons/icons_png/AllSteps.png diff --git a/src_1.0/src_1.0_MacOS_test/icons/icons_png/CI_WATER.png b/src_MacOS/icons/icons_png/CI_WATER.png similarity index 100% rename from src_1.0/src_1.0_MacOS_test/icons/icons_png/CI_WATER.png rename to src_MacOS/icons/icons_png/CI_WATER.png diff --git a/src_1.0/src_1.0_MacOS_test/icons/icons_png/Close.png b/src_MacOS/icons/icons_png/Close.png similarity index 100% rename from src_1.0/src_1.0_MacOS_test/icons/icons_png/Close.png rename to src_MacOS/icons/icons_png/Close.png diff --git a/src_1.0/src_1.0_MacOS_test/icons/icons_png/ExisitngDB.png b/src_MacOS/icons/icons_png/ExisitngDB.png similarity index 100% rename from src_1.0/src_1.0_MacOS_test/icons/icons_png/ExisitngDB.png rename to src_MacOS/icons/icons_png/ExisitngDB.png diff --git a/src_1.0/src_1.0_MacOS_test/icons/icons_png/Exit.png b/src_MacOS/icons/icons_png/Exit.png similarity index 100% rename from src_1.0/src_1.0_MacOS_test/icons/icons_png/Exit.png rename to src_MacOS/icons/icons_png/Exit.png diff --git a/src_1.0/src_1.0_MacOS_test/icons/icons_png/Help.png b/src_MacOS/icons/icons_png/Help.png similarity index 100% rename from src_1.0/src_1.0_MacOS_test/icons/icons_png/Help.png rename to src_MacOS/icons/icons_png/Help.png diff --git a/src_1.0/src_1.0_MacOS_test/icons/icons_png/ImportExcel.png b/src_MacOS/icons/icons_png/ImportExcel.png similarity index 100% rename from src_1.0/src_1.0_MacOS_test/icons/icons_png/ImportExcel.png rename to src_MacOS/icons/icons_png/ImportExcel.png diff --git a/src_1.0/src_1.0_MacOS_test/icons/icons_png/ImportHydra.png b/src_MacOS/icons/icons_png/ImportHydra.png similarity index 100% rename from src_1.0/src_1.0_MacOS_test/icons/icons_png/ImportHydra.png rename to src_MacOS/icons/icons_png/ImportHydra.png diff --git a/src_1.0/src_1.0_MacOS_test/icons/icons_png/ImportRwise.png b/src_MacOS/icons/icons_png/ImportRwise.png similarity index 100% rename from src_1.0/src_1.0_MacOS_test/icons/icons_png/ImportRwise.png rename to src_MacOS/icons/icons_png/ImportRwise.png diff --git a/src_1.0/src_1.0_MacOS_test/icons/icons_png/Query.png b/src_MacOS/icons/icons_png/Query.png similarity index 100% rename from src_1.0/src_1.0_MacOS_test/icons/icons_png/Query.png rename to src_MacOS/icons/icons_png/Query.png diff --git a/src_1.0/src_1.0_MacOS_test/icons/icons_png/Seasonal.png b/src_MacOS/icons/icons_png/Seasonal.png similarity index 100% rename from src_1.0/src_1.0_MacOS_test/icons/icons_png/Seasonal.png rename to src_MacOS/icons/icons_png/Seasonal.png diff --git a/src_1.0/src_1.0_MacOS_test/icons/icons_png/ShapeFileToExcel.png b/src_MacOS/icons/icons_png/ShapeFileToExcel.png similarity index 100% rename from src_1.0/src_1.0_MacOS_test/icons/icons_png/ShapeFileToExcel.png rename to src_MacOS/icons/icons_png/ShapeFileToExcel.png diff --git a/src_1.0/src_1.0_MacOS_test/icons/icons_png/Step1.png b/src_MacOS/icons/icons_png/Step1.png similarity index 100% rename from src_1.0/src_1.0_MacOS_test/icons/icons_png/Step1.png rename to src_MacOS/icons/icons_png/Step1.png diff --git a/src_1.0/src_1.0_MacOS_test/icons/icons_png/Step2.png b/src_MacOS/icons/icons_png/Step2.png similarity index 100% rename from src_1.0/src_1.0_MacOS_test/icons/icons_png/Step2.png rename to src_MacOS/icons/icons_png/Step2.png diff --git a/src_1.0/src_1.0_MacOS_test/icons/icons_png/Step3.png b/src_MacOS/icons/icons_png/Step3.png similarity index 100% rename from src_1.0/src_1.0_MacOS_test/icons/icons_png/Step3.png rename to src_MacOS/icons/icons_png/Step3.png diff --git a/src_1.0/src_1.0_MacOS_test/icons/icons_png/Step4.png b/src_MacOS/icons/icons_png/Step4.png similarity index 100% rename from src_1.0/src_1.0_MacOS_test/icons/icons_png/Step4.png rename to src_MacOS/icons/icons_png/Step4.png diff --git a/src_1.0/src_1.0_MacOS_test/icons/icons_png/Step5.png b/src_MacOS/icons/icons_png/Step5.png similarity index 100% rename from src_1.0/src_1.0_MacOS_test/icons/icons_png/Step5.png rename to src_MacOS/icons/icons_png/Step5.png diff --git a/src_1.0/src_1.0_MacOS_test/icons/icons_png/TimeSeries.png b/src_MacOS/icons/icons_png/TimeSeries.png similarity index 100% rename from src_1.0/src_1.0_MacOS_test/icons/icons_png/TimeSeries.png rename to src_MacOS/icons/icons_png/TimeSeries.png diff --git a/src_1.0/src_1.0_MacOS_test/icons/icons_png/WASH.png b/src_MacOS/icons/icons_png/WASH.png similarity index 100% rename from src_1.0/src_1.0_MacOS_test/icons/icons_png/WASH.png rename to src_MacOS/icons/icons_png/WASH.png diff --git a/src_1.0/src_1.0_MacOS_test/icons/icons_png/WEAP.png b/src_MacOS/icons/icons_png/WEAP.png similarity index 100% rename from src_1.0/src_1.0_MacOS_test/icons/icons_png/WEAP.png rename to src_MacOS/icons/icons_png/WEAP.png diff --git a/src_1.0/src_1.0_MacOS_test/icons/icons_png/WaMDaM_Logo.PNG b/src_MacOS/icons/icons_png/WaMDaM_Logo.PNG similarity index 100% rename from src_1.0/src_1.0_MacOS_test/icons/icons_png/WaMDaM_Logo.PNG rename to src_MacOS/icons/icons_png/WaMDaM_Logo.PNG diff --git a/src_1.0/src_1.0_MacOS_test/icons/icons_png/about.png b/src_MacOS/icons/icons_png/about.png similarity index 100% rename from src_1.0/src_1.0_MacOS_test/icons/icons_png/about.png rename to src_MacOS/icons/icons_png/about.png diff --git a/src_1.0/src_1.0_MacOS_test/icons/icons_png/dissconnetDB.png b/src_MacOS/icons/icons_png/dissconnetDB.png similarity index 100% rename from src_1.0/src_1.0_MacOS_test/icons/icons_png/dissconnetDB.png rename to src_MacOS/icons/icons_png/dissconnetDB.png diff --git a/src_1.0/src_1.0_MacOS_test/icons/icons_png/error.png b/src_MacOS/icons/icons_png/error.png similarity index 100% rename from src_1.0/src_1.0_MacOS_test/icons/icons_png/error.png rename to src_MacOS/icons/icons_png/error.png diff --git a/src_1.0/src_1.0_MacOS_test/icons/icons_png/iUTAH.png b/src_MacOS/icons/icons_png/iUTAH.png similarity index 100% rename from src_1.0/src_1.0_MacOS_test/icons/icons_png/iUTAH.png rename to src_MacOS/icons/icons_png/iUTAH.png diff --git a/src_1.0/src_1.0_MacOS_test/icons/icons_png/licence.png b/src_MacOS/icons/icons_png/licence.png similarity index 100% rename from src_1.0/src_1.0_MacOS_test/icons/icons_png/licence.png rename to src_MacOS/icons/icons_png/licence.png diff --git a/src_1.0/src_1.0_MacOS_test/icons/icons_png/nsf.png b/src_MacOS/icons/icons_png/nsf.png similarity index 100% rename from src_1.0/src_1.0_MacOS_test/icons/icons_png/nsf.png rename to src_MacOS/icons/icons_png/nsf.png diff --git a/src_1.0/src_1.0_MacOS_test/icons/icons_png/ok.png b/src_MacOS/icons/icons_png/ok.png similarity index 100% rename from src_1.0/src_1.0_MacOS_test/icons/icons_png/ok.png rename to src_MacOS/icons/icons_png/ok.png diff --git a/src_1.0/src_1.0_MacOS_test/icons/icons_png/success.png b/src_MacOS/icons/icons_png/success.png similarity index 100% rename from src_1.0/src_1.0_MacOS_test/icons/icons_png/success.png rename to src_MacOS/icons/icons_png/success.png diff --git a/src_1.0/src_1.0_MacOS_test/icons/icons_png/usu.png b/src_MacOS/icons/icons_png/usu.png similarity index 100% rename from src_1.0/src_1.0_MacOS_test/icons/icons_png/usu.png rename to src_MacOS/icons/icons_png/usu.png diff --git a/src_1.0/src_1.0_MacOS_test/icons/icons_png/uwrl.png b/src_MacOS/icons/icons_png/uwrl.png similarity index 100% rename from src_1.0/src_1.0_MacOS_test/icons/icons_png/uwrl.png rename to src_MacOS/icons/icons_png/uwrl.png diff --git a/src_1.0/src_1.0_MacOS_test/icons/icons_png/warnning.png b/src_MacOS/icons/icons_png/warnning.png similarity index 100% rename from src_1.0/src_1.0_MacOS_test/icons/icons_png/warnning.png rename to src_MacOS/icons/icons_png/warnning.png diff --git a/src_1.0/src_1.0_MacOS_test/icons/img2py.py b/src_MacOS/icons/img2py.py similarity index 100% rename from src_1.0/src_1.0_MacOS_test/icons/img2py.py rename to src_MacOS/icons/img2py.py diff --git a/src_1.0/src_1.0_MacOS_test/viewer/Messages_forms/README b/src_MacOS/model/README similarity index 100% rename from src_1.0/src_1.0_MacOS_test/viewer/Messages_forms/README rename to src_MacOS/model/README diff --git a/src_1.0/src_1.0_MacOS_test/model/SqlAlchemy.py b/src_MacOS/model/SqlAlchemy.py similarity index 100% rename from src_1.0/src_1.0_MacOS_test/model/SqlAlchemy.py rename to src_MacOS/model/SqlAlchemy.py diff --git a/src_1.0/src_1.0_MacOS_test/viewer/__init__.py b/src_MacOS/model/__init__.py similarity index 100% rename from src_1.0/src_1.0_MacOS_test/viewer/__init__.py rename to src_MacOS/model/__init__.py diff --git a/src_1.0/src_1.0_MacOS_test/requirements.md b/src_MacOS/requirements.md similarity index 100% rename from src_1.0/src_1.0_MacOS_test/requirements.md rename to src_MacOS/requirements.md diff --git a/src_1.0/setup_cx.py b/src_MacOS/setup_cx.py similarity index 100% rename from src_1.0/setup_cx.py rename to src_MacOS/setup_cx.py diff --git a/src_MacOS/ss.sqlite b/src_MacOS/ss.sqlite new file mode 100644 index 0000000..fa148b1 Binary files /dev/null and b/src_MacOS/ss.sqlite differ diff --git a/src_MacOS/test.sqlite b/src_MacOS/test.sqlite new file mode 100644 index 0000000..fa148b1 Binary files /dev/null and b/src_MacOS/test.sqlite differ diff --git a/src_1.0/src_1.0_MacOS_test/viewer/.DS_Store b/src_MacOS/viewer/.DS_Store similarity index 100% rename from src_1.0/src_1.0_MacOS_test/viewer/.DS_Store rename to src_MacOS/viewer/.DS_Store diff --git a/src_MacOS/viewer/Messages_forms/Messages_Jan4.fbp b/src_MacOS/viewer/Messages_forms/Messages_Jan4.fbp new file mode 100644 index 0000000..fe96db4 --- /dev/null +++ b/src_MacOS/viewer/Messages_forms/Messages_Jan4.fbp @@ -0,0 +1,3762 @@ + + + + + + Python + 1 + source_name + 0 + 0 + res + UTF-8 + connect + Validations + 1000 + none + 0 + + + C:\AdelAbdallah_UOU_PC\01PhD\CI-Water\Data_Loader_WaM-DaM\DataLoader\Recent_desgins\Validations\Messages_forms + + 1 + 1 + 1 + 1 + UI + 0 + 0 + + 0 + wxAUI_MGR_DEFAULT + + wxBOTH + + 1 + 1 + impl_virtual + + + + 0 + 1000 + + + msg_connSQLiteSuccs + + 458,212 + wxDEFAULT_DIALOG_STYLE + + Successful Connection to the WaMDaM database + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + bSizer1 + wxVERTICAL + none + + 5 + wxALL|wxALIGN_CENTER_HORIZONTAL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + You are successfully connected to the WaMDaM SQLite database + + 0 + + + 0 + + 1 + m_staticText1 + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND + 1 + + 1 + 0 + + gSizer1 + none + 1 + 0 + + 5 + wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_BOTTOM + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + 1001 + OK + + 0 + + + 0 + + 1 + btn_ok + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + btn_okOnButtonClick + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + wxAUI_MGR_DEFAULT + + wxBOTH + + 1 + 1 + impl_virtual + + + + 0 + 1002 + + + msg_connSQLiteInvalid + + 458,212 + wxDEFAULT_DIALOG_STYLE + + Error: Invalid WaMDaM SQLite Database File + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + bSizer1 + wxVERTICAL + none + + 5 + wxALL|wxALIGN_CENTER_HORIZONTAL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + The SQLite database file you selected is invalid. Make sure to select a WaMDaM database file. You can download a blank SQLite WaMDaM file from GitHub @ https://github.com/amabdallah/WaM-DaM + + 0 + + + 0 + + 1 + m_staticText1 + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND + 1 + + 1 + 0 + + gSizer1 + none + 1 + 0 + + 5 + wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_BOTTOM + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + 1003 + OK + + 0 + + + 0 + + 1 + btn_ok + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + btn_okOnButtonClick + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + wxAUI_MGR_DEFAULT + + wxBOTH + + 1 + 1 + impl_virtual + + + + 0 + 1004 + + + msg_selectDatabaseFirst + + 458,212 + wxDEFAULT_DIALOG_STYLE + + Error: Select a WaMDaM SQLite database first + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + bSizer1 + wxVERTICAL + none + + 5 + wxALL|wxALIGN_CENTER_HORIZONTAL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Select a WaMDaM SQLite database before you click Connect + + 0 + + + 0 + + 1 + m_staticText1 + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND + 1 + + 1 + 0 + + gSizer1 + none + 1 + 0 + + 5 + wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_BOTTOM + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + 1005 + OK + + 0 + + + 0 + + 1 + btn_ok + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + btn_okOnButtonClick + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + wxAUI_MGR_DEFAULT + + wxBOTH + + 1 + 1 + impl_virtual + + + + 0 + 1006 + + + msg_workbookInvalid + + 458,212 + wxDEFAULT_DIALOG_STYLE + + Error: Invalid WaMDaM workbook + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + bSizer1 + wxVERTICAL + none + + 5 + wxALL|wxALIGN_CENTER_HORIZONTAL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + The selected file does not match the WaMDaM workbook. The original template has either been changed or you selected a different file. Make sure that the sheet names and the column headers are not changed and are identical to the original templates. You can download a blank template from GitHub at https://github.com/amabdallah/WaM-DaM + + 0 + + + 0 + + 1 + m_staticText1 + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND + 1 + + 1 + 0 + + gSizer1 + none + 1 + 0 + + 5 + wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_BOTTOM + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + 1007 + OK + + 0 + + + 0 + + 1 + btn_ok + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + btn_okOnButtonClick + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + wxAUI_MGR_DEFAULT + + wxBOTH + + 1 + 1 + impl_virtual + + + + 0 + 1008 + + + msg_selectWorkbokFirst + + 458,212 + wxDEFAULT_DIALOG_STYLE + + Error: Select a WaMDaM workbook first + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + bSizer1 + wxVERTICAL + none + + 5 + wxALL|wxALIGN_CENTER_HORIZONTAL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + You need to select a WaM-DaM workbook first + + 0 + + + 0 + + 1 + m_staticText1 + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND + 1 + + 1 + 0 + + gSizer1 + none + 1 + 0 + + 5 + wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_BOTTOM + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + 1009 + OK + + 0 + + + 0 + + 1 + btn_ok + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + btn_okOnButtonClick + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + wxAUI_MGR_DEFAULT + + wxBOTH + + 1 + 1 + impl_virtual + + + + 0 + 1010 + + + msg_emptyRequiredField + + 458,212 + wxDEFAULT_DIALOG_STYLE + + Error: Empty required field + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + bSizer1 + wxVERTICAL + none + + 5 + wxALL|wxALIGN_CENTER_HORIZONTAL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + You have a empty entry in required field in the --xyz table-- + + 0 + + + 0 + + 1 + m_staticText1 + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND + 1 + + 1 + 0 + + gSizer1 + none + 1 + 0 + + 5 + wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_BOTTOM + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + 1011 + OK + + 0 + + + 0 + + 1 + btn_ok + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + btn_okOnButtonClick + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + wxAUI_MGR_DEFAULT + + wxBOTH + + 1 + 1 + impl_virtual + + + + 0 + 1012 + + + msg_duplicateEnties + + 458,212 + wxDEFAULT_DIALOG_STYLE + + Error: Duplicate entries for a unique field + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + bSizer1 + wxVERTICAL + none + + 5 + wxALL|wxALIGN_CENTER_HORIZONTAL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + You entered duplicate values in the field name x and table name y” entries for this field and table should be unique. Delete the duplicated value + + 0 + + + 0 + + 1 + m_staticText1 + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND + 1 + + 1 + 0 + + gSizer1 + none + 1 + 0 + + 5 + wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_BOTTOM + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + 1013 + OK + + 0 + + + 0 + + 1 + btn_ok + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + btn_okOnButtonClick + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + wxAUI_MGR_DEFAULT + + wxBOTH + + 1 + 1 + impl_virtual + + + + 0 + 1014 + + + msg_dependencyViolation + + 458,212 + wxDEFAULT_DIALOG_STYLE + + Error: dependency on other tables + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + bSizer1 + wxVERTICAL + none + + 5 + wxALL|wxALIGN_CENTER_HORIZONTAL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + You entered a value that is dependent on other table but does not exist in the other table + + 0 + + + 0 + + 1 + m_staticText1 + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND + 1 + + 1 + 0 + + gSizer1 + none + 1 + 0 + + 5 + wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_BOTTOM + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + 1015 + OK + + 0 + + + 0 + + 1 + btn_ok + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + btn_okOnButtonClick + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + wxAUI_MGR_DEFAULT + + wxBOTH + + 1 + 1 + impl_virtual + + + + 0 + 1016 + + + msg_registerCVs + + 458,212 + wxDEFAULT_DIALOG_STYLE + + Register your data with controlled vocabulary + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + bSizer1 + wxVERTICAL + none + + 5 + wxALL|wxALIGN_CENTER_HORIZONTAL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + It seems that you did not register your data terms with controlled vocabulary in the xyz tables (s), you may choose to proceed and load your data to the database. However, it is recommend that you register your terms against the available controlled vocabulary or you create additional controlled vocabulary of your choice + + 0 + + + 0 + + 1 + m_staticText1 + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND + 1 + + 2 + 0 + + gSizer1 + none + 1 + 0 + + 5 + wxALL|wxALIGN_BOTTOM|wxALIGN_RIGHT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + 1017 + Continue + + 0 + + + 0 + + 1 + btn_continue + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + btn_okOnButtonClick + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL|wxALIGN_BOTTOM + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + 1018 + Cancel + + 0 + + + 0 + + 1 + btn_cancel + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + btn_okOnButtonClick + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + wxAUI_MGR_DEFAULT + + wxBOTH + + 1 + 1 + impl_virtual + + + + 0 + 1019 + + + msg_somethigWrong + + 458,212 + wxDEFAULT_DIALOG_STYLE + + Sorry: something went wrong + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + bSizer1 + wxVERTICAL + none + + 5 + wxALL|wxALIGN_CENTER_HORIZONTAL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Something went wrong while loading data into SQLite, please check your input data + + 0 + + + 0 + + 1 + m_staticText1 + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND + 1 + + 1 + 0 + + gSizer1 + none + 1 + 0 + + 5 + wxALL|wxALIGN_BOTTOM|wxALIGN_CENTER_HORIZONTAL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + 1020 + OK + + 0 + + + 0 + + 1 + btn_ok + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + btn_okOnButtonClick + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + wxAUI_MGR_DEFAULT + + wxBOTH + + 1 + 1 + impl_virtual + + + + 0 + 1021 + + + msg_successLoadDatabase + + 458,212 + wxDEFAULT_DIALOG_STYLE + + Successfully loaded data into the database + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + bSizer1 + wxVERTICAL + none + + 5 + wxALL|wxALIGN_CENTER_HORIZONTAL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + You successfully loaded the selected data into the database. You can view the data by using: SQLite Manager: Add-ons for Firefox web browser + + 0 + + + 0 + + 1 + m_staticText1 + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND + 1 + + 1 + 0 + + gSizer1 + none + 1 + 0 + + 5 + wxALL|wxALIGN_BOTTOM|wxALIGN_CENTER_HORIZONTAL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + 1022 + OK + + 0 + + + 0 + + 1 + btn_ok + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + btn_okOnButtonClick + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + wxAUI_MGR_DEFAULT + + wxBOTH + + 1 + 1 + impl_virtual + + + + 0 + 1023 + + + msg_readingYourData + + 458,212 + wxDEFAULT_DIALOG_STYLE + + Reading your data + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + bSizer1 + wxVERTICAL + none + + 5 + wxALL|wxALIGN_CENTER_HORIZONTAL + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + WaM-DaM Wizard is reading your input data. Please wait until the read is finished. The speed of reading depends on both the size of the data and your computer. + + 0 + + + 0 + + 1 + m_staticText1 + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND + 1 + + 1 + 0 + + gSizer1 + none + 1 + 0 + + 5 + wxALL|wxALIGN_BOTTOM|wxALIGN_CENTER_HORIZONTAL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + 1024 + OK + + 0 + + + 0 + + 1 + btn_ok + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + btn_okOnButtonClick + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + wxAUI_MGR_DEFAULT + + wxBOTH + + 1 + 1 + impl_virtual + + + + 0 + 1025 + + + msg_loadingYourData + + 458,212 + wxDEFAULT_DIALOG_STYLE + + Loading your data + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + bSizer1 + wxVERTICAL + none + + 5 + wxALL|wxALIGN_CENTER_HORIZONTAL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + WaM-DaM Wizard is parsing and loading your input data into the WaMDaM database. Please wait until the loading is done. It might take a few minutes. The speed of loading depends on both the size of the data and your computer. + + 0 + + + 0 + + 1 + m_staticText1 + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND + 1 + + 1 + 0 + + gSizer1 + none + 1 + 0 + + 5 + wxALL|wxALIGN_BOTTOM|wxALIGN_CENTER_HORIZONTAL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + 1026 + OK + + 0 + + + 0 + + 1 + btn_ok + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + btn_okOnButtonClick + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + wxAUI_MGR_DEFAULT + + wxBOTH + + 1 + 1 + impl_virtual + + + + 0 + 1027 + + + msg_CloseWizard + + 458,212 + wxDEFAULT_DIALOG_STYLE + + Are you sure? + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + bSizer1 + wxVERTICAL + none + + 5 + wxALL|wxALIGN_CENTER_HORIZONTAL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Are you sure you want to exist the WaMDaM Wizard? + + 0 + + + 0 + + 1 + m_staticText1 + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND + 1 + + 2 + 0 + + gSizer1 + none + 1 + 0 + + 5 + wxALL|wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + 1028 + Yes + + 0 + + + 0 + + 1 + btn_yes + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + btn_okOnButtonClick + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL|wxALIGN_CENTER_VERTICAL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + 1029 + No + + 0 + + + 0 + + 1 + btn_no + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + btn_okOnButtonClick + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src_1.0/viewer/Messages_forms/README b/src_MacOS/viewer/Messages_forms/README similarity index 100% rename from src_1.0/viewer/Messages_forms/README rename to src_MacOS/viewer/Messages_forms/README diff --git a/src_1.0/src_1.0_MacOS_test/viewer/Messages_forms/Validations.py b/src_MacOS/viewer/Messages_forms/Validations.py similarity index 100% rename from src_1.0/src_1.0_MacOS_test/viewer/Messages_forms/Validations.py rename to src_MacOS/viewer/Messages_forms/Validations.py diff --git a/src_1.0/viewer/Messages_forms/__init__.py b/src_MacOS/viewer/Messages_forms/__init__.py similarity index 100% rename from src_1.0/viewer/Messages_forms/__init__.py rename to src_MacOS/viewer/Messages_forms/__init__.py diff --git a/src_1.0/viewer/Messages_forms/generalMsgDlg.py b/src_MacOS/viewer/Messages_forms/generalMsgDlg.py similarity index 100% rename from src_1.0/viewer/Messages_forms/generalMsgDlg.py rename to src_MacOS/viewer/Messages_forms/generalMsgDlg.py diff --git a/src_1.0/viewer/Messages_forms/msg_connSQLiteInvalid.py b/src_MacOS/viewer/Messages_forms/msg_connSQLiteInvalid.py similarity index 100% rename from src_1.0/viewer/Messages_forms/msg_connSQLiteInvalid.py rename to src_MacOS/viewer/Messages_forms/msg_connSQLiteInvalid.py diff --git a/src_1.0/viewer/Messages_forms/msg_connSQLiteSuccs.py b/src_MacOS/viewer/Messages_forms/msg_connSQLiteSuccs.py similarity index 100% rename from src_1.0/viewer/Messages_forms/msg_connSQLiteSuccs.py rename to src_MacOS/viewer/Messages_forms/msg_connSQLiteSuccs.py diff --git a/src_1.0/viewer/Messages_forms/msg_duplicateEnties.py b/src_MacOS/viewer/Messages_forms/msg_duplicateEnties.py similarity index 100% rename from src_1.0/viewer/Messages_forms/msg_duplicateEnties.py rename to src_MacOS/viewer/Messages_forms/msg_duplicateEnties.py diff --git a/src_1.0/viewer/Messages_forms/msg_emptyRequiredField.py b/src_MacOS/viewer/Messages_forms/msg_emptyRequiredField.py similarity index 100% rename from src_1.0/viewer/Messages_forms/msg_emptyRequiredField.py rename to src_MacOS/viewer/Messages_forms/msg_emptyRequiredField.py diff --git a/src_1.0/viewer/Messages_forms/msg_infos.py b/src_MacOS/viewer/Messages_forms/msg_infos.py similarity index 100% rename from src_1.0/viewer/Messages_forms/msg_infos.py rename to src_MacOS/viewer/Messages_forms/msg_infos.py diff --git a/src_1.0/viewer/Messages_forms/msg_loading.py b/src_MacOS/viewer/Messages_forms/msg_loading.py similarity index 100% rename from src_1.0/viewer/Messages_forms/msg_loading.py rename to src_MacOS/viewer/Messages_forms/msg_loading.py diff --git a/src_1.0/viewer/Messages_forms/msg_loadingToExit.py b/src_MacOS/viewer/Messages_forms/msg_loadingToExit.py similarity index 100% rename from src_1.0/viewer/Messages_forms/msg_loadingToExit.py rename to src_MacOS/viewer/Messages_forms/msg_loadingToExit.py diff --git a/src_1.0/viewer/Messages_forms/msg_registerCVs.py b/src_MacOS/viewer/Messages_forms/msg_registerCVs.py similarity index 100% rename from src_1.0/viewer/Messages_forms/msg_registerCVs.py rename to src_MacOS/viewer/Messages_forms/msg_registerCVs.py diff --git a/src_1.0/viewer/Messages_forms/msg_selectDatabaseFirst.py b/src_MacOS/viewer/Messages_forms/msg_selectDatabaseFirst.py similarity index 100% rename from src_1.0/viewer/Messages_forms/msg_selectDatabaseFirst.py rename to src_MacOS/viewer/Messages_forms/msg_selectDatabaseFirst.py diff --git a/src_1.0/viewer/Messages_forms/msg_selectWorkbokFirst.py b/src_MacOS/viewer/Messages_forms/msg_selectWorkbokFirst.py similarity index 100% rename from src_1.0/viewer/Messages_forms/msg_selectWorkbokFirst.py rename to src_MacOS/viewer/Messages_forms/msg_selectWorkbokFirst.py diff --git a/src_1.0/viewer/Messages_forms/msg_somethigWrong.py b/src_MacOS/viewer/Messages_forms/msg_somethigWrong.py similarity index 100% rename from src_1.0/viewer/Messages_forms/msg_somethigWrong.py rename to src_MacOS/viewer/Messages_forms/msg_somethigWrong.py diff --git a/src_1.0/viewer/Messages_forms/msg_successLoadDatabase.py b/src_MacOS/viewer/Messages_forms/msg_successLoadDatabase.py similarity index 100% rename from src_1.0/viewer/Messages_forms/msg_successLoadDatabase.py rename to src_MacOS/viewer/Messages_forms/msg_successLoadDatabase.py diff --git a/src_1.0/viewer/Messages_forms/msg_sureToExit.py b/src_MacOS/viewer/Messages_forms/msg_sureToExit.py similarity index 100% rename from src_1.0/viewer/Messages_forms/msg_sureToExit.py rename to src_MacOS/viewer/Messages_forms/msg_sureToExit.py diff --git a/src_1.0/viewer/Messages_forms/msg_workbookInvalid.py b/src_MacOS/viewer/Messages_forms/msg_workbookInvalid.py similarity index 100% rename from src_1.0/viewer/Messages_forms/msg_workbookInvalid.py rename to src_MacOS/viewer/Messages_forms/msg_workbookInvalid.py diff --git a/src_1.0/viewer/README b/src_MacOS/viewer/README similarity index 100% rename from src_1.0/viewer/README rename to src_MacOS/viewer/README diff --git a/src_1.0/src_1.0_MacOS_test/viewer/WaMDaMWizard.py b/src_MacOS/viewer/WaMDaMWizard.py similarity index 100% rename from src_1.0/src_1.0_MacOS_test/viewer/WaMDaMWizard.py rename to src_MacOS/viewer/WaMDaMWizard.py diff --git a/src_1.0/viewer/__init__.py b/src_MacOS/viewer/__init__.py similarity index 100% rename from src_1.0/viewer/__init__.py rename to src_MacOS/viewer/__init__.py diff --git a/src_1.0/viewer/dlg_About.py b/src_MacOS/viewer/dlg_About.py similarity index 100% rename from src_1.0/viewer/dlg_About.py rename to src_MacOS/viewer/dlg_About.py diff --git a/src_1.0/viewer/dlg_ConnectExistingDatabaseMySQL.py b/src_MacOS/viewer/dlg_ConnectExistingDatabaseMySQL.py similarity index 100% rename from src_1.0/viewer/dlg_ConnectExistingDatabaseMySQL.py rename to src_MacOS/viewer/dlg_ConnectExistingDatabaseMySQL.py diff --git a/src_1.0/src_1.0_MacOS_test/viewer/dlg_ConnectExistingDatabaseSQLite.py b/src_MacOS/viewer/dlg_ConnectExistingDatabaseSQLite.py similarity index 100% rename from src_1.0/src_1.0_MacOS_test/viewer/dlg_ConnectExistingDatabaseSQLite.py rename to src_MacOS/viewer/dlg_ConnectExistingDatabaseSQLite.py diff --git a/src_1.0/src_1.0_MacOS_test/viewer/dlg_ConnectNewDatabaseSQLite.py b/src_MacOS/viewer/dlg_ConnectNewDatabaseSQLite.py similarity index 100% rename from src_1.0/src_1.0_MacOS_test/viewer/dlg_ConnectNewDatabaseSQLite.py rename to src_MacOS/viewer/dlg_ConnectNewDatabaseSQLite.py diff --git a/src_1.0/src_1.0_MacOS_test/viewer/dlg_CrossTabSeasonalToWaMDaM.py b/src_MacOS/viewer/dlg_CrossTabSeasonalToWaMDaM.py similarity index 100% rename from src_1.0/src_1.0_MacOS_test/viewer/dlg_CrossTabSeasonalToWaMDaM.py rename to src_MacOS/viewer/dlg_CrossTabSeasonalToWaMDaM.py diff --git a/src_1.0/viewer/dlg_CrossTabTimeSeriesToWaMDaM.py b/src_MacOS/viewer/dlg_CrossTabTimeSeriesToWaMDaM.py similarity index 100% rename from src_1.0/viewer/dlg_CrossTabTimeSeriesToWaMDaM.py rename to src_MacOS/viewer/dlg_CrossTabTimeSeriesToWaMDaM.py diff --git a/src_1.0/viewer/dlg_ExportScenarioDataToHydra.py b/src_MacOS/viewer/dlg_ExportScenarioDataToHydra.py similarity index 100% rename from src_1.0/viewer/dlg_ExportScenarioDataToHydra.py rename to src_MacOS/viewer/dlg_ExportScenarioDataToHydra.py diff --git a/src_1.0/viewer/dlg_Help.py b/src_MacOS/viewer/dlg_Help.py similarity index 100% rename from src_1.0/viewer/dlg_Help.py rename to src_MacOS/viewer/dlg_Help.py diff --git a/src_1.0/viewer/dlg_ImportFromCUAHS.py b/src_MacOS/viewer/dlg_ImportFromCUAHS.py similarity index 100% rename from src_1.0/viewer/dlg_ImportFromCUAHS.py rename to src_MacOS/viewer/dlg_ImportFromCUAHS.py diff --git a/src_1.0/viewer/dlg_ImportFromWaDE.py b/src_MacOS/viewer/dlg_ImportFromWaDE.py similarity index 100% rename from src_1.0/viewer/dlg_ImportFromWaDE.py rename to src_MacOS/viewer/dlg_ImportFromWaDE.py diff --git a/src_1.0/viewer/dlg_ImportRwise.py b/src_MacOS/viewer/dlg_ImportRwise.py similarity index 100% rename from src_1.0/viewer/dlg_ImportRwise.py rename to src_MacOS/viewer/dlg_ImportRwise.py diff --git a/src_1.0/viewer/dlg_ImportSpreadsheetAdvanced.py b/src_MacOS/viewer/dlg_ImportSpreadsheetAdvanced.py similarity index 100% rename from src_1.0/viewer/dlg_ImportSpreadsheetAdvanced.py rename to src_MacOS/viewer/dlg_ImportSpreadsheetAdvanced.py diff --git a/src_1.0/src_1.0_MacOS_test/viewer/dlg_ImportSpreadsheetBasic.py b/src_MacOS/viewer/dlg_ImportSpreadsheetBasic.py similarity index 100% rename from src_1.0/src_1.0_MacOS_test/viewer/dlg_ImportSpreadsheetBasic.py rename to src_MacOS/viewer/dlg_ImportSpreadsheetBasic.py diff --git a/src_1.0/viewer/dlg_License.py b/src_MacOS/viewer/dlg_License.py similarity index 100% rename from src_1.0/viewer/dlg_License.py rename to src_MacOS/viewer/dlg_License.py diff --git a/src_1.0/viewer/dlg_SearchDataValues.py b/src_MacOS/viewer/dlg_SearchDataValues.py similarity index 100% rename from src_1.0/viewer/dlg_SearchDataValues.py rename to src_MacOS/viewer/dlg_SearchDataValues.py diff --git a/src_1.0/viewer/dlg_SearchNodesLinks.py b/src_MacOS/viewer/dlg_SearchNodesLinks.py similarity index 100% rename from src_1.0/viewer/dlg_SearchNodesLinks.py rename to src_MacOS/viewer/dlg_SearchNodesLinks.py diff --git a/src_1.0/src_1.0_MacOS_test/viewer/dlg_ShapefileToWaMDaM.py b/src_MacOS/viewer/dlg_ShapefileToWaMDaM.py similarity index 100% rename from src_1.0/src_1.0_MacOS_test/viewer/dlg_ShapefileToWaMDaM.py rename to src_MacOS/viewer/dlg_ShapefileToWaMDaM.py diff --git a/src_1.0/src_1.0_MacOS_test/viewer/dlg_compare_scenarios.py b/src_MacOS/viewer/dlg_compare_scenarios.py similarity index 100% rename from src_1.0/src_1.0_MacOS_test/viewer/dlg_compare_scenarios.py rename to src_MacOS/viewer/dlg_compare_scenarios.py diff --git a/src_1.0/viewer/dlg_exit_DB.py b/src_MacOS/viewer/dlg_exit_DB.py similarity index 100% rename from src_1.0/viewer/dlg_exit_DB.py rename to src_MacOS/viewer/dlg_exit_DB.py diff --git a/src_1.0/viewer/dlg_query_metadata.py b/src_MacOS/viewer/dlg_query_metadata.py similarity index 100% rename from src_1.0/viewer/dlg_query_metadata.py rename to src_MacOS/viewer/dlg_query_metadata.py diff --git a/src_1.0/viewer/dlg_query_model.py b/src_MacOS/viewer/dlg_query_model.py similarity index 100% rename from src_1.0/viewer/dlg_query_model.py rename to src_MacOS/viewer/dlg_query_model.py diff --git a/src_1.0/viewer/dlg_query_network.py b/src_MacOS/viewer/dlg_query_network.py similarity index 100% rename from src_1.0/viewer/dlg_query_network.py rename to src_MacOS/viewer/dlg_query_network.py diff --git a/src_1.0/src_1.0_MacOS_test/viewer/frm_Home.py b/src_MacOS/viewer/frm_Home.py similarity index 100% rename from src_1.0/src_1.0_MacOS_test/viewer/frm_Home.py rename to src_MacOS/viewer/frm_Home.py diff --git a/src_1.0/src_1.0_MacOS_test/wamdam.py b/src_MacOS/wamdam.py similarity index 100% rename from src_1.0/src_1.0_MacOS_test/wamdam.py rename to src_MacOS/wamdam.py