@@ -78,11 +78,26 @@ def _set_squeeze_info(self, x, x_sorted):
7878 if list (x ) != list (x_sorted ):
7979 if self .check_increase :
8080 raise ValueError (
81- "Squeezed grid is not strictly increasing."
82- "Please (1) decrease the order of your polynomial and "
83- "(2) ensure that the initial polynomial morph result in "
84- "good agreement between your reference and "
85- "objective functions."
81+ "Error: The polynomial applied by the squeeze morph has "
82+ "resulted in a grid that is no longer strictly increasing"
83+ ", likely due to a convergence issue. A strictly "
84+ "increasing grid is required for diffpy.morph to compute "
85+ "the morphed function through cubic spline interpolation. "
86+ "Here are some suggested methods to resolve this:\n "
87+ "(1) Please decrease the order of your polynomial and "
88+ "try again.\n "
89+ "(2) If you are using initial guesses of all 0, please "
90+ "ensure your objective function only requires a small "
91+ "polynomial squeeze to match your reference. (In other "
92+ "words, there is good agreement between the two functions"
93+ ".)\n "
94+ "(3) If you expect a large polynomial squeeze to be needed"
95+ ", please ensure your initial parameters for the "
96+ "polynomial morph result in good agreement between your "
97+ "reference and objective functions. One way to obtain "
98+ "such parameters is to first apply a --hshift and "
99+ "--stretch morph. Then, use the hshift parameter for a0 "
100+ "and stretch parameter for a1."
86101 )
87102 else :
88103 overlapping_regions = self ._get_overlapping_regions (x )
0 commit comments