def coerce(self, probe, target): obj = target.obj if isinstance(target, ObjView) else target if not hasattr(obj, 'probeable'): raise ValidationError("Type %r is not probeable" % type(obj).__name__, attr=self.name, obj=probe) # do this after; better to know that type is not Probable first if isinstance(obj, LearningRule): # TODO: this special case should be able to be removed with #1310 return Parameter.coerce(self, probe, target) else: return super().coerce(probe, target)
def coerce(self, probe, target): obj = target.obj if isinstance(target, ObjView) else target if not hasattr(obj, 'probeable'): raise ValidationError("Type %r is not probeable" % type(obj).__name__, attr=self.name, obj=probe) # do this after; better to know that type is not Probable first if isinstance(obj, LearningRule): # TODO: this special case should be able to be removed with #1310 return Parameter.coerce(self, probe, target) else: return super().coerce(probe, target)
def coerce(self, probe, target): # pylint: disable=arguments-renamed obj = target.obj if isinstance(target, ObjView) else target if not hasattr(obj, "probeable"): raise ValidationError( f"Type '{type(obj).__name__}' is not probeable", attr=self.name, obj=probe, ) # do this after; better to know that type is not Probable first if isinstance(obj, LearningRule): # TODO: this special case should be able to be removed with #1310 return Parameter.coerce(self, probe, target) else: return super().coerce(probe, target)
def coerce(self, instance, distorarray): if isinstance(distorarray, Distribution): return Parameter.coerce(self, instance, distorarray) return super().coerce(instance, distorarray)
def coerce(self, instance, distorarray): # pylint: disable=arguments-renamed if isinstance(distorarray, Distribution): return Parameter.coerce(self, instance, distorarray) return super().coerce(instance, distorarray)
def coerce(self, instance, distorarray): if isinstance(distorarray, Distribution): return Parameter.coerce(self, instance, distorarray) return super().coerce(instance, distorarray)