Coverage for /usr/lib/python3/dist-packages/scipy/optimize/cobyla.py: 50%

10 statements  

« prev     ^ index     » next       coverage.py v7.9.1, created at 2025-06-14 15:55 +0200

1# This file is not meant for public use and will be removed in SciPy v2.0.0. 

2# Use the `scipy.optimize` namespace for importing the functions 

3# included below. 

4 

5import warnings 

6from . import _cobyla_py 

7 

8 

9__all__ = [ # noqa: F822 

10 'OptimizeResult', 

11 'RLock', 

12 'fmin_cobyla', 

13 'functools', 

14 'izip', 

15 'synchronized', 

16] 

17 

18def __dir__(): 

19 return __all__ 

20 

21def __getattr__(name): 

22 if name not in __all__: 

23 raise AttributeError( 

24 "scipy.optimize.cobyla is deprecated and has no attribute " 

25 f"{name}. Try looking in scipy.optimize instead.") 

26 

27 warnings.warn(f"Please use `{name}` from the `scipy.optimize` namespace, " 

28 "the `scipy.optimize.cobyla` namespace is deprecated.", 

29 category=DeprecationWarning, stacklevel=2) 

30 

31 return getattr(_cobyla_py, name)