Exemplo n.º 1
0
 def run_num(self, val):
     if ti.is_integer(val):
         self.__changeLog.append({
             'Date': datetime.datetime.now(),
             'Location': self.__location,
             'Variable': 'run_num',
             'Success': True,
             'Previous': self.__run_num,
             'New': val,
             'ErrorMessage': None
         })
         self.__run_num = val
     else:
         errorMessage = "Error setting run_num. Must be an integer."
         self.__changeLog.append({
             'Date': datetime.datetime.now(),
             'Location': self.__location,
             'Variable': 'run_num',
             'Success': False,
             'Previous': self.__run_num,
             'New': val,
             'ErrorMessage': errorMessage
         })
         self.__errorLog.append({
             'Date': datetime.datetime.now(),
             'Type': 'Setter',
             'Location': self.__location,
             'Variable': 'run_num',
             'ErrorMessage': errorMessage
         })
Exemplo n.º 2
0
    def num_growpoints(self, val):
        if ti.is_integer(val):
            self.__changeLog.append({
                'Date': datetime.datetime.now(),
                'Location': self.__location,
                'Variable': 'num_growpoints',
                'Success': True,
                'Previous': self.__num_growpoints,
                'New': val,
                'ErrorMessage': None
            })

            self.__num_growpoints = val
        else:
            errorMessage = "num_growpoints must be an integer."
            self.__changeLog.append({
                'Date': datetime.datetime.now(),
                'Location': self.__location,
                'Variable': 'num_growpoints',
                'Success': False,
                'Previous': self.__num_growpoints,
                'New': val,
                'ErrorMessage': errorMessage
            })
            self.__errorLog.append({
                'Date': datetime.datetime.now(),
                'Type': 'Setter',
                'Location': self.__location,
                'Variable': 'num_growpoints',
                'ErrorMessage': errorMessage
            })
Exemplo n.º 3
0
    def icbsta(self, val):

        var = "icbsta"

        if not isinstance(val, oda.oneDimArray):
            if not (isinstance(val, list) or ti.is_integer(val)):
                errorMessage = logging.multidimensional_error("icbsta", False)
                self.__changeLog.append(
                    logging.changelog_entry(self.__location, "icbsta", False,
                                            repr(getattr(self, "icbsta")),
                                            repr(val), errorMessage))
                self.__errorLog.append(
                    logging.errorlog_entry("Setter", errorMessage))
            else:
                if not isinstance(val, list):
                    val = [val]
                myODA = oda.oneDimArray.listToODA(val,
                                                  errorLog=self.__errorLog,
                                                  changeLog=self.__changeLog,
                                                  location=self.__location,
                                                  var=var)
                self.__changeLog.append(
                    logging.changelog_entry(self.__location, "icbsta", False,
                                            repr(getattr(self, "icbsta")),
                                            repr(val), None))
                self.__icbsta = myODA
        else:
            self.__changeLog.append(
                logging.changelog_entry(self.__location, "icbsta", False,
                                        repr(getattr(self, "icbsta")),
                                        repr(val), None))
            self.__icbsta = val
Exemplo n.º 4
0
 def ghost_particles(self, val):
     if not ti.is_integer(val):
         errorMessage = ("failed setting ghost_particles")
         self.__changeLog.append({
             'Date': datetime.datetime.now(),
             'Location': self.__location,
             'Variable': 'ghost_particles',
             'Success': False,
             'Previous': repr(self.__ghost_particles),
             'New': repr(val),
             'ErrorMessage': errorMessage
         })
         self.__errorLog.append({
             'Date': datetime.datetime.now(),
             'Type': 'Setter',
             'Location': self.__location,
             'Variable': 'ghost_particles',
             'ErrorMessage': errorMessage
         })
     else:
         self.__changeLog.append({
             'Date': datetime.datetime.now(),
             'Location': self.__location,
             'Variable': 'ghost_particles',
             'Success': True,
             'Previous': repr(self.__ghost_particles),
             'New': repr(val),
             'ErrorMessage': None
         })
         self.__ghost_particles = val
Exemplo n.º 5
0
 def ndihedrals(self,val):
   if ti.is_integer(val) and val >= 0:
     self.__changeLog.append({'Date':datetime.datetime.now(),'Location':self.__location,
                              'Variable':'ndihedrals','Success':True,'Previous':self.__ndihedrals,'New':val,
                              'ErrorMessage':None})
     self.__ndihedrals = val
   else:
     errorMessage = "ndihedrals must be an integer greater than or equal to 0."
     self.__changeLog.append({'Date':datetime.datetime.now(),'Location':self.__location,
                              'Variable':'ndihedrals','Success':False,'Previous':self.__ndihedrals,'New':val,
                              'ErrorMessage':errorMessage})
     self.__errorLog.append({'Date':datetime.datetime.now(),'Type':'Setter','Location':self.__location,
                             'Variable':'ndihedrals','ErrorMessage':errorMessage})
Exemplo n.º 6
0
 def avbmc_version(self, val):
     if not ti.is_integer(val):
         errorMessage = "avbmc_version failed test_instance.is_integer check."
         self.__changeLog.append(
             logging.changelog_entry(self.__location, "avbmc_version",
                                     False,
                                     repr(getattr(self, "avbmc_version")),
                                     repr(val), errorMessage))
         self.__errorLog.append(
             logging.errorlog_entry("Setter", errorMessage))
     else:
         self.__changeLog.append(
             logging.changelog_entry(self.__location, "avbmc_version",
                                     False,
                                     repr(getattr(self, "avbmc_version")),
                                     repr(val), None))
         self.__avbmc_version = val
Exemplo n.º 7
0
 def allow_cutoff_failure(self,val):
     if not ti.is_integer(val):
         errorMessage = "allow_cutoff_failure failed test_instance.is_integer check."
         self.__changeLog.append(
             logging.changelog_entry(
                 self.__location, "allow_cutoff_failure", False, repr(getattr(self, "allow_cutoff_failure")), repr(val),
                  errorMessage
            )
         )
         self.__errorLog.append(
             logging.errorlog_entry("Setter", errorMessage)
         )
     else:
         self.__changeLog.append(
             logging.changelog_entry(
                 self.__location, "allow_cutoff_failure", False, repr(getattr(self, "allow_cutoff_failure")), repr(val),
                 None
             )
         )
         self.__allow_cutoff_failure = val