L ip&ddlmZmZddlZddlZddlmZddlmZdgZ e Z ddddZ dd Z Gd d Zdd Zdddd ddZy)) Parameter signatureN) import_module) FunctionDoc _deprecatedz1.16.0)correct_module dep_versionc| d|d|}nd|}||vrtd|d|d|d|d|d tt||d}|d|d |d |d|d } n$d|d|d|d |d|d |d|d|d|d|d|d} tj| t d|D]} ttd|d||cSy#t$r} ||dk(r| Yd} ~ ;d} ~ wwxYw)aMHelper function for deprecating modules that are public but were intended to be private. Parameters ---------- sub_package : str Subpackage the module belongs to eg. stats module : str Public but intended private module to deprecate private_modules : list Private replacement(s) for `module`; should contain the content of ``all``, possibly spread over several modules. all : list ``__all__`` belonging to `module` attribute : str The attribute in `module` being accessed correct_module : str, optional Module in `sub_package` that `attribute` should be imported from. Default is that `attribute` should be imported from ``scipy.sub_package``. dep_version : str, optional Version in which deprecated attributes will be removed. Nzscipy..z`scipy.z` has no attribute `z`; furthermore, `scipy.z3` is deprecated and will be removed in SciPy 2.0.0.zPlease import `z ` from the `z` namespace; the `scipy.z=` namespace is deprecated and will be removed in SciPy 2.0.0.z&` is deprecated along with the `scipy.z` namespace. `scipy.z` will be removed in SciPy z, and the `scipy.z+` namespace will be removed in SciPy 2.0.0.category stacklevel)AttributeErrorgetattrrwarningswarnDeprecationWarning) sub_packagemoduleprivate_modulesall attributerr correct_importattrmessagees \/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/scipy/_lib/deprecation.py_sub_module_deprecationr s0!!+a/?@!+/k]!F8+? {K##.-q92 3  =0)T BD i[ ^4DE%ax02 3 k]!F81YK8%ax0!]!F81YK8#}$5k]!F8L. /  MM'$61E! =6+ax)HI9U U ,,   sB== C CCcfd}|S)z2Deprecate a function by emitting a warning on use.cttr!tjdtdSt j fd}j|_|S)NzTrying to deprecate class r cLtjt|i|S)Nr )rrr)argskwargsfunmsgrs rcallz'_deprecated..wrap..callZs' MM#(:%/ 1'' ') isinstancetyperrRuntimeWarning functoolswraps__doc__)r'r)r(rs` rwrapz_deprecated..wrapSs\ c4 MM,SG4'A 7J   (  ({{  r*)r(rr1s`` rrrQs  Kr*c"eZdZdZdZdZdZy)_DeprecationHelperStrz3 Helper class used by deprecate_cython_api c ||_||_yN)_content_message)selfcontentrs r__init__z_DeprecationHelperStr.__init__is  r*c,t|jSr6)hashr7)r9s r__hash__z_DeprecationHelperStr.__hash__msDMM""r*ct|j|k(}|r&tj|jtd|S)Nr#r )r7rrr8r)r9otherress r__eq__z_DeprecationHelperStr.__eq__ps0}}%  MM$--2D%& ( r*N)__name__ __module__ __qualname__r0r;r>rBr2r*rr4r4es #r*r4c(|jd|}|d|d}n d|d|d}||d|zz }|j}d}d } d ||} | |vr&d }|j| |t| |<|d z }nn3|s|j||t||<yy) a> Deprecate an exported cdef function in a public Cython API module. Only functions can be deprecated; typedefs etc. cannot. Parameters ---------- module : module Public Cython API module (e.g. scipy.linalg.cython_blas). routine_name : str Name of the routine to deprecate. May also be a fused-type routine (in which case its all specializations are deprecated). new_name : str New name to include in the deprecation warning message message : str Additional text in the deprecation warning message Examples -------- Usually, this function would be used in the top-level of the module ``.pyx`` file: >>> from scipy._lib.deprecation import deprecate_cython_api >>> import scipy.linalg.cython_blas as mod >>> deprecate_cython_api(mod, "dgemm", "dgemm_new", ... message="Deprecated in Scipy 1.5.0") >>> del deprecate_cython_api, mod After this, Cython modules that use the deprecated function emit a deprecation warning when they are imported. r N`z` is deprecated!z` is deprecated, use `z ` instead! rFT __pyx_fuse_)rC __pyx_capi__popr4) r routine_namenew_namerold_namedepdocdj has_fused fused_names rdeprecate_cython_apirUxsB//"!L>2HXJ./XJ4XJjI$. A AI "1#l^4 ?I;<55;LA#J7 8 FA   9:|9L  f 56 r*)versiondeprecated_argscustom_messagecz d}t| tn tfd}|||S|S)aDecorator for methods that issues warnings for positional arguments. Using the keyword-only argument syntax in pep 3102, arguments after the * will issue a warning when passed as a positional argument. Parameters ---------- func : callable, default=None Function to check arguments on. version : callable, default=None The version when positional arguments will result in error. deprecated_args : set of str, optional Arguments to deprecate - whether passed by position or keyword. custom_message : str, optional Custom message to add to deprecation warning and documentation. z9Need to specify a version where signature will be changedcl t gg jjD]c\}}|jtj k(rj |5|jtjk(sSj |e fd tj  fd}t|}t z }d d|d d} r |d d d z }| z }|d xx|gz cc<t|jd d d }t||_|S) Ncj|}|r+d|dd}|z }tj|tdyy)Nz Arguments zV are deprecated, whether passed by position or keyword. They will be removed in SciPy . r r ) intersectionrrr)r&r^rrYrXrWs rwarn_deprecated_argszb_deprecate_positional_args.._inner_deprecate_positional_args..warn_deprecated_argssS*77?L' ~6T%Yb*>) g0BqQ r*cPt|tz }|dkr ||i|Std|z }dj|}tjd|d dt d|j t j| |di|S) Nrz, z)You are passing as positional arguments: zE. Please change your invocation to use keyword arguments. From SciPy z@, passing these as positional arguments will result in an error.r#)rr2) lensetjoinrrrupdatezip parameters) r%r& extra_argskwonly_extra_argsargs_msgall_argsrXf kwonly_argssigrWr_s rinner_fzU_deprecate_positional_args.._inner_deprecate_positional_args..inner_fsTS]2JQ$V,$)&))!$K $< = O yy!23H MM?zJ"")+99 #  MM#cnnd3 4  (;v; r*z .. deprecated:: z Use of argument(s) ``z6`` by position is deprecated; beginning in SciPy z, these will be keyword-only. zArgument(s) ``zX`` are deprecated, whether passed by position or keyword; they will be removed in SciPy r]zExtended SummaryrHrJ)rrfitemskindrPOSITIONAL_OR_KEYWORDappend KEYWORD_ONLYr.r/rrbstrsplitr0)rknameparamrndocrh admonitionrjrlrmr_rYrXrWs` @@@@r _inner_deprecate_positional_argszD_deprecate_positional_args.._inner_deprecate_positional_argssPl >>//1 )KD%zzY<<<%y555""4(  )  R      0'" ,> +,- )15   ^O+<=$$+9B0 1J n$  J</#hnnT1%a(c(r*) ValueErrorrb)funcrWrXrYr(rzs ``` r_deprecate_positional_argsr}sK$Io.6ceCrs\(#- / 87;?D(&;M@Z,T/3BZ,r*