コード例 #1
0
ファイル: param.py プロジェクト: tloredo/inference
 def _set_status(self, status):
     # Note it is possible for status to change without value
     # changing, e.g. when a varied param is fixed to its current
     # value.
     old = self.status
     self.status = status
     pielog.debug('setStatus for %s %s %s',self.name, old, status)
     for listener in self.listeners:
         listener._on_param_status_change(self, old, status)
コード例 #2
0
ファイル: predictor.py プロジェクト: tloredo/inference
 def _report_name(self, cls, name):
     pielog.debug('Predictor instance in %s is named %s', cls, name)
     self.name = name
     self.handler_name = '__' + name + '_hndlr'
     # Keep a list of predictor names in the class dict.
     try:
         cls.predictor_names.append(name)
     except AttributeError:
         cls.predictor_names = [name]
コード例 #3
0
ファイル: param.py プロジェクト: tloredo/inference
    def _report_name(self, cls, name):
	# Note that this gets called when the Param instance is
	# created, which happens when the containing *class* is
	# *defined*, not when it is instantiated.  We don't yet have
	# an *instance* of the containing class to save state in,
	# so we create and hold on to names that will hold the state
	# later, after an instance is created.
        pielog.debug('Param instance in %s is named %s', cls, name)
        self.name = name
        self.value_name = '__' + name + '_val'
        self.handler_name = '__' + name + '_hndlr'
        # Keep a list of param names in the class dict.
        try:
            cls.param_names.append(name)
        except AttributeError:
            cls.param_names = [name]