File tree Expand file tree Collapse file tree 2 files changed +33
-31
lines changed
Expand file tree Collapse file tree 2 files changed +33
-31
lines changed Original file line number Diff line number Diff line change @@ -501,38 +501,39 @@ def tabulate_results(multiple_morph_results):
501501def handle_extrapolation_warnings (morph ):
502502 if morph is not None :
503503 extrapolation_info = morph .extrapolation_info
504- is_extrap_low = extrapolation_info ["is_extrap_low" ]
505- is_extrap_high = extrapolation_info ["is_extrap_high" ]
506- cutoff_low = extrapolation_info ["cutoff_low" ]
507- cutoff_high = extrapolation_info ["cutoff_high" ]
508-
509- if is_extrap_low and is_extrap_high :
510- wmsg = (
511- "Warning: points with grid value below "
512- f"{ cutoff_low } and above "
513- f"{ cutoff_high } "
514- f"are extrapolated."
515- )
516- elif is_extrap_low :
517- wmsg = (
518- "Warning: points with grid value below "
519- f"{ cutoff_low } "
520- f"are extrapolated."
521- )
522- elif is_extrap_high :
523- wmsg = (
524- "Warning: points with grid value above "
525- f"{ cutoff_high } "
526- f"are extrapolated."
527- )
528- else :
529- wmsg = None
504+ if extrapolation_info is not None :
505+ is_extrap_low = extrapolation_info ["is_extrap_low" ]
506+ is_extrap_high = extrapolation_info ["is_extrap_high" ]
507+ cutoff_low = extrapolation_info ["cutoff_low" ]
508+ cutoff_high = extrapolation_info ["cutoff_high" ]
509+
510+ if is_extrap_low and is_extrap_high :
511+ wmsg = (
512+ "Warning: points with grid value below "
513+ f"{ cutoff_low } and above "
514+ f"{ cutoff_high } "
515+ f"are extrapolated."
516+ )
517+ elif is_extrap_low :
518+ wmsg = (
519+ "Warning: points with grid value below "
520+ f"{ cutoff_low } "
521+ f"are extrapolated."
522+ )
523+ elif is_extrap_high :
524+ wmsg = (
525+ "Warning: points with grid value above "
526+ f"{ cutoff_high } "
527+ f"are extrapolated."
528+ )
529+ else :
530+ wmsg = None
530531
531- if wmsg :
532- warnings .warn (
533- wmsg ,
534- UserWarning ,
535- )
532+ if wmsg :
533+ warnings .warn (
534+ wmsg ,
535+ UserWarning ,
536+ )
536537
537538
538539def handle_check_increase_warning (squeeze_morph ):
Original file line number Diff line number Diff line change @@ -124,6 +124,7 @@ def __init__(self, config=None):
124124 All configuration variables.
125125 """
126126 # declare empty attributes
127+ self .extrapolation_info = None
127128 if config is None :
128129 config = {}
129130 self .x_morph_in = None
You can’t perform that action at this time.
0 commit comments