"""Deprecated expression, for backward compatibilityMichel BierlaireThu Apr 3 09:55:57 2025"""importwarningsfrom.binary_maximportBinaryMaxfrom.binary_minimportBinaryMinfrom.drawsimportDrawsfrom.integrateimportIntegrateNormalfrom.linear_utilityimportLinearUtilityfrom.multiple_sumimportMultipleSumfrom.normalcdfimportNormalCdf
[docs]defdeprecated_wrapper(old_name,new_class,comment=None):defwrapper(*args,**kwargs):message=(f"'{old_name}' is deprecated and will be removed in a future version. "f"Use '{new_class.__name__}' instead.")ifcomment:message+=f"\n{comment}"warnings.warn(message,DeprecationWarning,stacklevel=2)returnnew_class(*args,**kwargs)wrapper.__name__=old_namedoc=(f"Deprecated wrapper for :class:`{new_class.__name__}`.\n\n"f".. warning::\n This function is deprecated and will be removed in a future version.\n"f" Use :class:`{new_class.__name__}` instead.\n")ifcomment:doc+=f"\n{comment}\n"wrapper.__doc__=docreturnwrapper
bioLinearUtility=deprecated_wrapper("bioLinearUtility",LinearUtility)bioMultSum=deprecated_wrapper("bioMultSum",MultipleSum)bioDraws=deprecated_wrapper("bioDraws",Draws)bioNormalCdf=deprecated_wrapper("bioNormalCdf",NormalCdf)bioMin=deprecated_wrapper("bioMin",BinaryMin)bioMax=deprecated_wrapper("bioMax",BinaryMax)comment_integrate=('In Biogeme 3.2, Integrate calculated the integral from -infinity to +infinity of f(x) dx.\n''Since Biogeme 3.3, it is not available anymore.\n''Instead, IntegrateNormal calculates the integral from -infinity to +infinity of f(x) * phi(x) dx,\n''where phi(x) is the probability density function of the normal distribution.')Integrate=deprecated_wrapper("Integrate",IntegrateNormal,comment=comment_integrate)