@@ -41,8 +41,8 @@ class YehHummer(FittingBase):
4141
4242 :param diffusion: sc.DataArray with diffusion coefficients and box_length coordinate
4343 :param temperature: Temperature (will be extracted from coords if not provided)
44- :param priors: Optional priors for [D_0, viscosity ] parameters using scipy.stats objects
45- (viscosity in Pa*s)
44+ :param priors: Optional priors for [D_0, slope ] parameters using scipy.stats objects,
45+ where slope has units of [diffusion] * [length]
4646 """
4747
4848 def __init__ (self , diffusion , temperature : sc .Variable , priors = None ):
@@ -65,15 +65,14 @@ def __init__(self, diffusion, temperature: sc.Variable, priors=None):
6565 # Compute priors: use provided or defaults
6666 if priors is None :
6767 D_max = np .max (diffusion .values )
68- D_prior = uniform (D_max * 0.8 , ( D_max * 2.0 ) - ( D_max - 0.8 ) )
68+ D_prior = uniform (D_max * 0.8 , D_max * 1.2 )
6969 visc_lower , visc_upper = 1e-5 * sc .Unit ('Pa*s' ), 1e-1 * sc .Unit ('Pa*s' )
7070
71- # Higher viscosity = lower slope, so bounds are inverted
72- slope_bounds = (
73- self .viscosity_to_slope (visc_upper ) * self ._slope_unit ,
74- self .viscosity_to_slope (visc_lower ) * self ._slope_unit ,
75- )
76- slope_prior = uniform (slope_bounds [0 ], slope_bounds [1 ] - slope_bounds [0 ])
71+ # Higher viscosity = lower slope, so bounds are inverted; viscosity_to_slope
72+ # already returns plain floats so no unit multiplication needed here
73+ slope_min = self .viscosity_to_slope (visc_upper )
74+ slope_max = self .viscosity_to_slope (visc_lower )
75+ slope_prior = uniform (slope_min , slope_max - slope_min )
7776 priors = [D_prior , slope_prior ]
7877 else :
7978 if len (priors ) != 2 :
0 commit comments