Пример #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
 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
    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)