From 4d23ebeb068c8d6ba6edfc11d32ab2af8bb89c74 Mon Sep 17 00:00:00 2001 From: Alessia Marcolini <98marcolini@gmail.com> Date: Fri, 8 Oct 2021 09:49:11 +0000 Subject: MAINT: remove unused imports --- numpy/core/getlimits.py | 1 - 1 file changed, 1 deletion(-) (limited to 'numpy/core/getlimits.py') diff --git a/numpy/core/getlimits.py b/numpy/core/getlimits.py index 0f7031bac..c96e6d5e7 100644 --- a/numpy/core/getlimits.py +++ b/numpy/core/getlimits.py @@ -11,7 +11,6 @@ from . import numeric from . import numerictypes as ntypes from .numeric import array, inf, NaN from .umath import log10, exp2, nextafter, isnan -from . import umath def _fr0(a): -- cgit v1.2.1 From ae3c21991a617d60d8093e3e958a6b0b5fb0eeb6 Mon Sep 17 00:00:00 2001 From: Bas van Beek Date: Wed, 20 Oct 2021 11:38:42 +0200 Subject: DEP: Deprecate the `np.core.machar` module --- numpy/core/getlimits.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'numpy/core/getlimits.py') diff --git a/numpy/core/getlimits.py b/numpy/core/getlimits.py index c96e6d5e7..d6efa5ac6 100644 --- a/numpy/core/getlimits.py +++ b/numpy/core/getlimits.py @@ -5,7 +5,7 @@ __all__ = ['finfo', 'iinfo'] import warnings -from .machar import MachAr +from ._machar import MachAr from .overrides import set_module from . import numeric from . import numerictypes as ntypes -- cgit v1.2.1 From cbc1d01d4260ff92fa9c3292d8dd67e6137a20fe Mon Sep 17 00:00:00 2001 From: Bas van Beek <43369155+BvB93@users.noreply.github.com> Date: Wed, 27 Oct 2021 20:53:24 +0200 Subject: DEP: Deprecate `finfo.machar` --- numpy/core/getlimits.py | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) (limited to 'numpy/core/getlimits.py') diff --git a/numpy/core/getlimits.py b/numpy/core/getlimits.py index d6efa5ac6..ab4a4d2be 100644 --- a/numpy/core/getlimits.py +++ b/numpy/core/getlimits.py @@ -385,6 +385,8 @@ class finfo: machar : MachAr The object which calculated these parameters and holds more detailed information. + + .. deprecated:: 1.22 machep : int The exponent that yields `eps`. max : floating point number of the appropriate type @@ -501,7 +503,7 @@ class finfo: self.eps = machar.eps.flat[0] self.nexp = machar.iexp self.nmant = machar.it - self.machar = machar + self._machar = machar self._str_tiny = machar._str_xmin.strip() self._str_max = machar._str_xmax.strip() self._str_epsneg = machar._str_epsneg.strip() @@ -551,11 +553,11 @@ class finfo: """ # This check is necessary because the value for smallest_normal is # platform dependent for longdouble types. - if isnan(self.machar.smallest_normal.flat[0]): + if isnan(self._machar.smallest_normal.flat[0]): warnings.warn( 'The value of smallest normal is undefined for double double', UserWarning, stacklevel=2) - return self.machar.smallest_normal.flat[0] + return self._machar.smallest_normal.flat[0] @property def tiny(self): @@ -574,6 +576,20 @@ class finfo: """ return self.smallest_normal + @property + def machar(self): + """The object which calculated these parameters and holds more + detailed information. + + .. deprecated:: 1.22 + """ + # Deprecated 2021-10-27, NumPy 1.22 + warnings.warn( + "`finfo.machar` is deprecated (NumPy 1.22)", + DeprecationWarning, stacklevel=2, + ) + return self._machar + @set_module('numpy') class iinfo: -- cgit v1.2.1