@@ -449,6 +449,9 @@ def rbf_interpolation(x, x_min, x_max, x_data, y_data, coeffs): # pylint: disab
449449
450450 self ._interpolation_func = rbf_interpolation
451451
452+ else :
453+ raise ValueError (f"Interpolation { interpolation } method not recognized." )
454+
452455 def __set_extrapolation_func (self ): # pylint: disable=too-many-statements
453456 """Defines extrapolation function used by the Function. Each
454457 extrapolation method has its own function. The function is stored in
@@ -532,6 +535,11 @@ def natural_extrapolation(x, x_min, x_max, x_data, y_data, _):
532535 def natural_extrapolation (x , x_min , x_max , x_data , y_data , coeffs ): # pylint: disable=unused-argument
533536 return interpolator (x )
534537
538+ else :
539+ raise ValueError (
540+ f"Natural extrapolation not defined for { interpolation } ."
541+ )
542+
535543 self ._extrapolation_func = natural_extrapolation
536544 elif extrapolation == 2 : # constant
537545 if self .__dom_dim__ == 1 :
@@ -547,6 +555,8 @@ def constant_extrapolation(x, x_min, x_max, x_data, y_data, coeffs):
547555 return extrapolator (x )
548556
549557 self ._extrapolation_func = constant_extrapolation
558+ else :
559+ raise ValueError (f"Extrapolation { extrapolation } method not recognized." )
550560
551561 def set_get_value_opt (self ):
552562 """Defines a method that evaluates interpolations.
0 commit comments