예제 #1
0
 def populate_default_parameters(self):
     """
     This method should populate all the required parameters with default
     values.  it is used for checking to see if new parameter values are
     appropriate
     
     It makes use of the classes including parameter information in the 
     class docstring such as this 
     :param error_threshold: Convergence threshold. Default: 0.001.
     """
     for clazz in inspect.getmro(self.__class__):
         if clazz != object:
             full_description = pu.find_args(clazz)
             for item in full_description:
                 self.parameters[item['name']] = item['default']
예제 #2
0
파일: plugin.py 프로젝트: mjn19172/Savu
 def populate_default_parameters(self):
     """
     This method should populate all the required parameters with default
     values.  it is used for checking to see if new parameter values are
     appropriate
     
     It makes use of the classes including parameter information in the 
     class docstring such as this 
     :param error_threshold: Convergence threshold. Default: 0.001.
     """
     for clazz in inspect.getmro(self.__class__):
         if clazz != object:
             full_description = pu.find_args(clazz);
             for item in full_description:
                 self.parameters[item['name']] = item['default']
예제 #3
0
파일: plugin.py 프로젝트: markbasham/Savu
    def _populate_default_parameters(self):
        """
        This method should populate all the required parameters with default
        values.  it is used for checking to see if new parameter values are
        appropriate

        It makes use of the classes including parameter information in the
        class docstring such as this

        :param error_threshold: Convergence threshold. Default: 0.001.
        """
        not_item = []
        for clazz in inspect.getmro(self.__class__)[::-1]:
            if clazz != object:
                desc = pu.find_args(clazz, self)
                self.docstring_info['warn'] = desc['warn']
                self.docstring_info['info'] = desc['info']
                self.docstring_info['synopsis'] = desc['synopsis']
                if desc['not_param']:
                    not_item.extend(desc['not_param'])
                self._add_item(desc['param'])
        if not_item:
            self._delete_item(not_item)
예제 #4
0
 def testfind_args(self):
     plugin = pu.load_plugin("savu.plugins.denoise_bregman_filter")
     params = pu.find_args(plugin)
     self.assertEqual(len(params), 4)
예제 #5
0
 def testfind_args(self):
     plugin = pu.load_plugin("savu.plugins.filters.denoise_bregman_filter")
     params = pu.find_args(plugin)
     self.assertEqual(len(params), 5)