Author: bugman Date: Fri Sep 17 15:25:22 2010 New Revision: 11604 URL: http://svn.gna.org/viewcvs/relax?rev=11604&view=rev Log: The missing data dialog now supplies a list of missing information for the Rx and NOE auto-analyses. Modified: branches/bieri_gui/gui_bieri/analyses/auto_noe.py branches/bieri_gui/gui_bieri/analyses/auto_rx_base.py branches/bieri_gui/gui_bieri/message.py Modified: branches/bieri_gui/gui_bieri/analyses/auto_noe.py URL: http://svn.gna.org/viewcvs/relax/branches/bieri_gui/gui_bieri/analyses/auto_noe.py?rev=11604&r1=11603&r2=11604&view=diff ============================================================================== --- branches/bieri_gui/gui_bieri/analyses/auto_noe.py (original) +++ branches/bieri_gui/gui_bieri/analyses/auto_noe.py Fri Sep 17 15:25:22 2010 @@ -386,13 +386,14 @@ See the docstring for auto_analyses.relax_fit for details. All data is taken from the relax data store, so data upload from the GUI to there must have been previously performed. - @return: A container with all the data required for the auto-analysis, i.e. its keyword arguments seq_args, file_names, relax_times, int_method, mc_num. Also a flag stating if the data is complete. - @rtype: class instance, bool + @return: A container with all the data required for the auto-analysis, i.e. its keyword arguments seq_args, file_names, relax_times, int_method, mc_num. Also a flag stating if the data is complete and a list of missing data types. + @rtype: class instance, bool, list of str """ # The data container and flag. data = Container() complete = True + missing = [] # The sequence data (file name, dir, mol_name_col, res_num_col, res_name_col, spin_num_col, spin_name_col, sep). These are the arguments to the sequence.read() user function, for more information please see the documentation for that function. if hasattr(self.data, 'sequence_file'): @@ -402,10 +403,16 @@ # Reference peak list and background noe. data.ref_file = self.data.ref_file + if not data.ref_file: + complete = False + missing.append('Reference peak list') data.ref_rmsd = int(self.data.ref_rmsd) # Saturated peak list and background noe. data.sat_file = self.data.sat_file + if not data.sat_file: + complete = False + missing.append('Saturated peak list') data.sat_rmsd = int(self.data.sat_rmsd) # Results directory. @@ -447,9 +454,10 @@ # No sequence data. if not data.seq_args and not data.structure_file: complete = False - - # Return the container and flat. - return data, complete + missing.append('Sequence data files (text or PDB)') + + # Return the container, flag, and list of missing data. + return data, complete, missing def build_main_box(self): @@ -565,11 +573,11 @@ time.sleep(0.5) # Assemble all the data needed for the auto-analysis. - data, complete = self.assemble_data() + data, complete, missing = self.assemble_data() # Incomplete. if not complete: - missing_data() + missing_data(missing) return # Execute. Modified: branches/bieri_gui/gui_bieri/analyses/auto_rx_base.py URL: http://svn.gna.org/viewcvs/relax/branches/bieri_gui/gui_bieri/analyses/auto_rx_base.py?rev=11604&r1=11603&r2=11604&view=diff ============================================================================== --- branches/bieri_gui/gui_bieri/analyses/auto_rx_base.py (original) +++ branches/bieri_gui/gui_bieri/analyses/auto_rx_base.py Fri Sep 17 15:25:22 2010 @@ -45,7 +45,7 @@ from gui_bieri.controller import Redirect_text, Thread_container from gui_bieri.derived_wx_classes import StructureTextCtrl from gui_bieri.filedialog import multi_openfile, opendir -from gui_bieri.message import error_message +from gui_bieri.message import error_message, missing_data from gui_bieri.paths import ADD_ICON, CANCEL_ICON, IMAGE_PATH, REMOVE_ICON from gui_bieri.settings import load_sequence @@ -275,13 +275,14 @@ See the docstring for auto_analyses.relax_fit for details. All data is taken from the relax data store, so data upload from the GUI to there must have been previously performed. - @return: A container with all the data required for the auto-analysis, i.e. its keyword arguments seq_args, file_names, relax_times, int_method, mc_num. Also a flag stating if the data is complete. - @rtype: class instance, bool + @return: A container with all the data required for the auto-analysis, i.e. its keyword arguments seq_args, file_names, relax_times, int_method, mc_num. Also a flag stating if the data is complete and a list of missing data types. + @rtype: class instance, bool, list of str """ # The data container. data = Container() complete = True + missing = [] # The sequence data (file name, dir, mol_name_col, res_num_col, res_name_col, spin_num_col, spin_name_col, sep). These are the arguments to the sequence.read() user function, for more information please see the documentation for that function. if hasattr(self.data, 'sequence_file'): @@ -346,9 +347,10 @@ # No sequence data. if not data.seq_args and not data.structure_file: complete = False - - # Return the container and flat. - return data, complete + missing.append('Sequence data files (text or PDB)') + + # Return the container, flag, and list of missing data. + return data, complete, missing def build_main_box(self): @@ -452,11 +454,11 @@ time.sleep(0.5) # Assemble all the data needed for the Relax_fit class. - data, complete = self.assemble_data() + data, complete, missing = self.assemble_data() # Incomplete. if not complete: - missing_data() + missing_data(missing) return # Execute. Modified: branches/bieri_gui/gui_bieri/message.py URL: http://svn.gna.org/viewcvs/relax/branches/bieri_gui/gui_bieri/message.py?rev=11604&r1=11603&r2=11604&view=diff ============================================================================== --- branches/bieri_gui/gui_bieri/message.py (original) +++ branches/bieri_gui/gui_bieri/message.py Fri Sep 17 15:25:22 2010 @@ -54,11 +54,24 @@ return check -def missing_data(): - """Message box GUI element for when a setup is incomplete or there is missing data.""" +def missing_data(missing=[]): + """Message box GUI element for when a setup is incomplete or there is missing data. + + @keyword missing: The list of missing data types. + @type missing: list of str + """ + + # The message. + msg = "The set up is incomplete.\n\n" + if not len(missing): + msg = msg + "Please check for missing data.\n" + else: + msg = msg + "Please check for the following missing information:\n" + for data in missing: + msg = msg + " %s\n" % data # The GUI element. - wx.MessageBox('The set up is incomplete,\nplease check for missing data.', caption='Missing data', style=wx.OK|wx.ICON_ERROR) + wx.MessageBox(msg, caption='Missing data', style=wx.OK|wx.ICON_ERROR) def question(msg, default=False):