Exemplo n.º 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.
        """
        hidden_items = []
        user_items = []
        params = []
        not_params = []
        for clazz in inspect.getmro(self.__class__)[::-1]:
            if clazz != object:
                desc = doc.find_args(clazz, self)
                self.docstring_info['warn'] = desc['warn']
                self.docstring_info['info'] = desc['info']
                self.docstring_info['synopsis'] = desc['synopsis']
                params.extend(desc['param'])
                if desc['hide_param']:
                    hidden_items.extend(desc['hide_param'])
                if desc['user_param']:
                    user_items.extend(desc['user_param'])
                if desc['not_param']:
                    not_params.extend(desc['not_param'])
        self._add_item(params, not_params)
        user_items = [u for u in user_items if u not in not_params]
        hidden_items = [h for h in hidden_items if h not in not_params]
        user_items = list(set(user_items).difference(set(hidden_items)))
        self.parameters_hide = hidden_items
        self.parameters_user = user_items
        self.final_parameter_updates()
Exemplo n.º 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.
        """
        hidden_items = []
        user_items = []
        params = []
        not_params = []
        for clazz in inspect.getmro(self.__class__)[::-1]:
            if clazz != object:
                desc = doc.find_args(clazz, self)
                self.docstring_info['warn'] = desc['warn']
                self.docstring_info['info'] = desc['info']
                self.docstring_info['synopsis'] = desc['synopsis']
                params.extend(desc['param'])
                if desc['hide_param']:
                    hidden_items.extend(desc['hide_param'])
                if desc['user_param']:
                    user_items.extend(desc['user_param'])
                if desc['not_param']:
                    not_params.extend(desc['not_param'])
        self._add_item(params, not_params)
        user_items = [u for u in user_items if u not in not_params]
        hidden_items = [h for h in hidden_items if h not in not_params]
        user_items = list(set(user_items).difference(set(hidden_items)))
        self.parameters_hide = hidden_items
        self.parameters_user = user_items
        self.final_parameter_updates()
Exemplo n.º 3
0
 def testfind_args(self):
     plugin = pu.get_plugin("savu.plugins.filters.denoise_bregman_filter")
     params = doc.find_args(plugin)
     self.assertEqual(len(params['param']), 4)
Exemplo n.º 4
0
 def testfind_args(self):
     mod = "savu.plugins.filters.denoising.denoise_bregman_filter"
     plugin = pu.load_class(mod)()
     params = doc.find_args(plugin)
     self.assertEqual(len(params['param']), 4)
Exemplo n.º 5
0
 def testfind_args(self):
     plugin = pu.get_plugin(
         "savu.plugins.filters.denoising.denoise_bregman_filter")
     params = doc.find_args(plugin)
     self.assertEqual(len(params['param']), 4)